diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2016-11-18 23:57:11 +0000 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2016-11-18 23:57:11 +0000 |
commit | 3586fcaa7a968aae7ab0e2b60f7f3fd714b5c4a5 (patch) | |
tree | 28813be80f9fd32401245b8e925395f257e4c907 /sd | |
parent | 3ec47ebbbb8fa8c354d5274c526698e89aca7ec5 (diff) |
tdf#104015: PPTX import: Title shape does not inherit fill properties
...from slide master.
The problem caused by that PPTX files contains not a
one-level master slide set, but has two levels: one
called slide master, other called slide layout.
Slide layout inherit properties from slide master and
normal slide inherit propetries from slide layout.
Bug appeared because, slide layout inherited properties
were not forwarded to the normal slide.
Reviewed-on: https://gerrit.libreoffice.org/30969
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
(cherry picked from commit 8d613870b2cd2e3e4396b4fa97dbd8080fda8f52)
Conflicts:
oox/source/drawingml/shape.cxx
Change-Id: I587582498cf4315087f9a576c1b7fc41ee23e2fd
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf104015.pptx | bin | 0 -> 19185 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 40 |
2 files changed, 40 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf104015.pptx b/sd/qa/unit/data/pptx/tdf104015.pptx Binary files differnew file mode 100644 index 000000000000..f3675f9e8805 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf104015.pptx diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index f8af062b7ead..2a330ccabcc7 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -115,6 +115,7 @@ public: void testTdf93868(); void testTdf103792(); void testTdf103876(); + void testTdf104015(); CPPUNIT_TEST_SUITE(SdImportTest); @@ -161,6 +162,7 @@ public: CPPUNIT_TEST(testTdf93868); CPPUNIT_TEST(testTdf103792); CPPUNIT_TEST(testTdf103876); + CPPUNIT_TEST(testTdf104015); CPPUNIT_TEST_SUITE_END(); }; @@ -1274,6 +1276,44 @@ void SdImportTest::testTdf103876() xDocShRef->DoClose(); } +void SdImportTest::testTdf104015() +{ + // Shape fill, line and effect properties were not inherited from master slide shape + sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("sd/qa/unit/data/pptx/tdf104015.pptx"), PPTX); + + const SdrPage *pPage = GetPage( 1, xDocShRef ); + CPPUNIT_ASSERT_MESSAGE("No page found", pPage != nullptr); + SdrObject *const pObj = pPage->GetObj(0); + CPPUNIT_ASSERT_MESSAGE("Wrong object", pObj != nullptr); + // Should have a red fill color + { + 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(0xFF0000), rColorItem.GetColorValue().GetColor()); + } + // Should have a blue line + { + const XLineStyleItem& rStyleItem = dynamic_cast<const XLineStyleItem&>( + pObj->GetMergedItem(XATTR_LINESTYLE)); + CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_SOLID, rStyleItem.GetValue()); + + const XLineColorItem& rColorItem = dynamic_cast<const XLineColorItem&>( + pObj->GetMergedItem(XATTR_LINECOLOR)); + CPPUNIT_ASSERT_EQUAL(ColorData(0x0000FF), rColorItem.GetColorValue().GetColor()); + } + // Should have some shadow + { + const SdrOnOffItem& rShadowItem = dynamic_cast<const SdrOnOffItem&>( + pObj->GetMergedItem(SDRATTR_SHADOW)); + CPPUNIT_ASSERT(rShadowItem.GetValue()); + } + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |