tdf#96051: FILESAVE: Roundtrip any PPTX file with Shapes creates invalid OOXML

Revert "bnc#584721: Import subtitle block to master slides"
This reverts commit b3d50feaa8.

It seems the imported subtitle block makes export corrupt the
output. Better to have a valid output.

Change-Id: I1a3d4f03e4fa0c4431a5394495682a1b9d7677bc
This commit is contained in:
Zolnai Tamás
2015-12-20 14:21:43 +01:00
parent 44f2edbf7a
commit a9db17aabc
3 changed files with 6 additions and 27 deletions

View File

@@ -144,9 +144,12 @@ void PPTShape::addShape(
break; break;
case XML_subTitle : case XML_subTitle :
{ {
sServiceName = "com.sun.star.presentation.SubtitleShape"; if ( ( meShapeLocation == Master ) || ( meShapeLocation == Layout ) )
aMasterTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getBodyTextStyle() : rSlidePersist.getBodyTextStyle(); sServiceName = OUString();
bClearText = true; else {
sServiceName = "com.sun.star.presentation.SubtitleShape";
aMasterTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getBodyTextStyle() : rSlidePersist.getBodyTextStyle();
}
} }
break; break;
case XML_obj : case XML_obj :

View File

@@ -91,7 +91,6 @@ public:
void testCreationDate(); void testCreationDate();
void testBnc584721_1(); void testBnc584721_1();
void testBnc584721_2(); void testBnc584721_2();
void testBnc584721_3();
void testBnc584721_4(); void testBnc584721_4();
void testBnc904423(); void testBnc904423();
void testShapeLineStyle(); void testShapeLineStyle();
@@ -133,7 +132,6 @@ public:
CPPUNIT_TEST(testCreationDate); CPPUNIT_TEST(testCreationDate);
CPPUNIT_TEST(testBnc584721_1); CPPUNIT_TEST(testBnc584721_1);
CPPUNIT_TEST(testBnc584721_2); CPPUNIT_TEST(testBnc584721_2);
CPPUNIT_TEST(testBnc584721_3);
CPPUNIT_TEST(testBnc584721_4); CPPUNIT_TEST(testBnc584721_4);
CPPUNIT_TEST(testBnc904423); CPPUNIT_TEST(testBnc904423);
CPPUNIT_TEST(testShapeLineStyle); CPPUNIT_TEST(testShapeLineStyle);
@@ -800,28 +798,6 @@ void SdImportTest::testBnc584721_2()
xDocShRef->DoClose(); xDocShRef->DoClose();
} }
void SdImportTest::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);
const SdrPage *pPage = &(GetPage( 1, xDocShRef )->TRG_GetMasterPage());
SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pPage->GetObj(1) );
CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != nullptr);
// 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();
}
void SdImportTest::testBnc591147() void SdImportTest::testBnc591147()
{ {
sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc591147.pptx"), PPTX); sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc591147.pptx"), PPTX);