From a176d3645722746563f6dda3d9807dbe2cad1b01 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Fri, 21 Jun 2013 10:47:42 +0200 Subject: 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 Tested-by: Fridrich Strba --- oox/source/vml/vmlshape.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'oox') 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( this )->setService( "com.sun.star.drawing.ClosedBezierShape" ); + } + if( (aCoordSys.Width > 0) && (aCoordSys.Height > 0) ) { const GraphicHelper& rGraphicHelper = mrDrawing.getFilter().getGraphicHelper(); -- cgit