diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-07-05 15:58:05 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-07-06 12:09:03 +0200 |
commit | 1a72ccd57909bf795fe60fafbdcb7ed5566d61cc (patch) | |
tree | 0bd32eabcfdd8792d95a867f53bc90228158e212 | |
parent | 36f411db7aa6682fd30d0bb9b181c144d5c24cfd (diff) |
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@cib.de>
(cherry picked from commit 2b0a7c346f8e3c5823a9e032a4501f20bc712914)
Reviewed-on: https://gerrit.libreoffice.org/57043
-rw-r--r-- | sw/source/core/text/itratr.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
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; } |