Kaydet (Commit) b3d50fea authored tarafından Zolnai Tamás's avatar Zolnai Tamás

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
üst 3f1749f4
......@@ -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 :
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment