summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-06-06 17:53:38 +0200
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-06-06 17:53:38 +0200
commit5b6d26becca7f7a03bbc615265c5426deb28244f (patch)
tree95d1c228b81d70823bd209ec41782b6dfb02113c /sd
parentd65532e92e209d486cffe260adc849ae96683e6a (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. (cherry picked from commit 46d682eec92bb241f4604a4b6ab42a3859cd0d48) Change-Id: I9e8d54c2b1afeb78a1122390dc4982d580c152ae
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/bnc880763.pptxbin0 -> 45631 bytes
-rw-r--r--sd/qa/unit/data/xml/n819614_0.xml18
-rw-r--r--sd/qa/unit/import-tests.cxx28
3 files changed, 36 insertions, 10 deletions
diff --git a/sd/qa/unit/data/pptx/bnc880763.pptx b/sd/qa/unit/data/pptx/bnc880763.pptx
new file mode 100644
index 000000000000..f45eb13ec308
--- /dev/null
+++ b/sd/qa/unit/data/pptx/bnc880763.pptx
Binary files differ
diff --git a/sd/qa/unit/data/xml/n819614_0.xml b/sd/qa/unit/data/xml/n819614_0.xml
index 6a834be4c2f5..3c0b5b1592d6 100644
--- a/sd/qa/unit/data/xml/n819614_0.xml
+++ b/sd/qa/unit/data/xml/n819614_0.xml
@@ -14,15 +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>
- <InteropGrabBag/>
- </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="">
@@ -7001,4 +6992,13 @@
</Transformation>
<InteropGrabBag/>
</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>
+ <InteropGrabBag/>
+ </XShape>
</XShapes>
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 4f681042ab02..0b601325fc35 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -60,6 +60,7 @@ public:
void testBnc870237();
void testBnc870233_1();
void testBnc870233_2();
+ void testBnc880763();
CPPUNIT_TEST_SUITE(SdFiltersTest);
CPPUNIT_TEST(testDocumentLayout);
@@ -74,6 +75,7 @@ public:
CPPUNIT_TEST(testBnc870237);
CPPUNIT_TEST(testBnc870233_1);
CPPUNIT_TEST(testBnc870233_2);
+ CPPUNIT_TEST(testBnc880763);
CPPUNIT_TEST_SUITE_END();
};
@@ -419,7 +421,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());
@@ -564,6 +566,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);