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

New commits:
commit 28cc540d99f545a7871497a7228e57d17406d3ea
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 26 10:37:45 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>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144545
    (cherry picked from commit 324f519b8ccf1a53c6d4e802241b157d774e9864)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144664
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    Tested-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>

diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index 4536e7c75be1..657703fff239 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -505,10 +505,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 66653f751867..d2c9001b50e2 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -84,6 +84,7 @@ public:
     virtual void setUp() override;
 
     void testDocumentLayout();
+    void testTdf152434();
     void testConnectors();
     void testTdf149314();
     void testTdf149124();
@@ -156,6 +157,7 @@ public:
     CPPUNIT_TEST_SUITE(SdImportTest);
 
     CPPUNIT_TEST(testDocumentLayout);
+    CPPUNIT_TEST(testTdf152434);
     CPPUNIT_TEST(testConnectors);
     CPPUNIT_TEST(testTdf149314);
     CPPUNIT_TEST(testTdf149124);
@@ -306,6 +308,15 @@ void SdImportTest::testDocumentLayout()
     }
 }
 
+void SdImportTest::testTdf152434()
+{
+    ::sd::DrawDocShellRef xDocShRef
+        = 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf152434.pptx"), 
PPTX);
+
+    const SdrPage* pPage = GetPage( 1, xDocShRef );
+    CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->GetObjCount());
+}
+
 void SdImportTest::testConnectors()
 {
     ::sd::DrawDocShellRef xDocShRef

Reply via email to