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

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 9 20:55:25 UTC 2020


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

New commits:
commit f2e448175cee92fc695413e7281223e9f23e30ee
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 22:54:54 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/+/95882
    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 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),


More information about the Libreoffice-commits mailing list