summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-11-29 09:20:28 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-11-30 08:05:00 +0000
commitc3d124254a3097163aae127e2fe3e34980417f20 (patch)
tree3f6127ba1701bde78627a1003b16a8eabc6f3e82 /oox
parent3de0128ec4e0fce998c84043a7f8f173f1f8ac96 (diff)
tdf#104115 DOCX export: ClosedBezierShape should always result in <a:custGeom>
Regression from commit 6b084f0001fc15112bf3c40d20a0c7096c83b7fe (asan: global-buffer-overflow on fdo55736-1.docx, 2015-01-08), the problem as seen by the user was that our VML->DML conversion in a DOCX file resulted in output that wasn't accepted by Word anymore. Now that commit itself is fine, but as a side effect, the somewhat unusual (bezier with no actual polypolygons) child shape of the group shape is now written, but not in a way that conforms to the drawingML schema. Fix that pre-existing, but now visible problem by always writing <a:custGeom> in the DOCX case. (cherry picked from commit a5cc8993dceb61c63caf26ae995d9d62905291e5) Change-Id: Idbcb903dda07b5c2408d2b0ebbf4b5e4a08b20ed Reviewed-on: https://gerrit.libreoffice.org/31383 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 0951449950a3..8d0256594be4 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2540,7 +2540,9 @@ bool DrawingML::WriteCustomGeometry( const Reference< XShape >& rXShape )
void DrawingML::WritePolyPolygon( const tools::PolyPolygon& rPolyPolygon )
{
- if( rPolyPolygon.Count() < 1 )
+ // In case of Writer, the parent element is <wps:spPr>, and there the
+ // <a:custGeom> element is not optional.
+ if (rPolyPolygon.Count() < 1 && GetDocumentType() != DOCUMENT_DOCX)
return;
mpFS->startElementNS( XML_a, XML_custGeom, FSEND );