summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2016-11-27 17:49:41 +0000
committerTamás Zolnai <tamas.zolnai@collabora.com>2016-11-27 17:49:41 +0000
commit7868b24a351eb5833c5b87756f78aa311ed84b4c (patch)
treea6e6ad2ba2ead0b8bd4d8a983deef13f9877f8b0 /sd
parentb63915253e460e0168bbe68e457c273228c7134e (diff)
tdf#104201: PPTX: Group solid fill is not imported
Reviewed-on: https://gerrit.libreoffice.org/31263 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 7c5aaa254f444d54b9ebf6574f0ccd37af548ee5) Change-Id: Iec273714108598d7017e73a9e7d384f8410d6ee1
Diffstat (limited to 'sd')
-rwxr-xr-xsd/qa/unit/data/pptx/tdf104201.pptxbin0 -> 15979 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx36
2 files changed, 36 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf104201.pptx b/sd/qa/unit/data/pptx/tdf104201.pptx
new file mode 100755
index 000000000000..99a6532a6f39
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf104201.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 2a330ccabcc7..72654ab543bf 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -116,6 +116,7 @@ public:
void testTdf103792();
void testTdf103876();
void testTdf104015();
+ void testTdf104201();
CPPUNIT_TEST_SUITE(SdImportTest);
@@ -163,6 +164,7 @@ public:
CPPUNIT_TEST(testTdf103792);
CPPUNIT_TEST(testTdf103876);
CPPUNIT_TEST(testTdf104015);
+ CPPUNIT_TEST(testTdf104201);
CPPUNIT_TEST_SUITE_END();
};
@@ -1314,6 +1316,40 @@ void SdImportTest::testTdf104015()
xDocShRef->DoClose();
}
+void SdImportTest::testTdf104201()
+{
+ // Group shape properties did not overwrite the child shapes' fill
+ sd::DrawDocShellRef xDocShRef = loadURL(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();