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-12 13:10:21 +0200 |
commit | f4a660c38471daa35db2dcfa69fb3ebe56d599b9 (patch) | |
tree | 339ddb4573c47b33f0e65c754fd0a27493a8429b /oox | |
parent | 13152ad88b24cadc836a829b4424a72a152ca9b1 (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>
(cherry picked from commit 3feaff84fafc23c26ff9c6a716709f17a6c8330b)
Reviewed-on: https://gerrit.libreoffice.org/77229
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
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 38320242c3ce..b49ccfce21d2 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -3127,7 +3127,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. @@ -3197,6 +3197,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 b36ebb26f67f..80de09f97a76 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -418,7 +418,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"); @@ -452,7 +452,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 ) @@ -840,7 +840,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) { @@ -1437,7 +1437,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 }, |