summaryrefslogtreecommitdiff
path: root/sd/qa/unit
diff options
context:
space:
mode:
authorTamás Zolnai <zolnaitamas2000@gmail.com>2016-11-18 22:57:29 +0000
committerTamás Zolnai <tamas.zolnai@collabora.com>2016-11-18 22:42:12 +0000
commit8d613870b2cd2e3e4396b4fa97dbd8080fda8f52 (patch)
tree0e9bb4ce750b48773f2e592bb68fcedf0db5c398 /sd/qa/unit
parent9745d29227e471ce40e9992fefd92e10a48696fb (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. Change-Id: I587582498cf4315087f9a576c1b7fc41ee23e2fd Reviewed-on: https://gerrit.libreoffice.org/30969 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sd/qa/unit')
-rw-r--r--sd/qa/unit/data/pptx/tdf104015.pptxbin0 -> 19185 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx40
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
new file mode 100644
index 000000000000..f3675f9e8805
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf104015.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index f9f40cc198e5..6c14bd5da3dc 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -129,6 +129,7 @@ public:
void testTdf103473();
void testTdf103792();
void testTdf103876();
+ void testTdf104015();
CPPUNIT_TEST_SUITE(SdImportTest);
@@ -183,6 +184,7 @@ public:
CPPUNIT_TEST(testTdf103473);
CPPUNIT_TEST(testTdf103792);
CPPUNIT_TEST(testTdf103876);
+ CPPUNIT_TEST(testTdf104015);
CPPUNIT_TEST_SUITE_END();
};
@@ -1545,6 +1547,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(m_directories.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();