[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Tue Dec 1 19:34:19 UTC 2020


 sw/source/core/doc/docbm.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 8ea3a9230e8975a5ec5516c6c59a1f69f1160b20
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Thu Nov 26 19:55:27 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Dec 1 20:33:44 2020 +0100

    sw_fieldmarkhide: fix getFieldMarkFor() to return innermost field
    
    ... like it's supposed to; if it finds the outer field and then the next
    field is inside but ends *before* the rPos then the loop is erroneously
    terminated.
    
    Change-Id: Ic5e469d1c05cecd7feca275dc1689af2c40567f3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106710
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 6a11f94ab366e1d736e97e31e908e86aa5d8b533)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106689
    (cherry picked from commit fd596591b385a8b03459a7dd3f79e65a59f530f4)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106939
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index c76e4417c020..fb8206e61d21 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1383,10 +1383,11 @@ namespace sw::mark
             return nullptr;
         auto pFieldmark(*itFieldmark);
         for ( ; itFieldmark != m_vFieldmarks.end()
-                && (**itFieldmark).IsCoveringPosition(rPos); ++itFieldmark)
+                && (**itFieldmark).GetMarkStart() <= rPos; ++itFieldmark)
         {   // find the innermost fieldmark
-            if (pFieldmark->GetMarkStart() < (**itFieldmark).GetMarkStart()
-                || (**itFieldmark).GetMarkEnd() < pFieldmark->GetMarkEnd())
+            if (rPos < (**itFieldmark).GetMarkEnd()
+                && (pFieldmark->GetMarkStart() < (**itFieldmark).GetMarkStart()
+                    || (**itFieldmark).GetMarkEnd() < pFieldmark->GetMarkEnd()))
             {
                 pFieldmark = *itFieldmark;
             }


More information about the Libreoffice-commits mailing list