sw/qa/extras/ooxmlexport/ooxmlexport4.cxx    |    2 +-
 sw/source/filter/ww8/docxattributeoutput.cxx |   12 ++++--------
 2 files changed, 5 insertions(+), 9 deletions(-)

New commits:
commit 3689151b9f0577b6d79eee1abbd2cc7d556cedeb
Author:     Noel Grandin <[email protected]>
AuthorDate: Wed Jan 7 19:33:42 2026 +0200
Commit:     Xisco Fauli <[email protected]>
CommitDate: Mon Jan 12 09:43:45 2026 +0100

    officeotron: w:pPrChange is incomplete
    
    the schema says w:pPr is required under w:pPrChange.
    
    I dont understand the unit test I changed here, it was
    added with:
    
      commit c2c08b7d0e87f8cd1c97028c9363826f4bd22dcb
      Author: Adam Co <[email protected]>
      Date:   Mon Jan 13 13:55:05 2014 +0200
      Add unit-test for 'track changes - paragraph properties changed' 
preservation
    
    But seems to be asserting that we __dont__ preserve w:pPr,
    which makes no sense.
    
    So fix that.
    
    Change-Id: I536992bd3aec232f8dffda4f753c887148a877f2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196786
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit a520104c86703c9a697166c1b8d703060435b59c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196943
    Reviewed-by: Xisco Fauli <[email protected]>
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196964

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index 5f8dacd51b80..84509ca3f6c3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -176,7 +176,7 @@ CPPUNIT_TEST_FIXTURE(Test, 
testTrackChangesParagraphProperties)
 {
     loadAndSave("testTrackChangesParagraphProperties.docx");
     xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr);
-    assertXPathChildren(pXmlDoc, 
"/w:document/w:body/w:p[1]/w:pPr/w:pPrChange", 0);
+    assertXPathChildren(pXmlDoc, 
"/w:document/w:body/w:p[1]/w:pPr/w:pPrChange", 1);
 }
 
 CPPUNIT_TEST_FIXTURE(Test, testMsoSpt180)
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 7d45b458712e..01de6e6cb10a 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4285,6 +4285,8 @@ void DocxAttributeOutput::Redline( const SwRedlineData* 
pRedlineData)
         if (!bNoDate)
             pAttributeList->add(FSNS( XML_w, XML_date ), DateTimeToOString( 
aDateTime ));
         m_pSerializer->startElementNS( XML_w, XML_pPrChange, pAttributeList );
+        m_pSerializer->startElementNS(XML_w, XML_pPr);
+        m_pSerializer->mark(Tag_Redline_2, 
comphelper::containerToSequence(aParagraphPropertiesOrder));
 
         // Check if there is any extra data stored in the redline object
         if (pRedlineData->GetExtraData())
@@ -4300,10 +4302,6 @@ void DocxAttributeOutput::Redline( const SwRedlineData* 
pRedlineData)
                 const UIName & sParaStyleName = 
pFormattingChanges->GetFormatName();
                 if (pChangesSet || !sParaStyleName.isEmpty())
                 {
-                    m_pSerializer->startElementNS(XML_w, XML_pPr);
-
-                    m_pSerializer->mark(Tag_Redline_2, 
comphelper::containerToSequence(aParagraphPropertiesOrder));
-
                     if (!sParaStyleName.isEmpty())
                     {
                         OString sStyleName;
@@ -4339,13 +4337,11 @@ void DocxAttributeOutput::Redline( const SwRedlineData* 
pRedlineData)
                     m_rExport.SdrExporter().getFlyAttrList() = 
std::move(pFlyAttrList_Original);
                     m_pLRSpaceAttrList = std::move(pLRSpaceAttrList_Original);
                     m_pParagraphSpacingAttrList = 
std::move(pParagraphSpacingAttrList_Original);
-
-                    m_pSerializer->mergeTopMarks(Tag_Redline_2);
-
-                    m_pSerializer->endElementNS( XML_w, XML_pPr );
                 }
             }
         }
+        m_pSerializer->mergeTopMarks(Tag_Redline_2);
+        m_pSerializer->endElementNS( XML_w, XML_pPr );
         m_pSerializer->endElementNS( XML_w, XML_pPrChange );
         break;
     }

Reply via email to