diff options
author | Jim Raykowski <raykowj@gmail.com> | 2022-12-21 00:07:30 -0900 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2022-12-21 22:55:16 +0000 |
commit | c73354b9f66ba436d933cc6558a38470e00c6ba8 (patch) | |
tree | 31ecb128bd5d9b98ef31c0a8bad73ae33bde22c2 | |
parent | 3ff4194a8acff9da2cad7776cfd57f82bc71ce25 (diff) |
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>
-rw-r--r-- | sw/source/uibase/inc/conttree.hxx | 1 | ||||
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 33 |
2 files changed, 6 insertions, 28 deletions
diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx index d10b5ba9da1e..1e6bacbcd4db 100644 --- a/sw/source/uibase/inc/conttree.hxx +++ b/sw/source/uibase/inc/conttree.hxx @@ -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); diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 3c03b26323ce..f68d6f089da6 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -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; |