From b3d50feaa87b670baf68288974005ac26ad31736 Mon Sep 17 00:00:00 2001 From: Zolnai Tamás Date: Tue, 16 Sep 2014 17:51:12 +0200 Subject: bnc#584721: Import subtitle block to master slides For some reason subtitle block was skipped for layouts. It seems we can enable it for layout too, it appears well on master slides. Change-Id: I23ec7d4fcce045099bfca9e94a8c9335beaf7468 --- sd/qa/unit/data/pptx/bnc584721_3.pptx | Bin 0 -> 16376 bytes sd/qa/unit/import-tests.cxx | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 sd/qa/unit/data/pptx/bnc584721_3.pptx (limited to 'sd/qa') diff --git a/sd/qa/unit/data/pptx/bnc584721_3.pptx b/sd/qa/unit/data/pptx/bnc584721_3.pptx new file mode 100644 index 000000000000..38662575e502 Binary files /dev/null and b/sd/qa/unit/data/pptx/bnc584721_3.pptx differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 3f8d1447deda..91fec0f1998e 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -80,6 +80,7 @@ public: void testCreationDate(); void testBnc584721_1(); void testBnc584721_2(); + void testBnc584721_3(); CPPUNIT_TEST_SUITE(SdFiltersTest); CPPUNIT_TEST(testDocumentLayout); @@ -104,6 +105,7 @@ public: CPPUNIT_TEST(testCreationDate); CPPUNIT_TEST(testBnc584721_1); CPPUNIT_TEST(testBnc584721_2); + CPPUNIT_TEST(testBnc584721_3); CPPUNIT_TEST_SUITE_END(); }; @@ -746,6 +748,31 @@ void SdFiltersTest::testBnc584721_2() xDocShRef->DoClose(); } +void SdFiltersTest::testBnc584721_3() +{ + // Subtitle was simply skipped on master slides. + // Check whether the second shape is a subtitle shape with the right text. + + ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc584721_3.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 ); + SdrTextObj *pTxtObj = dynamic_cast( pPage->GetObj(1) ); + CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != NULL); + + // Check the shape type + uno::Reference< drawing::XShape > xShape( pTxtObj->getUnoShape(), uno::UNO_QUERY ); + CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.presentation.SubtitleShape"), xShape->getShapeType()); + + // Check the text + const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject(); + CPPUNIT_ASSERT_EQUAL(OUString("Click to edit Master subtitle style"), aEdit.GetText(0)); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdFiltersTest); CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit