From 0ba7674c7389db8f1cf7eb089dc1c89ed93be778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 14 Apr 2022 12:26:03 +0100 Subject: [PATCH] ofz: Timeout 23s->4s MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I10d48584e0ab0ce52cabe8077602f557b6392492 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133012 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- filter/source/graphicfilter/icgm/class4.cxx | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) 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 pPoints(new Point[ 0x4000 ]); - + std::vector aPoints; tools::PolyPolygon aPolyPolygon; FloatPoint aFloatPoint; - sal_uInt32 nEdgeFlag; + while ( mnParaSize < mnElementSize ) { ImplGetPoint( aFloatPoint, true ); - nEdgeFlag = ImplGetUI16(); - pPoints[ nPoints++ ] = Point( static_cast(aFloatPoint.X), static_cast(aFloatPoint.Y) ); + sal_uInt32 nEdgeFlag = ImplGetUI16(); + aPoints.push_back(Point(static_cast(aFloatPoint.X), static_cast(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;