summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-04-27 13:39:01 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-04-27 22:17:56 +0200
commit61a4b90dcdb953dd21a22a2f291ffd6be399ddd8 (patch)
tree5c212b45062ec3ab7be89991aa774bcc506ff81e
parent74c1b3216593eaf522fb54bd99ac36bae4ecc04a (diff)
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 <xiscofauli@libreoffice.org>
-rw-r--r--sd/qa/unit/data/pptx/tdf148665.pptxbin0 -> 33343 bytes
-rw-r--r--sd/qa/unit/import-tests-smartart.cxx22
2 files changed, 22 insertions, 0 deletions
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
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf148665.pptx
Binary files 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(