tdf#131553: Add unittest
Change-Id: If43a23f6947ecd70f815dfdc6b9adf2f7af0e84f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91225
Tested-by: Jenkins
Reviewed-by: Xisco FaulĂ <xiscofauli@libreoffice.org>
diff --git a/sd/qa/unit/data/pptx/tdf131553.pptx b/sd/qa/unit/data/pptx/tdf131553.pptx
new file mode 100644
index 0000000..106067d
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf131553.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index d14c4bc..a94e5cc 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -17,6 +17,8 @@
#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
#include <svx/svdpage.hxx>
#include <svx/svdogrp.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <oox/drawingml/drawingmltypes.hxx>
@@ -105,6 +107,7 @@ public:
void testRecursion();
void testDataFollow();
void testOrgChart2();
void testTdf131553();
CPPUNIT_TEST_SUITE(SdImportTestSmartArt);
@@ -149,6 +152,7 @@ public:
CPPUNIT_TEST(testRecursion);
CPPUNIT_TEST(testDataFollow);
CPPUNIT_TEST(testOrgChart2);
CPPUNIT_TEST(testTdf131553);
CPPUNIT_TEST_SUITE_END();
};
@@ -1454,6 +1458,21 @@ void SdImportTestSmartArt::testOrgChart2()
xDocShRef->DoClose();
}
void SdImportTestSmartArt::testTdf131553()
{
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf131553.pptx"), PPTX);
uno::Reference<drawing::XShape> xGroup(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY);
const SdrPage *pPage = GetPage(1, xDocShRef);
const SdrObjGroup *pObjGroup = dynamic_cast<SdrObjGroup *>(pPage->GetObj(0));
CPPUNIT_ASSERT(pObjGroup);
const SdrObject *pObj = pObjGroup->GetSubList()->GetObj(1);
CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(OBJ_OLE2), pObj->GetObjIdentifier());
xDocShRef->DoClose();
}
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTestSmartArt);
CPPUNIT_PLUGIN_IMPLEMENT();