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

New commits:
commit a520104c86703c9a697166c1b8d703060435b59c
Author:     Noel Grandin <[email protected]>
AuthorDate: Wed Jan 7 19:33:42 2026 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Fri Jan 9 21:25:26 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]>

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index bed61269e457..ef2a3618cfa2 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -190,12 +190,9 @@ CPPUNIT_TEST_FIXTURE(Test, 
testTrackChangesParagraphProperties)
 {
     createSwDoc("testTrackChangesParagraphProperties.docx");
 
-    //FIXME: validation error in OOXML export: Errors: 1
-    skipValidation();
-
     save(TestFilter::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 a645e9922cb2..703dcc18263f 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4282,6 +4282,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())
@@ -4297,10 +4299,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;
@@ -4336,13 +4334,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