diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx index 26caf62ef67e..66b18c056872 100644 --- a/oox/source/ppt/pptshapegroupcontext.cxx +++ b/oox/source/ppt/pptshapegroupcontext.cxx @@ -108,10 +108,10 @@ ContextHandlerRef PPTShapeGroupContext::onCreateContext( sal_Int32 aElementToken { auto pShape = std::make_shared( meShapeLocation, u"com.sun.star.drawing.CustomShape"_ustr ); bool bUseBgFill = rAttribs.getBool(XML_useBgFill, false); + pShape->getFillProperties().moUseBgFill = bUseBgFill; if (bUseBgFill) { pShape->getFillProperties().moFillType = XML_noFill; - pShape->getFillProperties().moUseBgFill = true; } pShape->setModelId(rAttribs.getStringDefaulted( XML_modelId )); return new PPTShapeContext( *this, mpSlidePersistPtr, mpGroupShapePtr, pShape ); diff --git a/sd/qa/unit/data/pptx/tdf158512.pptx b/sd/qa/unit/data/pptx/tdf158512.pptx new file mode 100644 index 000000000000..96494ddf656a Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf158512.pptx differ diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index 2ff83269d682..8e9b7f5f72b9 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -2149,6 +2149,19 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf161430) CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, eXFS); } +CPPUNIT_TEST_FIXTURE(SdImportTest2, tdf158512) +{ + // First shape on first slide should have no fill to avoid hiding background + createSdImpressDoc("pptx/tdf158512.pptx"); + + const SdrPage* pPage = GetPage(1); + CPPUNIT_ASSERT_EQUAL(size_t(2), pPage->GetObjCount()); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, + pPage->GetObj(0)->GetMergedItem(XATTR_FILLSTYLE).GetValue()); + CPPUNIT_ASSERT_EQUAL(false, + pPage->GetObj(0)->GetMergedItem(XATTR_FILLUSESLIDEBACKGROUND).GetValue()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */