filter/source/graphicfilter/icgm/class4.cxx | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-)
New commits: commit 0ba7674c7389db8f1cf7eb089dc1c89ed93be778 Author: Caolán McNamara <[email protected]> AuthorDate: Thu Apr 14 12:26:03 2022 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Fri Apr 15 10:17:00 2022 +0200 ofz: Timeout 23s->4s Change-Id: I10d48584e0ab0ce52cabe8077602f557b6392492 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133012 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/filter/source/graphicfilter/icgm/class4.cxx b/filter/source/graphicfilter/icgm/class4.cxx index 4ef817844570..af66ff26ae09 100644 --- a/filter/source/graphicfilter/icgm/class4.cxx +++ b/filter/source/graphicfilter/icgm/class4.cxx @@ -276,29 +276,21 @@ void CGM::ImplDoClass4() if ( mbFigure ) mpOutAct->CloseRegion(); - sal_uInt16 nPoints = 0; - std::unique_ptr<Point[]> pPoints(new Point[ 0x4000 ]); - + std::vector<Point> aPoints; tools::PolyPolygon aPolyPolygon; FloatPoint aFloatPoint; - sal_uInt32 nEdgeFlag; + while ( mnParaSize < mnElementSize ) { ImplGetPoint( aFloatPoint, true ); - nEdgeFlag = ImplGetUI16(); - pPoints[ nPoints++ ] = Point( static_cast<tools::Long>(aFloatPoint.X), static_cast<tools::Long>(aFloatPoint.Y) ); + sal_uInt32 nEdgeFlag = ImplGetUI16(); + aPoints.push_back(Point(static_cast<tools::Long>(aFloatPoint.X), static_cast<tools::Long>(aFloatPoint.Y))); if ( ( nEdgeFlag & 2 ) || ( mnParaSize == mnElementSize ) ) { - tools::Polygon aPolygon( nPoints ); - for ( sal_uInt16 i = 0; i < nPoints; i++ ) - { - aPolygon.SetPoint( pPoints[ i ], i ); - } - aPolyPolygon.Insert( aPolygon ); - nPoints = 0; + aPolyPolygon.Insert(tools::Polygon(aPoints.size(), aPoints.data())); + aPoints.clear(); } } - pPoints.reset(); mpOutAct->DrawPolyPolygon( aPolyPolygon ); } break;
