[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

Michael Stahl Michael.Stahl at cib.de
Fri Jul 6 10:09:30 UTC 2018


 sw/source/core/text/itratr.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 1a72ccd57909bf795fe60fafbdcb7ed5566d61cc
Author: Michael Stahl <Michael.Stahl at cib.de>
Date:   Thu Jul 5 15:58:05 2018 +0200

    tdf#118414 sw: fix fieldmarks in GetNextAttr()
    
    Apparently this needs to stop both before and after the CH_TXT_ATR_*.
    
    (regression from 3e724847308c0d9cdd727898faaeb347c5f0643a)
    
    Change-Id: Iff3d594d2eec59436ad683b9cc7aca04f7527bd5
    Reviewed-on: https://gerrit.libreoffice.org/57017
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 2b0a7c346f8e3c5823a9e032a4501f20bc712914)
    Reviewed-on: https://gerrit.libreoffice.org/57043

diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index d1f77e062ee9..b6e53480d6e4 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -674,9 +674,11 @@ static sal_Int32 GetNextAttrImpl(SwTextNode const*const pTextNode,
         }
     }
     assert(p <= nNext);
-    if (p < l && nPosition < p)
+    if (p < l)
     {
-        nNext=p;
+        // found a CH_TXT_ATR_FIELD*: if it's same as current position,
+        // skip behind it so that both before- and after-positions are returned
+        nNext = (nPosition < p) ? p : p + 1;
     }
     return nNext;
 }


More information about the Libreoffice-commits mailing list