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>
This commit is contained in:
Matus Uzak
2016-03-12 21:11:42 +01:00
committed by Katarina Behrens
parent 0f2e6f1fbb
commit bc14ec0f86
3 changed files with 20 additions and 1 deletions

View File

@@ -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;

Binary file not shown.

View File

@@ -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();