sd/qa/unit/data/pptx/tdf148921.pptx |binary sd/qa/unit/import-tests-smartart.cxx | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+)
New commits: commit b3a4ebd8de244078712d48f21a126f6246b7bc4e Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Wed May 4 17:16:38 2022 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu May 5 10:23:03 2022 +0200 tdf#148921: sd_import_tests-smartart: Add unittest Change-Id: Ib2016afb06914d453fe398127b2f6f50e48c0e93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133834 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sd/qa/unit/data/pptx/tdf148921.pptx b/sd/qa/unit/data/pptx/tdf148921.pptx new file mode 100644 index 000000000000..f4fce9ae4808 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf148921.pptx differ diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx index 9048fe7706ce..2e246485d36c 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -73,6 +73,7 @@ public: void testCnt(); void testDir(); void testTdf148665(); + void testTdf148921(); void testMaxDepth(); void testRotation(); void testTextAutoRotation(); @@ -127,6 +128,7 @@ public: CPPUNIT_TEST(testCnt); CPPUNIT_TEST(testDir); CPPUNIT_TEST(testTdf148665); + CPPUNIT_TEST(testTdf148921); CPPUNIT_TEST(testMaxDepth); CPPUNIT_TEST(testRotation); CPPUNIT_TEST(testTextAutoRotation); @@ -356,6 +358,32 @@ void SdImportTestSmartArt::testTdf148665() xDocShRef->DoClose(); } +void SdImportTestSmartArt::testTdf148921() +{ + sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf148921.pptx"), PPTX); + uno::Reference<drawing::XShapes> xShapeGroup(getShapeFromPage(0, 0, xDocShRef), + uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xShapeGroup->getCount()); + + uno::Reference<drawing::XShapes> xShapeGroup2(xShapeGroup->getByIndex(1), uno::UNO_QUERY_THROW); + + // Without the fix in place, this test would have failed with + // - Expected: 2 + // - Actual : 4 + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xShapeGroup2->getCount()); + + uno::Reference<drawing::XShape> xShape0(xShapeGroup2->getByIndex(0), uno::UNO_QUERY_THROW); + uno::Reference<drawing::XShape> xShape1(xShapeGroup2->getByIndex(1), uno::UNO_QUERY_THROW); + + CPPUNIT_ASSERT(xShape0->getPosition().X < xShape1->getPosition().X); + CPPUNIT_ASSERT(xShape0->getPosition().Y < xShape1->getPosition().Y); + CPPUNIT_ASSERT(xShape0->getSize().Height > xShape1->getSize().Height); + CPPUNIT_ASSERT(xShape0->getSize().Width > xShape1->getSize().Width); + + xDocShRef->DoClose(); +} + void SdImportTestSmartArt::testMaxDepth() { sd::DrawDocShellRef xDocShRef = loadURL(