summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-09-16 17:51:12 +0200
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-09-17 09:59:50 +0200
commitb3d50feaa87b670baf68288974005ac26ad31736 (patch)
treea9c56145058ad468fb114d6bda3eafd9d6af1934
parent3f1749f4958d3c167e6134703e0f5e41e6bde0d6 (diff)
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
-rw-r--r--oox/source/ppt/pptshape.cxx9
-rw-r--r--sd/qa/unit/data/pptx/bnc584721_3.pptxbin0 -> 16376 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx27
3 files changed, 30 insertions, 6 deletions
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index a9ed0b945388..cc94f60ba4bc 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -144,12 +144,9 @@ void PPTShape::addShape(
break;
case XML_subTitle :
{
- if ( ( meShapeLocation == Master ) || ( meShapeLocation == Layout ) )
- sServiceName = OUString();
- else {
- sServiceName = "com.sun.star.presentation.SubtitleShape";
- aMasterTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getBodyTextStyle() : rSlidePersist.getBodyTextStyle();
- }
+ sServiceName = "com.sun.star.presentation.SubtitleShape";
+ aMasterTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getBodyTextStyle() : rSlidePersist.getBodyTextStyle();
+ bClearText = true;
}
break;
case XML_obj :
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
--- /dev/null
+++ b/sd/qa/unit/data/pptx/bnc584721_3.pptx
Binary files 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<SdrTextObj *>( 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();