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

New commits:
commit 25778012374b2f03cd01303c01d167206515ee71
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Thu Dec 8 22:48:09 2022 -0900
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Dec 13 18:00:14 2022 +0000

    tdf#152029 Bring sections to attention in the document view
    
    when mouse pointer is over section content type and content entries in
    the Navigator content tree
    
    Change-Id: Icdfb680752a698ad076eaaabc237b1b6facb1704
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143845
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    (cherry picked from commit b7a51a7cd46e155ad78ac0f9301863d5a1eabd52)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144014
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index dbed1715e32d..a930c15c912e 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1213,6 +1213,27 @@ IMPL_LINK(SwContentTree, MouseMoveHdl, const 
MouseEvent&, rMEvt, bool)
                 {
                     BringBookmarksToAttention(std::vector<OUString> 
{pCnt->GetName()});
                 }
+                else if (nType == ContentTypeId::REGION)
+                {
+                    const SwSectionFormats& rFormats = 
m_pActiveShell->GetDoc()->GetSections();
+                    if (const size_t nSize = rFormats.size())
+                    {
+                        auto aEntryName = pCnt->GetName();
+                        for (SwSectionFormats::size_type n = nSize; n;)
+                        {
+                            if (const SwSectionFormat* pFormat = rFormats[--n])
+                            {
+                                const SwSection* pSect = pFormat->GetSection();
+                                if (pSect && !pSect->IsHiddenFlag() &&
+                                        pSect->GetSectionName() == aEntryName)
+                                {
+                                    BringFramesToAttention(std::vector<const 
SwFrameFormat*> {pFormat});
+                                    break;
+                                }
+                            }
+                        }
+                    }
+                }
                 else if (nType == ContentTypeId::URLFIELD)
                 {
                     BringURLFieldsToAttention(SwGetINetAttrs 
{SwGetINetAttr(pCnt->GetName(),
@@ -1302,6 +1323,24 @@ IMPL_LINK(SwContentTree, MouseMoveHdl, const 
MouseEvent&, rMEvt, bool)
                         BringBookmarksToAttention(aNames);
                     }
                 }
+                else if (nType == ContentTypeId::REGION)
+                {
+                    const SwSectionFormats& rFormats = 
m_pActiveShell->GetDoc()->GetSections();
+                    if (const size_t nSize = rFormats.size())
+                    {
+                        std::vector<const SwFrameFormat*> aSectionsFormatsArr;
+                        for (SwSectionFormats::size_type n = nSize; n;)
+                        {
+                            if (const SwSectionFormat* pFormat = rFormats[--n])
+                            {
+                                const SwSection* pSect = pFormat->GetSection();
+                                if (pSect && !pSect->IsHiddenFlag())
+                                    aSectionsFormatsArr.push_back(pFormat);
+                            }
+                        }
+                        BringFramesToAttention(aSectionsFormatsArr);
+                    }
+                }
                 else if (nType == ContentTypeId::URLFIELD)
                 {
                     SwGetINetAttrs aINetAttrsArr;

Reply via email to