sw/source/uibase/inc/conttree.hxx  |    1 -
 sw/source/uibase/utlui/content.cxx |   33 ++++++---------------------------
 2 files changed, 6 insertions(+), 28 deletions(-)

New commits:
commit c73354b9f66ba436d933cc6558a38470e00c6ba8
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Wed Dec 21 00:07:30 2022 -0900
Commit:     Jim Raykowski <rayk...@gmail.com>
CommitDate: Wed Dec 21 22:55:16 2022 +0000

    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 <rayk...@gmail.com>

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;

Reply via email to