From bc14ec0f86647a39a954bd1c32b1671c22d7f475 Mon Sep 17 00:00:00 2001
From: Matus Uzak <matus.uzak@gmail.com>
Date: Sat, 12 Mar 2016 21:11:42 +0100
Subject: tdf#95932: PPTX import: Incorrect inheritance of shape style

Inheritance Order: 1. Reference Shape's properties, 2. Shape style,
3. Shape properties.

You MUST NOT inherit reference shape's style, because it's already
part of inherited reference shape's properties.  That would overwrite
shape properties applied at point 3, at slide layout/master level.

Change-Id: Id1ab550295988b0087a67c6819dfe32f84825e4e
Reviewed-on: https://gerrit.libreoffice.org/23182
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
---
 sd/qa/unit/data/pptx/tdf95932.pptx | Bin 0 -> 66621 bytes
 sd/qa/unit/import-tests.cxx        |  20 ++++++++++++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 sd/qa/unit/data/pptx/tdf95932.pptx

(limited to 'sd')

diff --git a/sd/qa/unit/data/pptx/tdf95932.pptx b/sd/qa/unit/data/pptx/tdf95932.pptx
new file mode 100644
index 000000000000..5e22b1158137
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf95932.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 9ae03fce4050..da4d4c49db67 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -111,6 +111,7 @@ public:
     void testTdf62255();
     void testTdf89927();
     void testTdf93868();
+    void testTdf95932();
 
     CPPUNIT_TEST_SUITE(SdImportTest);
 
@@ -156,6 +157,7 @@ public:
     CPPUNIT_TEST(testTdf62255);
     CPPUNIT_TEST(testTdf89927);
     CPPUNIT_TEST(testTdf93868);
+    CPPUNIT_TEST(testTdf95932);
 
     CPPUNIT_TEST_SUITE_END();
 };
@@ -1233,6 +1235,24 @@ void SdImportTest::testTdf93868()
     xDocShRef->DoClose();
 }
 
+void SdImportTest::testTdf95932()
+{
+    sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf95932.pptx"), PPTX);
+
+    const SdrPage *pPage = GetPage( 1, xDocShRef );
+    SdrObject *const pObj = pPage->GetObj(2);
+    CPPUNIT_ASSERT(pObj);
+
+    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(0x76bf3d), rColorItem.GetColorValue().GetColor());
+
+    xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
-- 
cgit