From c70b00820ec46035e50c7922876c5423c2f5f936 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Wed, 18 Nov 2020 08:59:57 +0300 Subject: Reduce variable scope Change-Id: Ie1adad9228c4eadbe0d314c0dc27057e84cd721a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106037 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- tools/source/generic/poly.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index a88a9fd9ec00..73531236f522 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -1606,7 +1606,6 @@ bool Polygon::IsEqual( const tools::Polygon& rPoly ) const SvStream& ReadPolygon( SvStream& rIStream, tools::Polygon& rPoly ) { - sal_uInt16 i; sal_uInt16 nPoints(0); // read all points and create array @@ -1621,7 +1620,7 @@ SvStream& ReadPolygon( SvStream& rIStream, tools::Polygon& rPoly ) rPoly.mpImplPolygon->ImplSetSize( nPoints, false ); - for (i = 0; i < nPoints; i++) + for (sal_uInt16 i = 0; i < nPoints; i++) { sal_Int32 nTmpX(0), nTmpY(0); rIStream.ReadInt32(nTmpX).ReadInt32(nTmpY); @@ -1634,13 +1633,12 @@ SvStream& ReadPolygon( SvStream& rIStream, tools::Polygon& rPoly ) SvStream& WritePolygon( SvStream& rOStream, const tools::Polygon& rPoly ) { - sal_uInt16 i; sal_uInt16 nPoints = rPoly.GetSize(); // Write number of points rOStream.WriteUInt16( nPoints ); - for (i = 0; i < nPoints; i++) + for (sal_uInt16 i = 0; i < nPoints; i++) { rOStream.WriteInt32(rPoly.mpImplPolygon->mxPointAry[i].X()) .WriteInt32(rPoly.mpImplPolygon->mxPointAry[i].Y()); -- cgit v1.2.3