sw/source/uibase/utlui/content.cxx |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit a89972b681cf041b47b3e059c16f1e1080972a7f
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Sat Dec 17 10:09:05 2022 -0900
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Dec 20 06:10:14 2022 +0000

    tdf#152029 Bring tox sections to attention in the document view
    
    when the mouse pointer is over index content type and content entries
    in the Navigator content tree
    
    Change-Id: Ia9ec89ed55da7b62b00b016a6e1dbda5fab54a7a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144390
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144455

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 3ab2041e1898..e45e6f9e9938 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1216,7 +1216,7 @@ IMPL_LINK(SwContentTree, MouseMoveHdl, const MouseEvent&, 
rMEvt, bool)
                 {
                     BringBookmarksToAttention(std::vector<OUString> 
{pCnt->GetName()});
                 }
-                else if (nType == ContentTypeId::REGION)
+                else if (nType == ContentTypeId::REGION|| nType == 
ContentTypeId::INDEX)
                 {
                     const SwSectionFormats& rFormats = 
m_pActiveShell->GetDoc()->GetSections();
                     const SwSectionFormat* pFormat = 
rFormats.FindFormatByName(pCnt->GetName());
@@ -1320,7 +1320,7 @@ IMPL_LINK(SwContentTree, MouseMoveHdl, const MouseEvent&, 
rMEvt, bool)
                     }
                     BringBookmarksToAttention(aNames);
                 }
-                else if (nType == ContentTypeId::REGION)
+                else if (nType == ContentTypeId::REGION || nType == 
ContentTypeId::INDEX)
                 {
                     const SwSectionFormats& rFormats = 
m_pActiveShell->GetDoc()->GetSections();
                     if (const size_t nSize = rFormats.size())
@@ -1334,9 +1334,13 @@ IMPL_LINK(SwContentTree, MouseMoveHdl, const 
MouseEvent&, rMEvt, bool)
                                 const SwSection* pSection = 
pFormat->GetSection();
                                 if (pSection && !pSection->IsHiddenFlag())
                                 {
-                                    if (SectionType eSectionType = 
pSection->GetType();
-                                            eSectionType == 
SectionType::ToxContent ||
-                                            eSectionType == 
SectionType::ToxHeader)
+                                    const SectionType eSectionType = 
pSection->GetType();
+                                    if (nType == ContentTypeId::REGION &&
+                                            (eSectionType == 
SectionType::ToxContent ||
+                                            eSectionType == 
SectionType::ToxHeader))
+                                        continue;
+                                    if (nType == ContentTypeId::INDEX &&
+                                            eSectionType != 
SectionType::ToxContent)
                                         continue;
                                     aSectionsFormatsArr.push_back(pFormat);
                                 }

Reply via email to