[Libreoffice-commits] core.git: oox/source sd/qa

Matus Uzak matus.uzak at gmail.com
Tue Mar 29 12:19:01 UTC 2016


 oox/source/drawingml/shape.cxx     |    1 -
 sd/qa/unit/data/pptx/tdf95932.pptx |binary
 sd/qa/unit/import-tests.cxx        |   20 ++++++++++++++++++++
 3 files changed, 20 insertions(+), 1 deletion(-)

New commits:
commit bc14ec0f86647a39a954bd1c32b1671c22d7f475
Author: Matus Uzak <matus.uzak at gmail.com>
Date:   Sat Mar 12 21:11:42 2016 +0100

    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 at libreoffice.org>
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 63d8c5a..e832227 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -307,7 +307,6 @@ void Shape::applyShapeReference( const Shape& rReferencedShape, bool bUseText )
     mpTablePropertiesPtr = table::TablePropertiesPtr( rReferencedShape.mpTablePropertiesPtr.get() ? new table::TableProperties( *rReferencedShape.mpTablePropertiesPtr.get() ) : nullptr );
     mpShapeRefEffectPropPtr = EffectPropertiesPtr( new EffectProperties( *rReferencedShape.mpEffectPropertiesPtr.get() ) );
     mpMasterTextListStyle = TextListStylePtr( new TextListStyle( *rReferencedShape.mpMasterTextListStyle.get() ) );
-    maShapeStyleRefs = rReferencedShape.maShapeStyleRefs;
     maSize = rReferencedShape.maSize;
     maPosition = rReferencedShape.maPosition;
     mnRotation = rReferencedShape.mnRotation;
diff --git a/sd/qa/unit/data/pptx/tdf95932.pptx b/sd/qa/unit/data/pptx/tdf95932.pptx
new file mode 100644
index 0000000..5e22b11
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 9ae03fc..da4d4c4 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();


More information about the Libreoffice-commits mailing list