oox/source/ppt/slidepersist.cxx     |   12 ++++++++----
 sd/qa/unit/data/pptx/tdf152434.pptx |binary
 sd/qa/unit/import-tests.cxx         |   13 +++++++++++++
 3 files changed, 21 insertions(+), 4 deletions(-)

New commits:
commit d67b38039c672c8f88d2a668312dbcdbaea4297a
Author:     Tibor Nagy <nagy.tib...@nisz.hu>
AuthorDate: Mon Dec 12 16:44:07 2022 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Dec 19 19:58:32 2022 +0000

    tdf#152434 PPTX import: fix lost shapes with connectors
    
    Regression from commit eec48130271188cab63665acedbabf1ff5e850a2
    "tdf#148926 tdf#151678 PPTX import: position of standard connector
     - part1".
    
    Change-Id: Ib9381403f7c0edf9a06e3d98965067a51b4797d8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144000
    Tested-by: László Németh <nem...@numbertext.org>
    Reviewed-by: László Németh <nem...@numbertext.org>
    (cherry picked from commit c3f1ec60569727d8aba50b2f59882e13a8443880)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144485
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index 9d2ad58b5be2..c875239aac46 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -504,10 +504,14 @@ void SlidePersist::createConnectorShapeConnection()
                     }
                 }
             }
-            ConnectorType aConnectorType;
-            xPropertySet->getPropertyValue("EdgeKind") >>= aConnectorType;
-            if (aConnectorType == ConnectorType_STANDARD)
-                lcl_SetEdgeLineValue(xConnector, pIt->second);
+            uno::Reference<beans::XPropertySetInfo> xPropInfo = 
xPropertySet->getPropertySetInfo();
+            if (xPropInfo->hasPropertyByName("EdgeKind"))
+            {
+                ConnectorType aConnectorType;
+                xPropertySet->getPropertyValue("EdgeKind") >>= aConnectorType;
+                if (aConnectorType == ConnectorType_STANDARD)
+                    lcl_SetEdgeLineValue(xConnector, pIt->second);
+            }
         }
     }
     maConnectorShapeId.clear();
diff --git a/sd/qa/unit/data/pptx/tdf152434.pptx 
b/sd/qa/unit/data/pptx/tdf152434.pptx
new file mode 100644
index 000000000000..f0716a92fe1b
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf152434.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index eb125a46834f..abd21782bf68 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -83,6 +83,7 @@ public:
     }
 
     void testDocumentLayout();
+    void testTdf152434();
     void testConnectors();
     void testTdf150719();
     void testTdf149314();
@@ -157,6 +158,7 @@ public:
     CPPUNIT_TEST_SUITE(SdImportTest);
 
     CPPUNIT_TEST(testDocumentLayout);
+    CPPUNIT_TEST(testTdf152434);
     CPPUNIT_TEST(testConnectors);
     CPPUNIT_TEST(testTdf150719);
     CPPUNIT_TEST(testTdf149314);
@@ -338,6 +340,17 @@ void SdImportTest::testDocumentLayout()
     }
 }
 
+void SdImportTest::testTdf152434()
+{
+    createSdImpressDoc("pptx/tdf152434.pptx");
+
+    SdXImpressDocument* pXImpressDocument = 
dynamic_cast<SdXImpressDocument*>(mxComponent.get());
+    CPPUNIT_ASSERT(pXImpressDocument);
+    SdDrawDocument* pDoc = pXImpressDocument->GetDoc();
+    const SdrPage* pPage = pDoc->GetPage(1);
+    CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->GetObjCount());
+}
+
 void SdImportTest::testConnectors()
 {
     createSdImpressDoc("pptx/connectors.pptx");

Reply via email to