sw/source/uibase/utlui/content.cxx |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

New commits:
commit ca34204a39716ec9aa621e60ea50fb3c058c55f6
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Sat Apr 30 23:31:28 2022 -0800
Commit:     Jim Raykowski <rayk...@gmail.com>
CommitDate: Wed May 4 06:06:23 2022 +0200

    related tdf#148312 Don't search for hyperlinks in ToxContent to track
    
    Hyperlinks in ToxContent aren't included in the Navigator content
    tree Hyperlinks members list. This patch saves some cycles by not
    searching through the Hyperlinks members list when the hyperlink is
    in ToxContent.
    
    Change-Id: Icc332748f37dee02f0bc5f6fc0500fed51dd1182
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133669
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <rayk...@gmail.com>

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 12f5d9e9f121..89f9f627e7cc 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3762,6 +3762,24 @@ void SwContentTree::UpdateTracking()
                 
m_pActiveShell->GetContentAtPos(m_pActiveShell->GetCursorDocPos(), 
aContentAtPos) &&
                 !(m_bIsRoot && m_nRootType != ContentTypeId::URLFIELD))
         {
+            // There is no need to search for hyperlinks in ToxContent 
tdf#148312
+            if (const SwTextINetFormat* pTextINetFormat =
+                    static_txtattr_cast<const 
SwTextINetFormat*>(aContentAtPos.pFndTextAttr))
+            {
+                if (const SwTextNode* pTextNode = 
pTextINetFormat->GetpTextNode())
+                {
+                    if (const SwSectionNode* pSectNd = 
pTextNode->FindSectionNode())
+                    {
+                        SectionType eType = pSectNd->GetSection().GetType();
+                        if (SectionType::ToxContent == eType)
+                        {
+                            m_xTreeView->set_cursor(-1);
+                            Select();
+                            return;
+                        }
+                    }
+                }
+            }
             // Because hyperlink item names do not need to be unique, finding 
the corresponding item
             // in the tree by name may result in incorrect selection. Find the 
item in the tree by
             // comparing the SwTextINetFormat pointer at the document cursor 
position to that stored

Reply via email to