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

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 9 14:38:34 UTC 2020


 sw/source/filter/ww8/wrtw8nds.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit a9c0c16ae407b1708df770f669290fd8334150ff
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Mon Jun 8 17:24:18 2020 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Tue Jun 9 16:38:02 2020 +0200

    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 at cib.de>
    (cherry picked from commit 7f2908b83a39bbb6fa648d6815265ad203f86ddc)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95881
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index bec214a2830e..763e46000069 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -252,7 +252,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),


More information about the Libreoffice-commits mailing list