From 00e10ae3189a4407ffb1a48f836cd52dc9a1b6df Mon Sep 17 00:00:00 2001 From: Jochen Nitschke Date: Fri, 12 Oct 2018 20:06:18 +0200 Subject: use range based loops over B2DPolyPolygon in vcl Change-Id: I98f17311822ba50b0c8eaa50fbdef088c76168d4 Reviewed-on: https://gerrit.libreoffice.org/61730 Tested-by: Jenkins Reviewed-by: Julien Nabet --- vcl/quartz/salgdicommon.cxx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'vcl/quartz') diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx index 40ae59121653..65d158f98201 100644 --- a/vcl/quartz/salgdicommon.cxx +++ b/vcl/quartz/salgdicommon.cxx @@ -135,14 +135,12 @@ static void AddPolyPolygonToPath( CGMutablePathRef xPath, bool bPixelSnap, bool bLineDraw ) { // short circuit if there is nothing to do - const int nPolyCount = rPolyPoly.count(); - if( nPolyCount <= 0 ) + if( rPolyPoly.count() == 0 ) { return; } - for( int nPolyIdx = 0; nPolyIdx < nPolyCount; ++nPolyIdx ) + for(auto const& rPolygon : rPolyPoly) { - const basegfx::B2DPolygon rPolygon = rPolyPoly.getB2DPolygon( nPolyIdx ); AddPolygonToPath( xPath, rPolygon, true, bPixelSnap, bLineDraw ); } } @@ -969,8 +967,7 @@ bool AquaSalGraphics::drawPolyPolygon( double fTransparency) { // short circuit if there is nothing to do - const int nPolyCount = rPolyPolygon.count(); - if( nPolyCount <= 0 ) + if( rPolyPolygon.count() == 0 ) return true; // ignore invisible polygons @@ -984,9 +981,8 @@ bool AquaSalGraphics::drawPolyPolygon( // setup poly-polygon path CGMutablePathRef xPath = CGPathCreateMutable(); SAL_INFO( "vcl.cg", "CGPathCreateMutable() = " << xPath ); - for( int nPolyIdx = 0; nPolyIdx < nPolyCount; ++nPolyIdx ) + for(auto const& rPolygon : rPolyPolygon) { - const basegfx::B2DPolygon rPolygon = rPolyPolygon.getB2DPolygon( nPolyIdx ); AddPolygonToPath( xPath, rPolygon, true, !getAntiAliasB2DDraw(), IsPenVisible() ); } -- cgit