sw/source/filter/ww8/docxexport.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 430664da40b99effa241470df239b8c52a0a3c94
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Oct 28 18:05:56 2025 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Wed Oct 29 17:08:46 2025 +0100

    mso-test: emit w:ulTrailSpace in correct order in settings.xml
    
    When loading and then saving the document from forum-mso-en3-23097.docx,
    we end up with incorrect ordering of w:ulTrailSpace under w:compat in 
settings.xml
    
    Change-Id: I5af994c2c83842883ab9fd71005633e3d1236d3b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193109
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/sw/source/filter/ww8/docxexport.cxx 
b/sw/source/filter/ww8/docxexport.cxx
index f7bdecc700b6..8fc3e2e8b28b 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -1076,6 +1076,8 @@ WriteCompat(SwDoc const& rDoc, 
::sax_fastparser::FSHelperPtr const& rpFS,
             rTargetCompatibilityMode = 14;
         }
     }
+    if (rIDSA.get(DocumentSettingId::MS_WORD_UL_TRAIL_SPACE))
+        rpFS->singleElementNS(XML_w, XML_ulTrailSpace);
     // Do not justify lines with manual break
     if (rIDSA.get(DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK))
     {
@@ -1090,8 +1092,6 @@ WriteCompat(SwDoc const& rDoc, 
::sax_fastparser::FSHelperPtr const& rpFS,
         // Map the DoNotBreakWrappedTables compat flag to 
<w:doNotBreakWrappedTables>.
         rpFS->singleElementNS(XML_w, XML_doNotBreakWrappedTables);
     }
-    if (rIDSA.get(DocumentSettingId::MS_WORD_UL_TRAIL_SPACE))
-        rpFS->singleElementNS(XML_w, XML_ulTrailSpace);
 }
 
 void DocxExport::WriteSettings()

Reply via email to