sw/source/uibase/utlui/glbltree.cxx |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit b97aa4eada3164b20f663a9817e92af78495109f
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Sun Oct 8 22:42:09 2023 -0800
Commit:     Jim Raykowski <rayk...@gmail.com>
CommitDate: Tue Oct 17 05:20:05 2023 +0200

    tdf#144349 related: Make master document navigator track TOX content
    
    Done, with a related patch to make the master document navigator track 
'Text' content, to make the Navigator less likely not to have an item selected, 
which may be enough to resolve tdf#155741 - Allow insertion of items into 
master without a selected item
    
    Change-Id: I6df1b668c502cadbe057229e031ede9aa4f4089a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157695
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <rayk...@gmail.com>

diff --git a/sw/source/uibase/utlui/glbltree.cxx 
b/sw/source/uibase/utlui/glbltree.cxx
index 26dd58f5b7ea..fe18195e7c22 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -801,7 +801,20 @@ void SwGlobalTree::UpdateTracking()
         const SwSection* pSection = pActiveShellCurrSection;
         while (SwSection* pParent = pSection->GetParent())
             pSection = pParent;
-        m_xTreeView->select_text(pSection->GetSectionName());
+        for (const std::unique_ptr<SwGlblDocContent>& rGlblDocContent : 
*m_pSwGlblDocContents)
+        {
+            if (rGlblDocContent->GetType() == 
GlobalDocContentType::GLBLDOC_UNKNOWN)
+                continue;
+            if ((pSection->GetType() == SectionType::ToxContent
+                 && rGlblDocContent->GetTOX() == pSection->GetTOXBase())
+                    || (pSection->GetType() != SectionType::ToxContent
+                        && rGlblDocContent->GetSection() == pSection))
+            {
+                const OUString& rId(weld::toId(rGlblDocContent.get()));
+                m_xTreeView->select(m_xTreeView->find_id(rId));
+                break;
+            }
+        }
     }
 
     Select();

Reply via email to