oox/source/drawingml/shape.cxx | 6 +++--- sd/qa/unit/data/pptx/tdf104201.pptx |binary sd/qa/unit/import-tests.cxx | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-)
New commits: commit 32395df104106743e5599f14b19a9a887c1a78ec Author: Tamás Zolnai <tamas.zol...@collabora.com> Date: Sun Nov 27 17:47:03 2016 +0000 tdf#104201: PPTX: Group solid fill is not imported Reviewed-on: https://gerrit.libreoffice.org/31263 Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com> Tested-by: Tamás Zolnai <tamas.zol...@collabora.com> (cherry picked from commit 7c5aaa254f444d54b9ebf6574f0ccd37af548ee5) Change-Id: Iec273714108598d7017e73a9e7d384f8410d6ee1 Reviewed-on: https://gerrit.libreoffice.org/31267 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 5f6a066..70517d4 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -1462,14 +1462,14 @@ FillProperties Shape::getActualFillProperties(const Theme* pTheme, const FillPro } } + // Properties specified directly for this shape + aFillProperties.assignUsed(getFillProperties()); + // Parent shape's properties if ( pParentShapeFillProps != nullptr) if( getFillProperties().moFillType.has() && getFillProperties().moFillType.get() == XML_grpFill ) aFillProperties.assignUsed( *pParentShapeFillProps ); - // Properties specified directly for this shape - aFillProperties.assignUsed( getFillProperties() ); - return aFillProperties; } diff --git a/sd/qa/unit/data/pptx/tdf104201.pptx b/sd/qa/unit/data/pptx/tdf104201.pptx new file mode 100755 index 0000000..99a6532 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf104201.pptx differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 8aaf485..4a8da29 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -126,6 +126,7 @@ public: void testTdf103792(); void testTdf103876(); void testTdf104015(); + void testTdf104201(); CPPUNIT_TEST_SUITE(SdImportTest); @@ -180,6 +181,7 @@ public: CPPUNIT_TEST(testTdf103792); CPPUNIT_TEST(testTdf103876); CPPUNIT_TEST(testTdf104015); + CPPUNIT_TEST(testTdf104201); CPPUNIT_TEST_SUITE_END(); }; @@ -1505,6 +1507,40 @@ void SdImportTest::testTdf104015() xDocShRef->DoClose(); } +void SdImportTest::testTdf104201() +{ + // Group shape properties did not overwrite the child shapes' fill + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf104201.pptx"), PPTX); + + const SdrPage *pPage = GetPage(1, xDocShRef); + CPPUNIT_ASSERT_MESSAGE("No page found", pPage != nullptr); + + // First shape has red fill, but this should be overwritten by green group fill + { + SdrObject *const pObj = pPage->GetObj(0); + CPPUNIT_ASSERT_MESSAGE("Wrong object", pObj != nullptr); + const XFillStyleItem& rStyleItem = dynamic_cast<const XFillStyleItem&>( + pObj->GetMergedItem(XATTR_FILLSTYLE)); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, rStyleItem.GetValue()); + const XFillColorItem& rColorItem = dynamic_cast<const XFillColorItem&>( + pObj->GetMergedItem(XATTR_FILLCOLOR)); + CPPUNIT_ASSERT_EQUAL(ColorData(0x00FF00), rColorItem.GetColorValue().GetColor()); + } + // Scond shape has blue fill, but this should be overwritten by green group fill + { + SdrObject *const pObj = pPage->GetObj(0); + CPPUNIT_ASSERT_MESSAGE("Wrong object", pObj != nullptr); + const XFillStyleItem& rStyleItem = dynamic_cast<const XFillStyleItem&>( + pObj->GetMergedItem(XATTR_FILLSTYLE)); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, rStyleItem.GetValue()); + const XFillColorItem& rColorItem = dynamic_cast<const XFillColorItem&>( + pObj->GetMergedItem(XATTR_FILLCOLOR)); + CPPUNIT_ASSERT_EQUAL(ColorData(0x00FF00), rColorItem.GetColorValue().GetColor()); + } + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT();
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits