summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2022-12-08 22:48:09 -0900
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-12-12 14:20:46 +0000
commitb7a51a7cd46e155ad78ac0f9301863d5a1eabd52 (patch)
treebc5435c06e81ac80e9a44a0dd972ae4a7d0da243 /sw
parentd8db6a072968f58bd6178dbfd5ac695976171b6e (diff)
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.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/utlui/content.cxx39
1 files changed, 39 insertions, 0 deletions
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;