sw/source/uibase/utlui/content.cxx | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)
New commits: commit b7a51a7cd46e155ad78ac0f9301863d5a1eabd52 Author: Jim Raykowski <rayk...@gmail.com> AuthorDate: Thu Dec 8 22:48:09 2022 -0900 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Dec 12 14:20:46 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> diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index e8eb722c1338..a7c74261c4f8 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;