oox/source/ppt/slidepersist.cxx | 8 ++++++++ sd/qa/unit/data/pptx/tdf149124.pptx |binary sd/qa/unit/import-tests.cxx | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+)
New commits: commit 25e747ed39a3742d26c1128b6823679de279d5df Author: Tibor Nagy <nagy.tib...@nisz.hu> AuthorDate: Wed May 25 15:52:55 2022 +0200 Commit: László Németh <nem...@numbertext.org> CommitDate: Fri May 27 09:59:59 2022 +0200 tdf#149124 PPTX import: fix broken connectors in grouped shapes Previously connector lines of grouped shapes were detached after the import losing the original layout (without ungrouping and moving the shapes). Change-Id: I660629d9d1c2cb0ab68de275ca5406f4c48e9145 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134943 Tested-by: László Németh <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index 81a0fd7991a7..24ce2f9da464 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -150,6 +150,14 @@ void SlidePersist::createXShapes( XmlFilterBase& rFilterBase ) pPPTShape->addShape( rFilterBase, *this, getTheme().get(), xShapes, aTransformation, &getShapeMap() ); if (pPPTShape->isConnectorShape()) maConnectorShapeId.push_back(pPPTShape->getId()); + if (!pPPTShape->getChildren().empty()) + { + for (size_t i = 0; i < pPPTShape->getChildren().size(); i++) + { + if (pPPTShape->getChildren()[i]->isConnectorShape()) + maConnectorShapeId.push_back(pPPTShape->getChildren()[i]->getId()); + } + } } else child->addShape( rFilterBase, getTheme().get(), xShapes, aTransformation, maShapesPtr->getFillProperties(), &getShapeMap() ); diff --git a/sd/qa/unit/data/pptx/tdf149124.pptx b/sd/qa/unit/data/pptx/tdf149124.pptx new file mode 100644 index 000000000000..9c43c43ce09b Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf149124.pptx differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 100c9e784875..9e60c8886dec 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -81,6 +81,7 @@ public: virtual void setUp() override; void testDocumentLayout(); + void testTdf149124(); void testTdf89449(); void testTdf147459(); void testTdf146223(); @@ -149,6 +150,7 @@ public: CPPUNIT_TEST_SUITE(SdImportTest); CPPUNIT_TEST(testDocumentLayout); + CPPUNIT_TEST(testTdf149124); CPPUNIT_TEST(testTdf89449); CPPUNIT_TEST(testTdf147459); CPPUNIT_TEST(testTdf146223); @@ -295,6 +297,22 @@ void SdImportTest::testDocumentLayout() } } +void SdImportTest::testTdf149124() +{ + sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf149124.pptx"), PPTX); + + uno::Reference<container::XIndexAccess> xGroupShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xStandardConnector(xGroupShape->getByIndex(2), uno::UNO_QUERY_THROW); + + sal_Int32 nStartGlueId = xStandardConnector->getPropertyValue("StartGluePointIndex").get<sal_Int32>(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), nStartGlueId); + sal_Int32 nEndGlueId = xStandardConnector->getPropertyValue("EndGluePointIndex").get<sal_Int32>(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nEndGlueId); + + xDocShRef->DoClose(); +} + void SdImportTest::testTdf89449() { sd::DrawDocShellRef xDocShRef