diff --git a/include/filter/msfilter/escherex.hxx b/include/filter/msfilter/escherex.hxx index 91606bca13a2..d6c1b620f077 100644 --- a/include/filter/msfilter/escherex.hxx +++ b/include/filter/msfilter/escherex.hxx @@ -452,7 +452,7 @@ namespace com::sun::star { } } -struct UNLESS_MERGELIBS(MSFILTER_DLLPUBLIC) EscherConnectorListEntry +struct MSFILTER_DLLPUBLIC EscherConnectorListEntry { css::uno::Reference< css::drawing::XShape > mXConnector; css::awt::Point maPointA; diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 0bb8d1ebeecc..40bed3208567 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -1893,16 +1893,6 @@ ShapeExport& ShapeExport::WriteConnectorShape( const Reference< XShape >& xShape if (GetProperty(rXPropSet, u"EdgeEndConnection"_ustr)) mAny >>= rXShapeB; - if (GetProperty(rXPropSet, u"StartGluePointIndex"_ustr)) - mAny >>= nStartGlueId; - if (nStartGlueId != -1) - nStartGlueId = lcl_GetGluePointId(rXShapeA, nStartGlueId); - - if (GetProperty(rXPropSet, u"EndGluePointIndex"_ustr)) - mAny >>= nEndGlueId; - if (nEndGlueId != -1) - nEndGlueId = lcl_GetGluePointId(rXShapeB, nEndGlueId); - // Position is relative to group in Word, but relative to anchor of group in API. if (GetDocumentType() == DOCUMENT_DOCX && !mbUserShapes && m_xParent.is()) { @@ -1914,6 +1904,24 @@ ShapeExport& ShapeExport::WriteConnectorShape( const Reference< XShape >& xShape } EscherConnectorListEntry aConnectorEntry( xShape, aStartPoint, rXShapeA, aEndPoint, rXShapeB ); + if (GetProperty(rXPropSet, u"StartGluePointIndex"_ustr)) + { + mAny >>= nStartGlueId; + nStartGlueId = (nStartGlueId != -1) ? lcl_GetGluePointId(rXShapeA, nStartGlueId) + : (aConnectorEntry.mXConnectToA.is() + ? aConnectorEntry.GetConnectorRule(true) + : -1); + } + + if (GetProperty(rXPropSet, u"EndGluePointIndex"_ustr)) + { + mAny >>= nEndGlueId; + nEndGlueId = (nEndGlueId != -1) ? lcl_GetGluePointId(rXShapeB, nEndGlueId) + : (aConnectorEntry.mXConnectToB.is() + ? aConnectorEntry.GetConnectorRule(false) + : -1); + } + if (eConnectorType != ConnectorType_LINE) { tools::PolyPolygon aPolyPolygon = EscherPropertyContainer::GetPolyPolygon(xShape); diff --git a/sd/qa/unit/data/odp/tdf164775.odp b/sd/qa/unit/data/odp/tdf164775.odp new file mode 100644 index 000000000000..69b163333e3e Binary files /dev/null and b/sd/qa/unit/data/odp/tdf164775.odp differ diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx index c3ea2f874633..9e0b36b9096d 100644 --- a/sd/qa/unit/export-tests-ooxml3.cxx +++ b/sd/qa/unit/export-tests-ooxml3.cxx @@ -27,6 +27,18 @@ public: int testTdf115005_FallBack_Images(bool bAddReplacementImages); }; +CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf164775_ConnectorShape) +{ + createSdImpressDoc("odp/tdf164775.odp"); + save(u"Impress Office Open XML"_ustr); + + xmlDocUniquePtr pXmlDoc1 = parseExport(u"ppt/slides/slide1.xml"_ustr); + assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "idx", + u"3"); + assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn", "idx", + u"1"); +} + CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf153105) { createSdImpressDoc("odp/tdf153105.odp");