summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorRegényi Balázs <regenyi.balazs@nisz.hu>2020-10-06 15:52:18 +0200
committerLászló Németh <nemeth@numbertext.org>2020-10-09 10:31:20 +0200
commit7b2f0094f86266c64972d3e505a28b2d4e5caef6 (patch)
treecc181ce1441f11a410ac2d1c9e18830e3b1f3ee0 /oox
parentd4876c04fbf0fdb2b153d0d6a7d7b101989d58bb (diff)
tdf#99810 DOCX export: fix lost arrow shape
by saving connector shape as shape element wps:wps instead of the invalid wps:cxnSp. Co-author-by: Szabolcs Tóth Change-Id: I0ed435eff8e4284f04f71f8fa8c1dc4cfbee5af9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104032 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.cxx36
1 files changed, 23 insertions, 13 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 215d56595ebc..00a44d3fccfa 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1309,19 +1309,29 @@ ShapeExport& ShapeExport::WriteConnectorShape( const Reference< XShape >& xShape
aRect.setHeight( aStartPoint.Y - aEndPoint.Y );
}
- pFS->startElementNS(mnXmlNamespace, XML_cxnSp);
+ // tdf#99810 connector shape (cxnSp) is not valid with namespace 'wps'
+ const auto nShapeNode = (mnXmlNamespace == XML_wps ? XML_wsp : XML_cxnSp);
+ pFS->startElementNS(mnXmlNamespace, nShapeNode);
- // non visual shape properties
- pFS->startElementNS(mnXmlNamespace, XML_nvCxnSpPr);
- pFS->singleElementNS( mnXmlNamespace, XML_cNvPr,
- XML_id, OString::number(GetNewShapeID(xShape)),
- XML_name, GetShapeName(xShape));
- // non visual connector shape drawing properties
- pFS->startElementNS(mnXmlNamespace, XML_cNvCxnSpPr);
- WriteConnectorConnections( aConnectorEntry, GetShapeID( rXShapeA ), GetShapeID( rXShapeB ) );
- pFS->endElementNS( mnXmlNamespace, XML_cNvCxnSpPr );
- pFS->singleElementNS(mnXmlNamespace, XML_nvPr);
- pFS->endElementNS( mnXmlNamespace, XML_nvCxnSpPr );
+ if (mnXmlNamespace == XML_wps)
+ {
+ // non visual connector shape drawing properties
+ pFS->singleElementNS(mnXmlNamespace, XML_cNvCnPr);
+ }
+ else
+ {
+ // non visual shape properties
+ pFS->startElementNS(mnXmlNamespace, XML_nvCxnSpPr);
+ pFS->singleElementNS(mnXmlNamespace, XML_cNvPr,
+ XML_id, OString::number(GetNewShapeID(xShape)),
+ XML_name, GetShapeName(xShape));
+ // non visual connector shape drawing properties
+ pFS->startElementNS(mnXmlNamespace, XML_cNvCxnSpPr);
+ WriteConnectorConnections(aConnectorEntry, GetShapeID(rXShapeA), GetShapeID(rXShapeB));
+ pFS->endElementNS(mnXmlNamespace, XML_cNvCxnSpPr);
+ pFS->singleElementNS(mnXmlNamespace, XML_nvPr);
+ pFS->endElementNS(mnXmlNamespace, XML_nvCxnSpPr);
+ }
// visual shape properties
pFS->startElementNS(mnXmlNamespace, XML_spPr);
@@ -1336,7 +1346,7 @@ ShapeExport& ShapeExport::WriteConnectorShape( const Reference< XShape >& xShape
// write text
WriteTextBox( xShape, mnXmlNamespace );
- pFS->endElementNS( mnXmlNamespace, XML_cxnSp );
+ pFS->endElementNS(mnXmlNamespace, nShapeNode);
return *this;
}