From b25eb9f78b55ba10636c56e6723b66939239b3f5 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Mon, 24 Jun 2013 10:37:05 +0200 Subject: n#820504: VML path import fixes: get back missing points nParamsCount was set to the double of the expected value, but the code handling the command only took the first set of parameters. Removing this 2* in nParamsCount. (cherry picked from commit 442ad6eef9d6e1588e4985e97ec3eafd6289f9ae) Conflicts: oox/source/vml/vmlformatting.cxx Change-Id: I2a4bb07fc9167e056a52c7adfbee9e1ef8e2636c --- oox/source/vml/vmlformatting.cxx | 20 ++++++++++---------- oox/source/vml/vmlshape.cxx | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'oox') diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx index 806c62460b25..69d9b3506e54 100644 --- a/oox/source/vml/vmlformatting.cxx +++ b/oox/source/vml/vmlformatting.cxx @@ -318,7 +318,7 @@ void ConversionHelper::decodeVmlPath( ::std::vector< ::std::vector< Point > >& r rPointLists.back().push_back( Point( aCoordList[ 0 ], aCoordList[ 1 ] ) ); rFlagLists.back().push_back( PolygonFlags_NORMAL ); aCurrentPoint = rPointLists.back().back(); - nParamCount = 2 * 2; + nParamCount = 2; break; case MOVE_ABS: // 2 params -> no param count reset @@ -349,7 +349,7 @@ void ConversionHelper::decodeVmlPath( ::std::vector< ::std::vector< Point > >& r rFlagLists.back().push_back( PolygonFlags_CONTROL ); rFlagLists.back().push_back( PolygonFlags_NORMAL ); aCurrentPoint = rPointLists.back().back(); - nParamCount = 2 * 6; + nParamCount = 6; break; case LINE_REL: // 2* params -> param count reset @@ -357,14 +357,14 @@ void ConversionHelper::decodeVmlPath( ::std::vector< ::std::vector< Point > >& r aCurrentPoint.Y + aCoordList[ 1 ] ) ); rFlagLists.back().push_back( PolygonFlags_NORMAL ); aCurrentPoint = rPointLists.back().back(); - nParamCount = 2 * 2; + nParamCount = 2; break; case LINE_ABS: // 2* params -> param count reset rPointLists.back().push_back( Point( aCoordList[ 0 ], aCoordList[ 1 ] ) ); rFlagLists.back().push_back( PolygonFlags_NORMAL ); aCurrentPoint = rPointLists.back().back(); - nParamCount = 2 * 2; + nParamCount = 2; break; case CLOSE: // 0 param @@ -397,17 +397,17 @@ void ConversionHelper::decodeVmlPath( ::std::vector< ::std::vector< Point > >& r { // Single-character commands case 't': // rmoveto - state = MOVE_REL; nParamCount = 2 * 2; break; + state = MOVE_REL; nParamCount = 2; break; case 'm': // moveto - state = MOVE_ABS; nParamCount = 2 * 2; break; + state = MOVE_ABS; nParamCount = 2; break; case 'v': // rcurveto - state = BEZIER_REL; nParamCount = 2 * 6; break; + state = BEZIER_REL; nParamCount = 6; break; case 'c': // curveto - state = BEZIER_ABS; nParamCount = 2 * 6; break; + state = BEZIER_ABS; nParamCount = 6; break; case 'r': // rlineto - state = LINE_REL; nParamCount = 2 * 2; break; + state = LINE_REL; nParamCount = 2; break; case 'l': // lineto - state = LINE_ABS; nParamCount = 2 * 2; break; + state = LINE_ABS; nParamCount = 2; break; case 'x': // close state = CLOSE; break; case 'e': // end diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 4551eee21fa7..1cb47724c140 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -715,7 +715,7 @@ awt::Rectangle LineShape::getRelRectangle() const // ============================================================================ BezierShape::BezierShape(Drawing& rDrawing) - : SimpleShape(rDrawing, "com.sun.star.drawing.OpenBezierShape") // TODO Could we need both Open and Closed? + : SimpleShape(rDrawing, "com.sun.star.drawing.OpenBezierShape") { } -- cgit