diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-06-06 15:57:43 +0200 |
---|---|---|
committer | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-06-06 16:50:04 +0200 |
commit | 46d682eec92bb241f4604a4b6ab42a3859cd0d48 (patch) | |
tree | 1e691d8f2e96473dc2af3ef95b484d97d53ef5a8 /sd | |
parent | 37183595bb3b4d58682f90fd9f6713bedcb852a2 (diff) |
bnc#880763: PPTX import: wrong z-order becuause of wrong import order
importExtDrawings() must be called as soon as possible,
before parser starts to parse the next shape.
Call it when graphicFrame tag is closed. This tag include
the reference to the SmartArt.
Plus fix up import tests.
Change-Id: I9e8d54c2b1afeb78a1122390dc4982d580c152ae
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/bnc880763.pptx | bin | 0 -> 45631 bytes | |||
-rw-r--r-- | sd/qa/unit/data/xml/n819614_0.xml | 16 | ||||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 32 |
3 files changed, 37 insertions, 11 deletions
diff --git a/sd/qa/unit/data/pptx/bnc880763.pptx b/sd/qa/unit/data/pptx/bnc880763.pptx Binary files differnew file mode 100644 index 000000000000..f45eb13ec308 --- /dev/null +++ b/sd/qa/unit/data/pptx/bnc880763.pptx diff --git a/sd/qa/unit/data/xml/n819614_0.xml b/sd/qa/unit/data/xml/n819614_0.xml index fb879cd1e579..22543cf588a5 100644 --- a/sd/qa/unit/data/xml/n819614_0.xml +++ b/sd/qa/unit/data/xml/n819614_0.xml @@ -14,14 +14,6 @@ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> </Transformation> </XShape> - <XShape positionX="0" positionY="0" sizeX="100" sizeY="100" type="com.sun.star.drawing.GroupShape" name="Content Placeholder 4"> - <XShapes/> - <Transformation> - <Line1 column1="101.000000" column2="0.000000" column3="0.000000"/> - <Line2 column1="0.000000" column2="101.000000" column3="0.000000"/> - <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> - </Transformation> - </XShape> <XShape positionX="182" positionY="2544" sizeX="25125" sizeY="16293" type="com.sun.star.drawing.GroupShape"> <XShapes> <XShape positionX="10751" positionY="3496" sizeX="1563" sizeY="253" type="com.sun.star.drawing.CustomShape" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName=""> @@ -6888,4 +6880,12 @@ <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> </Transformation> </XShape> + <XShape positionX="0" positionY="0" sizeX="100" sizeY="100" type="com.sun.star.drawing.GroupShape" name="Content Placeholder 4"> + <XShapes/> + <Transformation> + <Line1 column1="101.000000" column2="0.000000" column3="0.000000"/> + <Line2 column1="0.000000" column2="101.000000" column3="0.000000"/> + <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> + </Transformation> + </XShape> </XShapes> diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 0b032c1295be..1c36673ae932 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -77,6 +77,7 @@ public: void testBnc870237(); void testBnc870233_1(); void testBnc870233_2(); + void testBnc880763(); CPPUNIT_TEST_SUITE(SdFiltersTest); CPPUNIT_TEST(testDocumentLayout); @@ -104,6 +105,7 @@ public: CPPUNIT_TEST(testBnc870237); CPPUNIT_TEST(testBnc870233_1); CPPUNIT_TEST(testBnc870233_2); + CPPUNIT_TEST(testBnc880763); CPPUNIT_TEST_SUITE_END(); }; @@ -293,7 +295,7 @@ void SdFiltersTest::testN862510_2() const SdrPage *pPage = pDoc->GetPage(1); CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL ); { - SdrObjGroup *pGrpObj = dynamic_cast<SdrObjGroup *>( pPage->GetObj( 1 ) ); + SdrObjGroup *pGrpObj = dynamic_cast<SdrObjGroup *>( pPage->GetObj( 0 ) ); CPPUNIT_ASSERT( pGrpObj ); SdrObjCustomShape *pObj = dynamic_cast<SdrObjCustomShape *>( pGrpObj->GetSubList()->GetObj( 0 ) ); CPPUNIT_ASSERT( pObj ); @@ -312,7 +314,7 @@ void SdFiltersTest::testN862510_3() const SdrPage *pPage = pDoc->GetPage( 1 ); CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL ); { - SdrObjGroup *pGrpObj = dynamic_cast<SdrObjGroup *>( pPage->GetObj( 1 ) ); + SdrObjGroup *pGrpObj = dynamic_cast<SdrObjGroup *>( pPage->GetObj( 0 ) ); CPPUNIT_ASSERT( pGrpObj ); SdrObjCustomShape *pObj = dynamic_cast<SdrObjCustomShape *>( pGrpObj->GetSubList()->GetObj( 0 ) ); CPPUNIT_ASSERT( pObj ); @@ -755,7 +757,7 @@ void SdFiltersTest::testBnc870237() CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL ); // Simulate a:ext inside dsp:txXfrm with changing the lower distance - const SdrObjGroup* pObj = dynamic_cast<SdrObjGroup*>( pPage->GetObj( 1 ) ); + const SdrObjGroup* pObj = dynamic_cast<SdrObjGroup*>( pPage->GetObj( 0 ) ); CPPUNIT_ASSERT_MESSAGE( "no object", pObj != NULL); CPPUNIT_ASSERT_EQUAL( sal_Int32(0), (static_cast< const SdrTextUpperDistItem& >(pObj->GetMergedItem(SDRATTR_TEXT_UPPERDIST))).GetValue()); CPPUNIT_ASSERT_EQUAL( sal_Int32(9919), (static_cast< const SdrTextLowerDistItem& >(pObj->GetMergedItem(SDRATTR_TEXT_LOWERDIST))).GetValue()); @@ -900,6 +902,30 @@ void SdFiltersTest::testBnc870233_2() xDocShRef->DoClose(); } +void SdFiltersTest::testBnc880763() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc880763.pptx")); + xDocShRef = saveAndReload( xDocShRef, PPTX ); + + SdDrawDocument *pDoc = xDocShRef->GetDoc(); + CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL ); + const SdrPage *pPage = pDoc->GetPage (1); + CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL ); + + // Check z-order of the two shapes, use background color to identify them + // First object in the background has blue background color + const SdrObject *pObj = dynamic_cast<SdrObject *>( pPage->GetObj( 0 ) ); + CPPUNIT_ASSERT_MESSAGE( "no object", pObj != NULL); + CPPUNIT_ASSERT_EQUAL( sal_uInt32(0x0000ff),(static_cast< const XColorItem& >(pObj->GetMergedItem(XATTR_FILLCOLOR))).GetColorValue().GetColor()); + + // Second object at the front has green background color + pObj = dynamic_cast<SdrObject *>( pPage->GetObj( 1 ) ); + CPPUNIT_ASSERT_MESSAGE( "no object", pObj != NULL); + CPPUNIT_ASSERT_EQUAL( sal_uInt32(0x00ff00),(static_cast< const XColorItem& >(pObj->GetMergedItem(XATTR_FILLCOLOR))).GetColorValue().GetColor()); + + + xDocShRef->DoClose(); +} CPPUNIT_TEST_SUITE_REGISTRATION(SdFiltersTest); |