sw/qa/extras/ooxmlexport/ooxmlexport18.cxx | 6 ------ sw/qa/extras/ooxmlexport/ooxmlexport21.cxx | 3 --- sw/source/filter/ww8/docxattributeoutput.cxx | 19 ++++++++++++++++--- 3 files changed, 16 insertions(+), 12 deletions(-)
New commits: commit f4a4439885e7f0ba44b26bf5854724824b63dd19 Author: Noel Grandin <[email protected]> AuthorDate: Wed Jan 14 14:00:45 2026 +0200 Commit: Xisco Fauli <[email protected]> CommitDate: Mon Jan 19 10:07:53 2026 +0100 officeotron: w:val attribute is required for w:shd we end up with <w:shd w:fill="548DD4"/> I forced a default value of "clear" in the absense of any better idea. Change-Id: I6e680f18aca3bc71743b42da4e152a664e9d9303 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197289 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197429 diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index bce66556cbef..dcee47b8e3cd 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -193,9 +193,6 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153592_columnBreaks) DECLARE_OOXMLEXPORT_TEST(testTdf104394_lostTextbox, "tdf104394_lostTextbox.docx") { - //FIXME: validation error in OOXML export: Errors: 4 - skipValidation(); - // This was only one page b/c the textbox was missing. CPPUNIT_ASSERT_EQUAL(2, getPages()); } @@ -306,9 +303,6 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf154703_framePr2) createSwDoc("tdf154703_framePr2.rtf"); verify(); - //FIXME: validation error in OOXML export: Errors: 1 - skipValidation(); - saveAndReload(TestFilter::DOCX); verify(/*bIsExport*/ true); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index a971a963a73c..8f8a3c40b52c 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -10463,6 +10463,7 @@ void DocxAttributeOutput::ParaGrabBag(const SfxGrabBagItem& rItem) uno::Sequence<beans::PropertyValue> aGrabBagSeq; rGrabBagElement.second >>= aGrabBagSeq; + bool bAddedValAttr = false; for (const auto& rProp : aGrabBagSeq) { OUString sVal = rProp.Value.get<OUString>(); @@ -10471,7 +10472,10 @@ void DocxAttributeOutput::ParaGrabBag(const SfxGrabBagItem& rItem) continue; if (rProp.Name == "val") + { AddToAttrList(m_pBackgroundAttrList, FSNS(XML_w, XML_val), sVal); + bAddedValAttr = true; + } else if (rProp.Name == "color") AddToAttrList(m_pBackgroundAttrList, FSNS(XML_w, XML_color), sVal); else if (rProp.Name == "themeColor") @@ -10491,6 +10495,9 @@ void DocxAttributeOutput::ParaGrabBag(const SfxGrabBagItem& rItem) else if (rProp.Name == "originalColor") rProp.Value >>= m_sOriginalBackgroundColor; } + // w:val attribute is required + if (!bAddedValAttr) + AddToAttrList(m_pBackgroundAttrList, FSNS(XML_w, XML_val), "clear"); } else if (rGrabBagElement.first == "SdtPr") { commit 2e0b705dfa01cb85d3c07e94e4f52abb55ed53da Author: Noel Grandin <[email protected]> AuthorDate: Wed Jan 14 13:23:43 2026 +0200 Commit: Xisco Fauli <[email protected]> CommitDate: Mon Jan 19 10:07:45 2026 +0100 officeotron: duplicate w:framePr under w:pPr we have duplicate data here <w:pPr> <w:pStyle w:val="Normal"/> <w:framePr w:hRule="exact" w:h="23" ... <w:framePr w:w="9923" w:h="910" w:y="568" ... Seems like the w:framePr has more useful info, so suppress the first framePr in this case. Change-Id: I7dfd7ced352b773c63a31e04f9ab0cdc82743942 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197287 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197428 diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx index c3a894f8ce72..cac0720b6ba0 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx @@ -1302,9 +1302,6 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf164474) CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount()); } - // FIXME: validation error in OOXML export: Errors: 2 - skipValidation(); - // Test also after save-and-reload: saveAndReload(TestFilter::DOCX); { diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 610a641c88b3..a971a963a73c 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1626,17 +1626,23 @@ void DocxAttributeOutput::EndParagraphProperties(const SfxItemSet& rParagraphMar WriteCollectedParagraphProperties(); Redline( pRedlineData ); - WriteCollectedParagraphProperties(); - - // Write w:framePr if (!m_bWritingHeaderFooter && m_aFramePr.Frame()) { + // write the collected paragraph properties __without__ the <framePr> element + m_rExport.SdrExporter().getFlyAttrList().clear(); + WriteCollectedParagraphProperties(); + + // Write w:framePr const SwFrameFormat& rFrameFormat = m_aFramePr.Frame()->GetFrameFormat(); assert(SwTextBoxHelper::TextBoxIsFramePr(rFrameFormat) && "by definition, because Frame()"); const Size aSize = m_aFramePr.Frame()->GetSize(); PopulateFrameProperties(&rFrameFormat, aSize); } + else + { + WriteCollectedParagraphProperties(); + } // Write 'Paragraph Mark' properties m_pSerializer->startElementNS(XML_w, XML_rPr);
