summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2022-12-17 10:09:05 -0900
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-12-20 06:10:14 +0000
commita89972b681cf041b47b3e059c16f1e1080972a7f (patch)
treecdd12a528b91c8c6c5484e7261b2756d6a27969e
parent24ead7e8a237fca3cc7bc9078a0b7378fa63a4a5 (diff)
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.grandin@collabora.co.uk> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144455
-rw-r--r--sw/source/uibase/utlui/content.cxx14
1 files changed, 9 insertions, 5 deletions
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);
}