From 3f1749f4958d3c167e6134703e0f5e41e6bde0d6 Mon Sep 17 00:00:00 2001 From: Zolnai Tamás Date: Wed, 17 Sep 2014 09:53:50 +0200 Subject: bnc#584721: Do not add extra title and outliner blocks to master slide There are master slides / layouts imported from PPTX in which there is no title or body layout block, but so far Impress added these by default to the master slides if they were missing. Now they are skipped by the importer code. Change-Id: I256a4e78639ea39d0f87a94e6676422c7dbcde4a --- sd/qa/unit/data/pptx/bnc584721_1.pptx | Bin 15008 -> 0 bytes sd/qa/unit/data/pptx/bnc584721_1_2.pptx | Bin 0 -> 15008 bytes sd/qa/unit/import-tests.cxx | 19 ++++++++++++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) delete mode 100644 sd/qa/unit/data/pptx/bnc584721_1.pptx create mode 100644 sd/qa/unit/data/pptx/bnc584721_1_2.pptx (limited to 'sd') diff --git a/sd/qa/unit/data/pptx/bnc584721_1.pptx b/sd/qa/unit/data/pptx/bnc584721_1.pptx deleted file mode 100644 index dbbcabddcbbb..000000000000 Binary files a/sd/qa/unit/data/pptx/bnc584721_1.pptx and /dev/null differ diff --git a/sd/qa/unit/data/pptx/bnc584721_1_2.pptx b/sd/qa/unit/data/pptx/bnc584721_1_2.pptx new file mode 100644 index 000000000000..dbbcabddcbbb Binary files /dev/null and b/sd/qa/unit/data/pptx/bnc584721_1_2.pptx differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 3036a58ad9b3..3f8d1447deda 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -79,6 +79,7 @@ public: void testBnc480256(); void testCreationDate(); void testBnc584721_1(); + void testBnc584721_2(); CPPUNIT_TEST_SUITE(SdFiltersTest); CPPUNIT_TEST(testDocumentLayout); @@ -102,6 +103,7 @@ public: CPPUNIT_TEST(testBnc480256); CPPUNIT_TEST(testCreationDate); CPPUNIT_TEST(testBnc584721_1); + CPPUNIT_TEST(testBnc584721_2); CPPUNIT_TEST_SUITE_END(); }; @@ -715,7 +717,7 @@ void SdFiltersTest::testBnc584721_1() { // Title text shape on the master page contained wrong text. - ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc584721_1.pptx"), PPTX); + ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc584721_1_2.pptx"), PPTX); SdDrawDocument *pDoc = xDocShRef->GetDoc(); CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL ); @@ -729,6 +731,21 @@ void SdFiltersTest::testBnc584721_1() xDocShRef->DoClose(); } +void SdFiltersTest::testBnc584721_2() +{ + // Import created an extra/unneeded outliner shape on the master slide next to the imported title shape. + + ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc584721_1_2.pptx"), PPTX); + + SdDrawDocument *pDoc = xDocShRef->GetDoc(); + CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL ); + const SdrPage *pPage = &(pDoc->GetPage(1)->TRG_GetMasterPage()); + CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL ); + CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->GetObjCount()); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdFiltersTest); CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit