sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx |    3 ---
 sw/source/filter/ww8/docxattributeoutput.cxx  |    9 +++++++++
 sw/source/filter/ww8/docxattributeoutput.hxx  |    1 +
 3 files changed, 10 insertions(+), 3 deletions(-)

New commits:
commit fccc099e54e5a8c8a913425d8ffde8eb515dfebe
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Nov 25 21:12:42 2025 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Wed Nov 26 13:55:09 2025 +0100

    officeotron: avoid writing <w:i/> twice
    
    Change-Id: I58f9d359aa66155e17686695642317948b839b09
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194527
    Reviewed-by: Miklos Vajna <[email protected]>
    Code-Style: Noel Grandin <[email protected]>
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>
    Tested-by: Noel Grandin <[email protected]>

diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index 9aa727cedbd8..6c1ea023a780 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -441,9 +441,6 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo78599)
 {
     createSwDoc("fdo78599.docx");
 
-    // FIXME: validation error in OOXML export: Errors: 6
-    skipValidation();
-
     saveAndReload(TestFilter::DOCX);
     xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr);
     //docx file after RT is getting corrupted.
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 9212969bc3c1..a3107c32dfcc 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3341,6 +3341,7 @@ void DocxAttributeOutput::InitCollectedRunProperties()
     m_pEastAsianLayoutAttrList = nullptr;
     m_pCharLangAttrList = nullptr;
     m_oFontSize.reset();
+    m_bCharPostureWritten = false;
 
     // Write the elements in the spec order
     static const sal_Int32 aOrder[] =
@@ -8164,6 +8165,10 @@ void DocxAttributeOutput::CharLanguage( const 
SvxLanguageItem& rLanguage )
 
 void DocxAttributeOutput::CharPosture( const SvxPostureItem& rPosture )
 {
+    if (m_bCharPostureWritten) // avoid writing this twice
+        return;
+    m_bCharPostureWritten = true;
+
     if ( rPosture.GetPosture() != ITALIC_NONE )
         m_pSerializer->singleElementNS(XML_w, XML_i);
     else
@@ -8285,6 +8290,10 @@ void DocxAttributeOutput::CharFontCJK( const 
SvxFontItem& rFont )
 
 void DocxAttributeOutput::CharPostureCJK( const SvxPostureItem& rPosture )
 {
+    if (m_bCharPostureWritten) // avoid writing this twice
+        return;
+    m_bCharPostureWritten = true;
+
     if ( rPosture.GetPosture() != ITALIC_NONE )
         m_pSerializer->singleElementNS(XML_w, XML_i);
     else
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx 
b/sw/source/filter/ww8/docxattributeoutput.hxx
index c06ebc5eedf4..cfe93a2d7467 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -836,6 +836,7 @@ private:
     rtl::Reference<sax_fastparser::FastAttributeList> 
m_pParagraphSpacingAttrList;
     rtl::Reference<sax_fastparser::FastAttributeList> m_pHyperlinkAttrList;
     std::optional<double> m_oFontSize;
+    bool m_bCharPostureWritten;
     std::shared_ptr<SwContentControl> m_pContentControl;
     /// If the current SDT around runs should be ended before the current run.
     bool m_bEndCharSdt;

Reply via email to