oox/source/export/shapes.cxx | 4 ++-- sd/qa/unit/data/odp/tdf66228.odp |binary sd/qa/unit/export-tests-ooxml1.cxx | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-)
New commits: commit f4efaf455136c3a0db8dfd3f1afc0db827192147 Author: Tibor Nagy <nagy.tib...@nisz.hu> AuthorDate: Fri May 13 14:09:35 2022 +0200 Commit: László Németh <nem...@numbertext.org> CommitDate: Mon May 23 10:59:10 2022 +0200 tdf#66228 PPTX export: fix lost U-shaped connectors which were replaced with straight connector lines. The "Line Connector" has no equivalent in OOXML. So far it has been saved as a "Straight connector". In most cases, the better solution is to change it to "Standard connector", keeping the original layout with U-shaped connectors. Change-Id: I9d6b6174d0556ba2478c6a9837c500b3cc794c82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134284 Tested-by: László Németh <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index ed129784ba51..284daea2db21 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -1662,12 +1662,12 @@ ShapeExport& ShapeExport::WriteConnectorShape( const Reference< XShape >& xShape case ConnectorType_CURVE: sGeometry = "curvedConnector"; break; + case ConnectorType_LINES: case ConnectorType_STANDARD: sGeometry = "bentConnector"; break; default: case ConnectorType_LINE: - case ConnectorType_LINES: sGeometry = "straightConnector1"; break; } @@ -1692,7 +1692,7 @@ ShapeExport& ShapeExport::WriteConnectorShape( const Reference< XShape >& xShape } EscherConnectorListEntry aConnectorEntry( xShape, aStartPoint, rXShapeA, aEndPoint, rXShapeB ); - if (eConnectorType == ConnectorType_CURVE || eConnectorType == ConnectorType_STANDARD) + if (eConnectorType != ConnectorType_LINE) { tools::PolyPolygon aPolyPolygon = EscherPropertyContainer::GetPolyPolygon(xShape); if (aPolyPolygon.Count() > 0) diff --git a/sd/qa/unit/data/odp/tdf66228.odp b/sd/qa/unit/data/odp/tdf66228.odp new file mode 100644 index 000000000000..a34c6fc65270 Binary files /dev/null and b/sd/qa/unit/data/odp/tdf66228.odp differ diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index a1dac4fbf63c..70c64d793084 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -48,6 +48,7 @@ using namespace css; class SdOOXMLExportTest1 : public SdModelTestBaseXML { public: + void testTdf66228(); void testTdf147919(); void testTdf130165(); void testTdf124781(); @@ -118,6 +119,7 @@ public: CPPUNIT_TEST_SUITE(SdOOXMLExportTest1); + CPPUNIT_TEST(testTdf66228); CPPUNIT_TEST(testTdf147919); CPPUNIT_TEST(testTdf130165); CPPUNIT_TEST(testTdf124781); @@ -215,6 +217,19 @@ void checkFontAttributes( const SdrTextObj* pObj, ItemValue nVal, sal_uInt32 nId } +void SdOOXMLExportTest1::testTdf66228() +{ + sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf66228.odp"), ODP); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + xDocShRef->DoClose(); + + xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml"); + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:spPr/a:prstGeom", "prst", + "bentConnector3"); +} + void SdOOXMLExportTest1::testTdf147919() { sd::DrawDocShellRef xDocShRef