diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-10-14 02:51:05 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-10-15 06:49:23 +0000 |
commit | b4b7703e4335460cf48bfd6440f116359994c8ff (patch) | |
tree | 66b6ab43d6fb13d037160d7384d1a7a93d92940b /tools/source/generic | |
parent | 90d82f73b89d8a0b0b13d224dbd1a741a10a7fd9 (diff) |
cppcheck:variableScope
Change-Id: I9b671637fbe0f32e695d22b74bfb40a39a9fe884
Reviewed-on: https://gerrit.libreoffice.org/19364
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'tools/source/generic')
-rw-r--r-- | tools/source/generic/poly.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 727943dde023..f5cf0dfd46d0 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -637,7 +637,6 @@ Polygon::Polygon( const Point& rCenter, long nRadX, long nRadY, sal_uInt16 nPoin // Ceil number of points until divisible by four mpImplPolygon = new ImplPolygon( nPoints = (nPoints + 3) & ~3 ); - Point* pPt; sal_uInt16 i; sal_uInt16 nPoints2 = nPoints >> 1; sal_uInt16 nPoints4 = nPoints >> 2; @@ -649,7 +648,7 @@ Polygon::Polygon( const Point& rCenter, long nRadX, long nRadY, sal_uInt16 nPoin long nX = FRound( nRadX * cos( nAngle ) ); long nY = FRound( -nRadY * sin( nAngle ) ); - pPt = &(mpImplPolygon->mpPointAry[i]); + Point* pPt = &(mpImplPolygon->mpPointAry[i]); pPt->X() = nX + rCenter.X(); pPt->Y() = nY + rCenter.Y(); pPt = &(mpImplPolygon->mpPointAry[nPoints2-i-1]); @@ -750,7 +749,7 @@ Polygon::Polygon( const Point& rBezPt1, const Point& rCtrlPt1, const double fInc = 1.0 / ( nPoints - 1 ); double fK_1 = 0.0, fK1_1 = 1.0; - double fK_2, fK_3, fK1_2, fK1_3, fK12, fK21; + double fK_2, fK_3, fK1_2, fK1_3; const double fX0 = rBezPt1.X(); const double fY0 = rBezPt1.Y(); const double fX1 = 3.0 * rCtrlPt1.X(); @@ -768,7 +767,8 @@ Polygon::Polygon( const Point& rBezPt1, const Point& rCtrlPt1, fK_2 = fK_1, fK_3 = ( fK_2 *= fK_1 ), fK_3 *= fK_1; fK1_2 = fK1_1, fK1_3 = ( fK1_2 *= fK1_1 ), fK1_3 *= fK1_1; - fK12 = fK_1 * fK1_2, fK21 = fK_2 * fK1_1; + double fK12 = fK_1 * fK1_2; + double fK21 = fK_2 * fK1_1; rPt.X() = FRound( fK1_3 * fX0 + fK12 * fX1 + fK21 * fX2 + fK_3 * fX3 ); rPt.Y() = FRound( fK1_3 * fY0 + fK12 * fY1 + fK21 * fY2 + fK_3 * fY3 ); |