diff options
author | Tibor Nagy <nagy.tibor2@nisz.hu> | 2022-05-25 12:29:10 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2022-05-30 12:48:03 +0200 |
commit | c3f73f75772d076dfb2ed0538e7d515503edc038 (patch) | |
tree | 2e13c92e96c68b81fb7a853730139a33ccf16029 /oox | |
parent | 81aad6d53fa792dd95732e401ecb298714f699f4 (diff) |
tdf#149128 PPTX export: fix <stCxn> and <endCxn> connector properties
to avoid of detaching connections between shapes,
when these connections were created in Impress.
Change-Id: I1bc90bb8a408546b303b70bcfb27d3549d5e72d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134940
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/shapes.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 284daea2db21..9854c98a584e 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -818,10 +818,10 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape ) mAny >>= isVisible; } pFS->startElementNS( mnXmlNamespace, XML_nvSpPr ); - pFS->startElementNS( mnXmlNamespace, XML_cNvPr, - XML_id, OString::number(GetNewShapeID(xShape)), - XML_name, GetShapeName(xShape), - XML_hidden, sax_fastparser::UseIf("1", !isVisible)); + pFS->startElementNS( + mnXmlNamespace, XML_cNvPr, XML_id, + OString::number(GetShapeID(xShape) == -1 ? GetNewShapeID(xShape) : GetShapeID(xShape)), + XML_name, GetShapeName(xShape), XML_hidden, sax_fastparser::UseIf("1", !isVisible)); if( GETA( URL ) ) { @@ -1745,6 +1745,11 @@ ShapeExport& ShapeExport::WriteConnectorShape( const Reference< XShape >& xShape XML_name, GetShapeName(xShape)); // non visual connector shape drawing properties pFS->startElementNS(mnXmlNamespace, XML_cNvCxnSpPr); + + if (GetShapeID(rXShapeA) == -1) + GetNewShapeID(rXShapeA); + if (GetShapeID(rXShapeB) == -1) + GetNewShapeID(rXShapeB); WriteConnectorConnections(aConnectorEntry, GetShapeID(rXShapeA), GetShapeID(rXShapeB)); pFS->endElementNS(mnXmlNamespace, XML_cNvCxnSpPr); if (GetDocumentType() == DOCUMENT_PPTX) |