tdf#152029 Headings can also use BringTypesWithFlowFramesToAttention

Change-Id: If4c094471bda4e01151680dc1f356eefa48aa4f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144689
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
This commit is contained in:
Jim Raykowski 2022-12-21 00:07:30 -09:00
parent 3ff4194a8a
commit c73354b9f6
2 changed files with 6 additions and 28 deletions

View file

@ -138,7 +138,6 @@ class SwContentTree final : public SfxListener
void OverlayObject(std::vector<basegfx::B2DRange>&& aRanges);
void BringHeadingsToAttention(const SwOutlineNodes& rOutlineNodesArr);
void BringFramesToAttention(const std::vector<const SwFrameFormat*>& rFrameFormats);
void BringBookmarksToAttention(const std::vector<OUString>& rNames);
void BringURLFieldsToAttention(const SwGetINetAttrs& rINetAttrsArr);

View file

@ -1188,10 +1188,8 @@ IMPL_LINK(SwContentTree, MouseMoveHdl, const MouseEvent&, rMEvt, bool)
{
if (nType == ContentTypeId::OUTLINE)
{
SwOutlineNodes aOutlineNodes;
aOutlineNodes.insert(m_pActiveShell->GetNodes().
GetOutLineNds()[static_cast<SwOutlineContent*>(pCnt)->GetOutlinePos()]);
BringHeadingsToAttention(aOutlineNodes);
BringTypesWithFlowFramesToAttention({m_pActiveShell->GetNodes().
GetOutLineNds()[static_cast<SwOutlineContent*>(pCnt)->GetOutlinePos()]});
}
else if (nType == ContentTypeId::TABLE)
{
@ -1285,7 +1283,10 @@ IMPL_LINK(SwContentTree, MouseMoveHdl, const MouseEvent&, rMEvt, bool)
{
if (nType == ContentTypeId::OUTLINE)
{
BringHeadingsToAttention(m_pActiveShell->GetNodes().GetOutLineNds());
std::vector<const SwNode*> aNodesArr(
m_pActiveShell->GetNodes().GetOutLineNds().begin(),
m_pActiveShell->GetNodes().GetOutLineNds().end());
BringTypesWithFlowFramesToAttention(aNodesArr);
}
else if (nType == ContentTypeId::TABLE)
{
@ -5786,28 +5787,6 @@ void SwContentTree::OverlayObject(std::vector<basegfx::B2DRange>&& aRanges)
m_aOverlayObjectDelayTimer.Start();
}
void SwContentTree::BringHeadingsToAttention(const SwOutlineNodes& rOutlineNodesArr)
{
std::vector<basegfx::B2DRange> aRanges;
for (const SwNode* p : rOutlineNodesArr)
{
if (!p || !p->GetTextNode())
continue;
const SwTextNode& rTextNode = *p->GetTextNode();
if (const SwTextFrame* pFrame = static_cast<const SwTextFrame*>(
rTextNode.getLayoutFrame(m_pActiveShell->GetLayout())))
{
SwContentIndex nIndex(&rTextNode);
auto nStart = nIndex.GetIndex();
auto nEnd = nStart + rTextNode.GetText().getLength();
SwPosition aStartPos(rTextNode, nStart), aEndPos(rTextNode, nEnd);
lcl_CalcOverlayRanges(pFrame, pFrame, aStartPos, aEndPos, aRanges);
}
}
if (aRanges.size())
OverlayObject(std::move(aRanges));
}
void SwContentTree::BringFramesToAttention(const std::vector<const SwFrameFormat*>& rFrameFormats)
{
std::vector<basegfx::B2DRange> aRanges;