summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-06-08 17:24:18 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-06-09 22:54:54 +0200
commitf2e448175cee92fc695413e7281223e9f23e30ee (patch)
tree5124169417a2f18ef5ac98dbd046a2d9629b6779
parent56a5e5d9fdbc1542c802d1dcb7ce84e99de85fcb (diff)
tdf#133604 sw: DOCX export: put CH_TXT_ATR_FORMELEMENT in its own run
Commit b03fefcc4dbdfee3b9eeb5fa0e586dd12ddcd3d2 ought to have fixed this but didn't; the run following the CH_TXT_ATR_FORMELEMENT still ended up inside the field result. But when importing that into Writer, it appeared correct; Word shows the problem. (regression from 94e0b8407b02d76b27324b8b08012eb024aca9e9) Change-Id: I1fc1328223353422a83d403e8f790d156dbec4e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95843 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 7f2908b83a39bbb6fa648d6815265ad203f86ddc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95882 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 05a50e7f8b68..f7dc3e2207d2 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -259,7 +259,11 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos )
}
sal_Int32 fieldSepPos = aText.indexOf(CH_TXT_ATR_FIELDSEP, nStartPos);
sal_Int32 fieldStartPos = aText.indexOf(CH_TXT_ATR_FIELDSTART, nStartPos);
- sal_Int32 formElementPos = aText.indexOf(CH_TXT_ATR_FORMELEMENT, nStartPos);
+ sal_Int32 formElementPos = aText.indexOf(CH_TXT_ATR_FORMELEMENT, nStartPos - 1);
+ if (0 <= formElementPos && formElementPos < nStartPos)
+ {
+ ++formElementPos; // tdf#133604 put this in its own run
+ }
const sal_Int32 pos = lcl_getMinPos(
lcl_getMinPos(lcl_getMinPos(fieldEndPos, fieldSepPos), fieldStartPos),