summaryrefslogtreecommitdiff
path: root/sd/qa/unit/import-tests.cxx
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-06-06 15:57:43 +0200
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-06-06 17:55:02 +0200
commit7c7c7dc785750769d661df1dc36201b9f5566ea1 (patch)
tree989ed89c59676075079d8a6d8d96e16b5607a02e /sd/qa/unit/import-tests.cxx
parente0c9b690074cd476b03169397cbf1969f2239c1e (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 (cherry picked from commit 46d682eec92bb241f4604a4b6ab42a3859cd0d48)
Diffstat (limited to 'sd/qa/unit/import-tests.cxx')
-rw-r--r--sd/qa/unit/import-tests.cxx32
1 files changed, 29 insertions, 3 deletions
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);