sw/source/core/text/porlay.cxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit f8b7cdd6b017011a286215bde2d5d064048818a6
Author:     László Németh <nem...@numbertext.org>
AuthorDate: Mon Jan 23 20:06:32 2023 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Tue Jan 24 12:58:09 2023 +0000

    tdf#152541 sw: don't show hidden __RefHeading__ bookmarks
    
    In visible bookmark mode, don't show __RefHeading__ bookmarks,
    which are hidden in Navigator, too. Note: they are inserted
    automatically e.g. with the ToC at the beginning of the headings.
    
    Follow-up to commit 4ce8120f1e53f7b81e653b01d141643013bc69ab
    "tdf#45589 sw: create and paint text portions for bookmarks".
    
    Change-Id: Id337613342fa74f5edef59d01349810f9737b62c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146044
    Tested-by: László Németh <nem...@numbertext.org>
    Reviewed-by: László Németh <nem...@numbertext.org>
    (cherry picked from commit 9bec4732915ef408d9a442ccbeb9b582a204b1ca)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146030
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 5e50f7ad5873..7115c90e7bca 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -1241,6 +1241,15 @@ void SwScriptInfo::InitScriptInfo(const SwTextNode& 
rNode,
 
         for (auto const& it : bookmarks)
         {
+            // don't show __RefHeading__ bookmarks, which are hidden in 
Navigator, too
+            // (They are inserted automatically e.g. with the ToC at the 
beginning of
+            // the headings)
+            if (it.first->GetName().startsWith(
+                                    
IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()))
+            {
+                continue;
+            }
+
             // search for custom bookmark boundary mark color
             Color c = getBookmarkColor(rNode, it.first);
 

Reply via email to