sw/source/core/crsr/crbm.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 4d62b2346b1e6c7297f62394d722c6d7e1b9ec0f
Author:     Skyler Grey <[email protected]>
AuthorDate: Mon Feb 2 11:46:58 2026 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Tue Feb 3 15:15:08 2026 +0100

    fix(CrossRefBookmark): fix hidden detection
    
    Previously we detected whether a bookmark was hidden by seeing if the
    point it referred to was hidden. That worked fine for normal bookmarks,
    but cross reference bookmarks were sometimes detected as hidden even
    when they still appeared in the document. This could happen when some
    text was hidden at the start of a referenced heading, for example via
    redlining, even while the rest of the heading were still there.
    
    Instead, we should detect whether the heading exists at all (i.e.
    whether it is not merged with another text node) to determine whether it
    should be considered "hidden"
    
    Change-Id: Id5812fcbf32b1310827c126618b1f20c6a6a6964
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198554
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit eaddfb1ba20cebf4a909cd144679f05182b9e255)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198596
    Tested-by: Andras Timar <[email protected]>
    Reviewed-by: Andras Timar <[email protected]>

diff --git a/sw/source/core/crsr/crbm.cxx b/sw/source/core/crsr/crbm.cxx
index bf9cc7e9c805..2911ab7e44d9 100644
--- a/sw/source/core/crsr/crbm.cxx
+++ b/sw/source/core/crsr/crbm.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <crossrefbookmark.hxx>
 #include <crsrsh.hxx>
 #include <ndtxt.hxx>
 #include <rootfrm.hxx>
@@ -154,6 +155,10 @@ bool IsMarkHidden(SwRootFrame const& rLayout, 
::sw::mark::MarkBase const& rMark)
         {   // at end of node: never deleted (except if node deleted)
             return pTextNode->GetRedlineMergeFlag() == SwNode::Merge::Hidden;
         }
+        else if (dynamic_cast<mark::CrossRefBookmark const*>(&rMark))
+        {
+            return pFrame->GetMergedPara() && 
pFrame->GetMergedPara()->pParaPropsNode != pTextNode;
+        }
         else
         {   // check character following mark pos
             return pFrame->MapModelToViewPos(rMark.GetMarkPos())

Reply via email to