diff options
author | Jim Raykowski <raykowj@gmail.com> | 2023-10-08 22:42:09 -0800 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2023-10-17 05:20:05 +0200 |
commit | b97aa4eada3164b20f663a9817e92af78495109f (patch) | |
tree | 962035e6e4e539d5c804ab12c43fbaca9cccdf29 | |
parent | 3161a6c351a2f5f70c0420ee8cccf2eb23de1ecf (diff) |
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 <raykowj@gmail.com>
-rw-r--r-- | sw/source/uibase/utlui/glbltree.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
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(); |