From a2b00082114b443962715a671b8bbb17733d6453 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Mon, 27 May 2024 20:31:54 -0400 Subject: tdf#131098 docx export: write fill property of graphic All these are round-tripping (at least at a basic level): - bitmap - hatch - solid color - transparency (unit test) make CppunitTest_sw_ooxmlexport21 \ CPPUNIT_TEST_NAME=testTdf131098_imageFill No existing unit tests had an image with a fill. Change-Id: I745fa064db83bdb3bb7ec67eef1ae803f3930a23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168134 Reviewed-by: Justin Luth Tested-by: Jenkins --- sw/qa/extras/ooxmlexport/ooxmlexport21.cxx | 3 --- sw/source/filter/ww8/docxattributeoutput.cxx | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx index 901a0b161d6a..baeba733afcc 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx @@ -534,9 +534,6 @@ DECLARE_OOXMLEXPORT_TEST(testTdf126533_pageBitmap, "tdf126533_pageBitmap.docx") DECLARE_OOXMLEXPORT_TEST(testTdf131098_imageFill, "tdf131098_imageFill.docx") { - if (isExported()) - return; - // given a document with an image background transparency (blue-white) CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, getProperty(getShape(1), "FillStyle")); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 971f27df0314..827d037b274c 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -5411,6 +5411,10 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size m_pSerializer->singleElementNS(XML_a, XML_avLst); m_pSerializer->endElementNS( XML_a, XML_prstGeom ); + m_rDrawingML.SetFS(m_pSerializer); // to be sure that we write to the right stream + if (xShapePropSet) + m_rDrawingML.WriteFill(xShapePropSet, awt::Size(aSize.Width(), aSize.Height())); + const SvxBoxItem& rBoxItem = pFrameFormat->GetBox(); const SvxBorderLine* pLeft = rBoxItem.GetLine(SvxBoxItemLine::LEFT); const SvxBorderLine* pRight = rBoxItem.GetLine(SvxBoxItemLine::RIGHT); -- cgit