summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-11-26 19:55:27 +0100
committerMichael Stahl <michael.stahl@cib.de>2020-11-27 09:46:29 +0100
commit6a11f94ab366e1d736e97e31e908e86aa5d8b533 (patch)
tree66b725f9f8f0b35a06d2fd2b4d887305509dfb11 /sw
parent283124fcf07fe8e38417579ce6d94ecf56715ac1 (diff)
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@cib.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/docbm.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 406685c58691..c71178e1f005 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1405,10 +1405,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;
}