diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2013-06-21 10:47:42 +0200 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-06-28 07:16:15 +0000 |
commit | a176d3645722746563f6dda3d9807dbe2cad1b01 (patch) | |
tree | b82bb801074ecbb5cd07599bcb3333f299eea4db /oox | |
parent | 0b8045b8992c366dcc52093a2db2dfc3193bdb78 (diff) |
n#820504: Some imported VML paths are closed, try to detect the
(cherry picked from commit 08db0b22bdce0f779e4af01a209aef1be29e9907)
(cherry picked from commit b516a9b69119b25df8f973b6318f2ae1c7e601df)
Conflicts:
oox/source/vml/vmlshape.cxx
Change-Id: Idefd0277a85bd7b2b727f59cc4e568869b4932a1
Reviewed-on: https://gerrit.libreoffice.org/4584
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/vml/vmlshape.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 35ad93d04731..b77adf64c16c 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -700,7 +700,7 @@ awt::Rectangle LineShape::getRelRectangle() const // ============================================================================ BezierShape::BezierShape(Drawing& rDrawing) - : SimpleShape(rDrawing, "com.sun.star.drawing.OpenBezierShape") + : SimpleShape(rDrawing, "com.sun.star.drawing.OpenBezierShape") // TODO Could we need both Open and Closed? { } @@ -709,6 +709,13 @@ Reference< XShape > BezierShape::implConvertAndInsert( const Reference< XShapes awt::Rectangle aCoordSys = getCoordSystem(); PolyPolygonBezierCoords aBezierCoords; + // If we have an 'x' in the last part of the path it means it is closed... + sal_Int32 nPos = maShapeModel.maVmlPath.lastIndexOf(','); + if ( nPos != -1 && maShapeModel.maVmlPath.copy(nPos).indexOf('x') != -1 ) + { + const_cast<BezierShape*>( this )->setService( "com.sun.star.drawing.ClosedBezierShape" ); + } + if( (aCoordSys.Width > 0) && (aCoordSys.Height > 0) ) { const GraphicHelper& rGraphicHelper = mrDrawing.getFilter().getGraphicHelper(); |