oox/source/drawingml/shape.cxx | 2 +- oox/source/ppt/pptshape.cxx | 1 - sd/qa/unit/data/pptx/tdf103792.pptx |binary sd/qa/unit/import-tests.cxx | 21 +++++++++++++++++++++ 4 files changed, 22 insertions(+), 2 deletions(-)
New commits: commit 2afcfb6132a1dd7a4e04ca676a7756bc2fed93f0 Author: Tamás Zolnai <tamas.zol...@collabora.com> Date: Thu Nov 10 22:37:13 2016 +0100 tdf#103792: No placeholder text imported for empty title shape Reviewed-on: https://gerrit.libreoffice.org/30731 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com> (cherry picked from commit dc024cdd91e3c33eeff8eea22fdef0d90d4dd2c0) Change-Id: I95b4358f0d4311e8f427c8de18863049fb718d9b diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 08e852c..8bd5cfc 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -1089,7 +1089,7 @@ Reference< XShape > Shape::createAndInsert( aCharStyleProperties.maCharColor.assignIfUsed( pFontRef->maPhClr ); } } - + xText->setString(""); Reference < XTextCursor > xAt = xText->createTextCursor(); getTextBody()->insertAt( rFilterBase, xText, xAt, aCharStyleProperties, mpMasterTextListStyle ); } diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx index ce9b835..c1b37d3 100644 --- a/oox/source/ppt/pptshape.cxx +++ b/oox/source/ppt/pptshape.cxx @@ -139,7 +139,6 @@ void PPTShape::addShape( { sServiceName = "com.sun.star.presentation.TitleTextShape"; aMasterTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getTitleTextStyle() : rSlidePersist.getTitleTextStyle(); - bClearText = true; } break; case XML_subTitle : diff --git a/sd/qa/unit/data/pptx/tdf103792.pptx b/sd/qa/unit/data/pptx/tdf103792.pptx new file mode 100755 index 0000000..e48d25e Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf103792.pptx differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 8f6f360..7ff5a6c 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -113,6 +113,7 @@ public: void testTdf93097(); void testTdf93124(); void testTdf93868(); + void testTdf103792(); CPPUNIT_TEST_SUITE(SdImportTest); @@ -157,6 +158,7 @@ public: CPPUNIT_TEST(testTdf93097); CPPUNIT_TEST(testTdf93124); CPPUNIT_TEST(testTdf93868); + CPPUNIT_TEST(testTdf103792); CPPUNIT_TEST_SUITE_END(); }; @@ -1232,6 +1234,25 @@ void SdImportTest::testTdf93868() xDocShRef->DoClose(); } + +void SdImportTest::testTdf103792() +{ + // Title text shape on the actual slide contained no text neither a placeholder text. + sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/tdf103792.pptx"), PPTX); + + const SdrPage *pPage = GetPage(1, xDocShRef); + CPPUNIT_ASSERT_MESSAGE("No page found", pPage != nullptr); + SdrObject *pObj = pPage->GetObj(0); + CPPUNIT_ASSERT_MESSAGE("Wrong object", pObj != nullptr); + SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>(pObj); + CPPUNIT_ASSERT_MESSAGE("Not a text object", pTxtObj != nullptr); + + const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject(); + CPPUNIT_ASSERT_EQUAL(OUString("Click to add Title"), aEdit.GetText(0)); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT();
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits