diff options
author | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2019-08-09 01:20:37 +0200 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2019-08-09 22:08:28 +0200 |
commit | 3feaff84fafc23c26ff9c6a716709f17a6c8330b (patch) | |
tree | bf8d72d74b4aa93a3445bd3170b6173ccb640955 /oox | |
parent | 3d50afb8c91bdb2e01391c05171815e75dd1e3f3 (diff) |
tdf#126746 Fix exporting closed Polylines to PPTX
In previous implementation the closed shapes was
imported as a polylines without closing joint.
As a result the joint style was not applied.
This patch fixes that, and allow proper PPTX export.
TODO The same issue needs to be fixed for PPT export
Change-Id: I557daac1ba02330d8923f7eda3476e67d8711384
Reviewed-on: https://gerrit.libreoffice.org/77179
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/drawingml.cxx | 4 | ||||
-rw-r--r-- | oox/source/export/shapes.cxx | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index e8101882f4df..58e7db53372d 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -3199,7 +3199,7 @@ sal_Int32 DrawingML::GetCustomGeometryPointValue( return nValue; } -void DrawingML::WritePolyPolygon( const tools::PolyPolygon& rPolyPolygon ) +void DrawingML::WritePolyPolygon( const tools::PolyPolygon& rPolyPolygon, const bool bClosed ) { // In case of Writer, the parent element is <wps:spPr>, and there the // <a:custGeom> element is not optional. @@ -3269,6 +3269,8 @@ void DrawingML::WritePolyPolygon( const tools::PolyPolygon& rPolyPolygon ) } } } + if (bClosed) + mpFS->singleElementNS( XML_a, XML_close); mpFS->endElementNS( XML_a, XML_path ); mpFS->endElementNS( XML_a, XML_pathLst ); diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 2c0fb1627bbb..ebdac1259ffd 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -420,7 +420,7 @@ bool ShapeExport::NonEmptyText( const Reference< XInterface >& xIface ) return false; } -ShapeExport& ShapeExport::WritePolyPolygonShape( const Reference< XShape >& xShape, bool bClosed ) +ShapeExport& ShapeExport::WritePolyPolygonShape( const Reference< XShape >& xShape, const bool bClosed ) { SAL_INFO("oox.shape", "write polypolygon shape"); @@ -454,7 +454,7 @@ ShapeExport& ShapeExport::WritePolyPolygonShape( const Reference< XShape >& xSha // visual shape properties pFS->startElementNS(mnXmlNamespace, XML_spPr); WriteTransformation( aRect, XML_a ); - WritePolyPolygon( aPolyPolygon ); + WritePolyPolygon( aPolyPolygon, bClosed ); Reference< XPropertySet > xProps( xShape, UNO_QUERY ); if( xProps.is() ) { if( bClosed ) @@ -882,7 +882,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape ) bool bInvertRotation = bFlipH != bFlipV; if (nRotation != 0) aPolyPolygon.Rotate(Point(0,0), static_cast<sal_uInt16>(bInvertRotation ? nRotation/10 : 3600-nRotation/10)); - WritePolyPolygon( aPolyPolygon ); + WritePolyPolygon( aPolyPolygon, false ); } else if (bCustGeom) { @@ -1477,7 +1477,7 @@ static const NameToConvertMapType& lcl_GetConverters() { "com.sun.star.drawing.LineShape" , &ShapeExport::WriteLineShape }, { "com.sun.star.drawing.OpenBezierShape" , &ShapeExport::WriteOpenPolyPolygonShape }, { "com.sun.star.drawing.PolyPolygonShape" , &ShapeExport::WriteClosedPolyPolygonShape }, - { "com.sun.star.drawing.PolyLineShape" , &ShapeExport::WriteClosedPolyPolygonShape }, + { "com.sun.star.drawing.PolyLineShape" , &ShapeExport::WriteOpenPolyPolygonShape }, { "com.sun.star.drawing.RectangleShape" , &ShapeExport::WriteRectangleShape }, { "com.sun.star.drawing.OLE2Shape" , &ShapeExport::WriteOLE2Shape }, { "com.sun.star.drawing.TableShape" , &ShapeExport::WriteTableShape }, |