oox/source/vml/vmlformatting.cxx | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
New commits: commit e3dc0612e1e75e53c0483755c6dc2d47db938c91 Author: Caolán McNamara <[email protected]> Date: Tue Nov 28 09:06:02 2017 +0000 ofz: ensure aCoordList has required elements Change-Id: I6687f7e499907f2f44ade2b05b35e40570dabc6b Reviewed-on: https://gerrit.libreoffice.org/45391 Tested-by: Jenkins <[email protected]> Reviewed-by: Michael Stahl <[email protected]> diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx index 2cbb4ca24fca..a5d75346284d 100644 --- a/oox/source/vml/vmlformatting.cxx +++ b/oox/source/vml/vmlformatting.cxx @@ -311,7 +311,8 @@ void ConversionHelper::decodeVmlPath( ::std::vector< ::std::vector< Point > >& r { switch ( state ) { - case MOVE_REL: // 2* params -> param count reset + case MOVE_REL: + aCoordList.resize(2, 0); // 2* params -> param count reset if ( rPointLists.size() > 0 && rPointLists.back().size() > 0 ) { rPointLists.push_back( ::std::vector< Point >() ); @@ -323,18 +324,20 @@ void ConversionHelper::decodeVmlPath( ::std::vector< ::std::vector< Point > >& r nParamCount = 2; break; - case MOVE_ABS: // 2 params -> no param count reset + case MOVE_ABS: + aCoordList.resize(2, 0); // 2 params -> no param count reset if ( rPointLists.size() > 0 && rPointLists.back().size() > 0 ) { rPointLists.push_back( ::std::vector< Point >() ); rFlagLists.push_back( ::std::vector< PolygonFlags >() ); } - rPointLists.back().push_back( Point( (aCoordList[ 0 ]), (aCoordList.size() > 1 ? aCoordList[ 1 ] : 0) ) ); + rPointLists.back().push_back( Point( (aCoordList[ 0 ]), aCoordList[ 1 ] ) ); rFlagLists.back().push_back( PolygonFlags_NORMAL ); aCurrentPoint = rPointLists.back().back(); break; - case BEZIER_REL: // 6* params -> param count reset + case BEZIER_REL: + aCoordList.resize(6, 0); // 6* params -> param count reset rPointLists.back().push_back( Point( aCurrentPoint.X + aCoordList[ 0 ], aCurrentPoint.Y + aCoordList[ 1 ] ) ); rPointLists.back().push_back( Point( aCurrentPoint.X + aCoordList[ 2 ], @@ -348,7 +351,8 @@ void ConversionHelper::decodeVmlPath( ::std::vector< ::std::vector< Point > >& r nParamCount = 6; break; - case BEZIER_ABS: // 6* params -> param count reset + case BEZIER_ABS: + aCoordList.resize(6, 0); // 6* params -> param count reset rPointLists.back().push_back( Point( aCoordList[ 0 ], aCoordList[ 1 ] ) ); rPointLists.back().push_back( Point( aCoordList[ 2 ], aCoordList[ 3 ] ) ); rPointLists.back().push_back( Point( aCoordList[ 4 ], aCoordList[ 5 ] ) ); @@ -359,7 +363,8 @@ void ConversionHelper::decodeVmlPath( ::std::vector< ::std::vector< Point > >& r nParamCount = 6; break; - case LINE_REL: // 2* params -> param count reset + case LINE_REL: + aCoordList.resize(2, 0); // 2* params -> param count reset rPointLists.back().push_back( Point( aCurrentPoint.X + aCoordList[ 0 ], aCurrentPoint.Y + aCoordList[ 1 ] ) ); rFlagLists.back().push_back( PolygonFlags_NORMAL ); @@ -367,8 +372,9 @@ void ConversionHelper::decodeVmlPath( ::std::vector< ::std::vector< Point > >& r nParamCount = 2; break; - case LINE_ABS: // 2* params -> param count reset - rPointLists.back().push_back( Point( aCoordList[ 0 ], (aCoordList.size() > 1 ? aCoordList[ 1 ] : 0) ) ); + case LINE_ABS: + aCoordList.resize(2, 0); // 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;
_______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
