[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - oox/source sd/qa

Tamás Zolnai tamas.zolnai at collabora.com
Fri Nov 11 15:34:52 UTC 2016


 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         |   20 ++++++++++++++++++++
 4 files changed, 21 insertions(+), 2 deletions(-)

New commits:
commit 5d337321ac2292d33349a259c895e113f5b366e6
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
Date:   Thu Nov 10 00:41:49 2016 +0100

    tdf#103792: No placeholder text imported for empty title shape
    
    Change-Id: I95b4358f0d4311e8f427c8de18863049fb718d9b
    Reviewed-on: https://gerrit.libreoffice.org/30731
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    (cherry picked from commit dc024cdd91e3c33eeff8eea22fdef0d90d4dd2c0)
    Reviewed-on: https://gerrit.libreoffice.org/30762
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index a3ab467..483ba4d 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1140,7 +1140,7 @@ Reference< XShape > Shape::createAndInsert(
                         }
                     }
                 }
-
+                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 06a173b..ad02b2d 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -141,7 +141,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 da809a2..0fb52dd 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -123,6 +123,7 @@ public:
     void testTdf99030();
     void testTdf49561();
     void testTdf103473();
+    void testTdf103792();
 
     CPPUNIT_TEST_SUITE(SdImportTest);
 
@@ -174,6 +175,7 @@ public:
     CPPUNIT_TEST(testTdf99030);
     CPPUNIT_TEST(testTdf49561);
     CPPUNIT_TEST(testTdf103473);
+    CPPUNIT_TEST(testTdf103792);
 
     CPPUNIT_TEST_SUITE_END();
 };
@@ -1424,6 +1426,24 @@ void SdImportTest::testTdf103473()
     xDocShRef->DoClose();
 }
 
+void SdImportTest::testTdf103792()
+{
+    // Title text shape on the actual slide contained no text neither a placeholder text.
+    sd::DrawDocShellRef xDocShRef = loadURL(m_directories.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();


More information about the Libreoffice-commits mailing list