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:
committed by
Katarina Behrens
parent
0f2e6f1fbb
commit
bc14ec0f86
@@ -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 );
|
mpTablePropertiesPtr = table::TablePropertiesPtr( rReferencedShape.mpTablePropertiesPtr.get() ? new table::TableProperties( *rReferencedShape.mpTablePropertiesPtr.get() ) : nullptr );
|
||||||
mpShapeRefEffectPropPtr = EffectPropertiesPtr( new EffectProperties( *rReferencedShape.mpEffectPropertiesPtr.get() ) );
|
mpShapeRefEffectPropPtr = EffectPropertiesPtr( new EffectProperties( *rReferencedShape.mpEffectPropertiesPtr.get() ) );
|
||||||
mpMasterTextListStyle = TextListStylePtr( new TextListStyle( *rReferencedShape.mpMasterTextListStyle.get() ) );
|
mpMasterTextListStyle = TextListStylePtr( new TextListStyle( *rReferencedShape.mpMasterTextListStyle.get() ) );
|
||||||
maShapeStyleRefs = rReferencedShape.maShapeStyleRefs;
|
|
||||||
maSize = rReferencedShape.maSize;
|
maSize = rReferencedShape.maSize;
|
||||||
maPosition = rReferencedShape.maPosition;
|
maPosition = rReferencedShape.maPosition;
|
||||||
mnRotation = rReferencedShape.mnRotation;
|
mnRotation = rReferencedShape.mnRotation;
|
||||||
|
BIN
sd/qa/unit/data/pptx/tdf95932.pptx
Normal file
BIN
sd/qa/unit/data/pptx/tdf95932.pptx
Normal file
Binary file not shown.
@@ -111,6 +111,7 @@ public:
|
|||||||
void testTdf62255();
|
void testTdf62255();
|
||||||
void testTdf89927();
|
void testTdf89927();
|
||||||
void testTdf93868();
|
void testTdf93868();
|
||||||
|
void testTdf95932();
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE(SdImportTest);
|
CPPUNIT_TEST_SUITE(SdImportTest);
|
||||||
|
|
||||||
@@ -156,6 +157,7 @@ public:
|
|||||||
CPPUNIT_TEST(testTdf62255);
|
CPPUNIT_TEST(testTdf62255);
|
||||||
CPPUNIT_TEST(testTdf89927);
|
CPPUNIT_TEST(testTdf89927);
|
||||||
CPPUNIT_TEST(testTdf93868);
|
CPPUNIT_TEST(testTdf93868);
|
||||||
|
CPPUNIT_TEST(testTdf95932);
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE_END();
|
CPPUNIT_TEST_SUITE_END();
|
||||||
};
|
};
|
||||||
@@ -1233,6 +1235,24 @@ void SdImportTest::testTdf93868()
|
|||||||
xDocShRef->DoClose();
|
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_TEST_SUITE_REGISTRATION(SdImportTest);
|
||||||
|
|
||||||
CPPUNIT_PLUGIN_IMPLEMENT();
|
CPPUNIT_PLUGIN_IMPLEMENT();
|
||||||
|
Reference in New Issue
Block a user