sw/source/filter/ww8/docxattributeoutput.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 43e293e744bfe153d74e3f20cd4235636f51ef36
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Oct 28 16:07:09 2025 +0200
Commit:     Miklos Vajna <[email protected]>
CommitDate: Fri Oct 31 10:27:48 2025 +0100

    mso-test: emit w:sz in correct order in document.xml
    
    When loading and then saving the document from forum-mso-en4-364124.docx,
    we end up with incorrect ordering of w:sz under w:rPr in document.xml
    
    Re-use our existing ordering logic to get the right order here.
    
    Change-Id: Ide57bd44b59033cd8cd6e885e8b9578a87314856
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193097
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 7c224bb54777..2d6ed151da8d 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3176,6 +3176,8 @@ void DocxAttributeOutput::DoWriteFieldRunProperties( 
const SwTextNode * pNode, s
 
     {
         m_pSerializer->startElementNS(XML_w, XML_rPr);
+        // mark() before child elements.
+        InitCollectedRunProperties();
 
         // 1. output webHidden flag
         if(GetExport().m_bHideTabLeaderAndPageNumbers && 
m_pHyperlinkAttrList.is() )
@@ -3190,6 +3192,9 @@ void DocxAttributeOutput::DoWriteFieldRunProperties( 
const SwTextNode * pNode, s
         // 3. write the character properties
         WriteCollectedRunProperties();
 
+        // Merge the marks for the ordered elements
+        m_pSerializer->mergeTopMarks(Tag_InitCollectedRunProperties);
+
         m_pSerializer->endElementNS( XML_w, XML_rPr );
     }
 

Reply via email to