sw/qa/extras/ooxmlexport/ooxmlexport7.cxx | 5 ----- sw/source/filter/ww8/docxexport.cxx | 5 +++++ sw/source/filter/ww8/docxexport.hxx | 2 ++ sw/source/filter/ww8/rtfexport.hxx | 2 ++ sw/source/filter/ww8/wrtw8sty.cxx | 1 + sw/source/filter/ww8/wrtww8.hxx | 4 ++++ 6 files changed, 14 insertions(+), 5 deletions(-)
New commits: commit 71928bd740832dbc75b856252edf999afd678d70 Author: Noel Grandin <[email protected]> AuthorDate: Wed Jan 14 11:07:21 2026 +0200 Commit: Xisco Fauli <[email protected]> CommitDate: Thu Jan 15 08:54:56 2026 +0100 officeotron: fillcolor is not valid for framePr because of some generic code adding attributes to the flyAttrList, we end with: <w:pPr> ... <w:framePr fillcolor="#FF00FF"/> inside word/header1.xml, which is not valid. Unfortunately, the code structure here does not allow an elegant solution, we need a new virtual method to be able to get at the flyAttrList and clear it, to prevent attributes leaking into elements they are not meant for. Change-Id: I2bfd6b1afd78e722a29d79cf853a4678b7d0dea4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197248 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> (cherry picked from commit f748949b6ffe6e8ef2a7fd27c70669efe8ac3818) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197297 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx index 1e1057be6661..dd7e7b2e6ae8 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx @@ -667,9 +667,6 @@ DECLARE_OOXMLEXPORT_TEST(testTdf77219_backgroundShape, "tdf77219_backgroundShape DECLARE_OOXMLEXPORT_TEST(testTdf126533_axialAngle, "tdf126533_axialAngle.docx") { - //FIXME: validation error in OOXML export: Errors: 1 - skipValidation(); - // axial gradient is purple foreground/lime background in the middle (top-left to bottom-right) uno::Reference<beans::XPropertySet> xPageStyle(getStyles(u"PageStyles"_ustr)->getByName(u"Standard"_ustr), uno::UNO_QUERY); @@ -685,8 +682,6 @@ DECLARE_OOXMLEXPORT_TEST(testTdf126533_axialAngle, "tdf126533_axialAngle.docx") DECLARE_OOXMLEXPORT_TEST(testTdf126533_axialAngle2, "tdf126533_axialAngle2.docx") { - //FIXME: validation error in OOXML export: Errors: 1 - skipValidation(); // axial gradient is purple foreground/lime background in the middle (top-right to bottom-left) uno::Reference<beans::XPropertySet> xPageStyle(getStyles(u"PageStyles"_ustr)->getByName(u"Standard"_ustr), uno::UNO_QUERY); diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 00d9a1005d8f..7a0b872ebcc1 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -740,6 +740,11 @@ void DocxExport::PrepareNewPageDesc( const SfxItemSet* pSet, } +void DocxExport::ClearFlyAttrList() +{ + SdrExporter().getFlyAttrList().clear(); +} + void DocxExport::InitStyles() { m_pStyles.reset(new MSWordStyles( *this, /*bListStyles =*/ true )); diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx index ac5700d77867..a51285b6dab7 100644 --- a/sw/source/filter/ww8/docxexport.hxx +++ b/sw/source/filter/ww8/docxexport.hxx @@ -240,6 +240,8 @@ protected: const SwPageDesc* pNewPgDesc, bool bExtraPageBreak = false) override; + virtual void ClearFlyAttrList() override; + private: /// Setup pStyles and write styles.xml void InitStyles(); diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx index 6b285dbab485..2187a789993a 100644 --- a/sw/source/filter/ww8/rtfexport.hxx +++ b/sw/source/filter/ww8/rtfexport.hxx @@ -147,6 +147,8 @@ protected: void AppendSection(const SwPageDesc* pPageDesc, const SwSectionFormat* pFormat, sal_uLong nLnNum) override; + void ClearFlyAttrList() override {} + public: /// Pass the pDocument, pCurrentPam and pOriginalPam to the base class. RtfExport(RtfExportFilter* pFilter, SwDoc& rDocument, std::shared_ptr<SwUnoCursor>& pCurrentPam, diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index aa25d5945962..2986f84f432f 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -1867,6 +1867,7 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt } AttrOutput().OutputStyleItemSet( pPdFormat->GetAttrSet(), false ); + ClearFlyAttrList(); // so they do not leak into other elements if (titlePage) { diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 6aa9cacac1ea..5aa6c208235b 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -926,6 +926,8 @@ protected: virtual bool IsDummyFloattableAnchor(SwNode& /*rNode*/) const { return false; } + virtual void ClearFlyAttrList() = 0; + public: MSWordExportBase(SwDoc& rDocument, std::shared_ptr<SwUnoCursor> & pCurrentPam, SwPaM* pOriginalPam); virtual ~MSWordExportBase(); @@ -1225,6 +1227,8 @@ protected: virtual void AppendSection( const SwPageDesc *pPageDesc, const SwSectionFormat* pFormat, sal_uLong nLnNum ) override; + virtual void ClearFlyAttrList() override {} + private: WW8Export(const WW8Export&) = delete; WW8Export& operator=(const WW8Export&) = delete;
