sd/qa/unit/data/pptx/tdf148665.pptx  |binary
 sd/qa/unit/import-tests-smartart.cxx |   22 ++++++++++++++++++++++
 2 files changed, 22 insertions(+)

New commits:
commit 61a4b90dcdb953dd21a22a2f291ffd6be399ddd8
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Wed Apr 27 13:39:01 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Apr 27 22:17:56 2022 +0200

    tdf#148665: sd_import_tests-smartart: Add unittest
    
    Change-Id: I345f0a55ba5bbe78e4c0bfccd9b21965c05bff33
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133507
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sd/qa/unit/data/pptx/tdf148665.pptx 
b/sd/qa/unit/data/pptx/tdf148665.pptx
new file mode 100644
index 000000000000..e8613e2969a6
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf148665.pptx differ
diff --git a/sd/qa/unit/import-tests-smartart.cxx 
b/sd/qa/unit/import-tests-smartart.cxx
index 91773929a05d..9048fe7706ce 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -72,6 +72,7 @@ public:
     void testText();
     void testCnt();
     void testDir();
+    void testTdf148665();
     void testMaxDepth();
     void testRotation();
     void testTextAutoRotation();
@@ -125,6 +126,7 @@ public:
     CPPUNIT_TEST(testText);
     CPPUNIT_TEST(testCnt);
     CPPUNIT_TEST(testDir);
+    CPPUNIT_TEST(testTdf148665);
     CPPUNIT_TEST(testMaxDepth);
     CPPUNIT_TEST(testRotation);
     CPPUNIT_TEST(testTextAutoRotation);
@@ -334,6 +336,26 @@ void SdImportTestSmartArt::testDir()
     xDocShRef->DoClose();
 }
 
+void SdImportTestSmartArt::testTdf148665()
+{
+    // Without the fix in place, this test would have crashed at import time
+    sd::DrawDocShellRef xDocShRef
+        = 
loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf148665.pptx"), 
PPTX);
+    uno::Reference<drawing::XShapes> xShapeGroup(getShapeFromPage(0, 0, 
xDocShRef),
+                                                 uno::UNO_QUERY_THROW);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xShapeGroup->getCount());
+
+    // FIXME: tdf#148818: Text should be 'Fufufu'
+    uno::Reference<text::XText> xText0(xShapeGroup->getByIndex(1), 
uno::UNO_QUERY_THROW);
+    CPPUNIT_ASSERT_EQUAL(OUString(""), xText0->getString());
+    uno::Reference<text::XText> xText1(xShapeGroup->getByIndex(2), 
uno::UNO_QUERY_THROW);
+    CPPUNIT_ASSERT_EQUAL(OUString("Susu"), xText1->getString());
+    uno::Reference<text::XText> xText2(xShapeGroup->getByIndex(3), 
uno::UNO_QUERY_THROW);
+    CPPUNIT_ASSERT_EQUAL(OUString("Sasa Haha"), xText2->getString());
+
+    xDocShRef->DoClose();
+}
+
 void SdImportTestSmartArt::testMaxDepth()
 {
     sd::DrawDocShellRef xDocShRef = loadURL(

Reply via email to