diff options
author | Tibor Nagy <nagy.tibor2@nisz.hu> | 2022-05-25 15:52:55 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2022-05-27 09:59:59 +0200 |
commit | 25e747ed39a3742d26c1128b6823679de279d5df (patch) | |
tree | c0dea8545682896b4b09615f082cd47a9899dcf9 | |
parent | 182d2a47a2b4ed0affdc828a534c1659cc2e926d (diff) |
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 <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
-rw-r--r-- | oox/source/ppt/slidepersist.cxx | 8 | ||||
-rw-r--r-- | sd/qa/unit/data/pptx/tdf149124.pptx | bin | 0 -> 33988 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 18 |
3 files changed, 26 insertions, 0 deletions
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 Binary files differnew file mode 100644 index 000000000000..9c43c43ce09b --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf149124.pptx 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 |