summaryrefslogtreecommitdiff
path: root/basegfx
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2014-12-06 01:07:11 +0100
committerNoel Grandin <noelgrandin@gmail.com>2014-12-08 08:01:58 +0000
commit3338f479182a5face7f143bdc4b9ea9067028887 (patch)
tree1f9ae6785720b3a086a166a906bcb0a7340545d6 /basegfx
parent664e64a1901d84137245c14ecfa9432123238bfa (diff)
reduce scope of local variables
This eliminates some of the warnings from Cppcheck report of 2014-11-29. Change-Id: Id5bf885de12a6de262d2cca9fa71627ac67f50d9 Reviewed-on: https://gerrit.libreoffice.org/13330 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'basegfx')
-rw-r--r--basegfx/source/polygon/b2dpolygonclipper.cxx6
-rw-r--r--basegfx/source/polygon/b3dpolygontools.cxx2
2 files changed, 3 insertions, 5 deletions
diff --git a/basegfx/source/polygon/b2dpolygonclipper.cxx b/basegfx/source/polygon/b2dpolygonclipper.cxx
index 7dc42139b927..73eb7851ce5c 100644
--- a/basegfx/source/polygon/b2dpolygonclipper.cxx
+++ b/basegfx/source/polygon/b2dpolygonclipper.cxx
@@ -586,8 +586,6 @@ namespace basegfx
scissor_plane *pPlane, // scissoring plane
const ::basegfx::B2DRectangle &rR ) // clipping rectangle
{
- ::basegfx::B2DPoint *curr;
- ::basegfx::B2DPoint *next;
sal_uInt32 out_count=0;
@@ -596,8 +594,8 @@ namespace basegfx
// vertices are relative to the coordinate
// system defined by the rectangle.
- curr = &in_vertex[i];
- next = &in_vertex[(i+1)%in_count];
+ ::basegfx::B2DPoint *curr = &in_vertex[i];
+ ::basegfx::B2DPoint *next = &in_vertex[(i+1)%in_count];
// perform clipping judgement & mask against current plane.
sal_uInt32 clip = pPlane->clipmask & ((getCohenSutherlandClipFlags(*curr,rR)<<4)|getCohenSutherlandClipFlags(*next,rR));
diff --git a/basegfx/source/polygon/b3dpolygontools.cxx b/basegfx/source/polygon/b3dpolygontools.cxx
index 8f3e9c8b74ec..1ca3820d5f6e 100644
--- a/basegfx/source/polygon/b3dpolygontools.cxx
+++ b/basegfx/source/polygon/b3dpolygontools.cxx
@@ -136,13 +136,13 @@ namespace basegfx
for(sal_uInt32 a(0); a < nEdgeCount; a++)
{
// update current edge
- double fLastDotDashMovingLength(0.0);
const sal_uInt32 nNextIndex((a + 1) % nPointCount);
const B3DPoint aNextPoint(rCandidate.getB3DPoint(nNextIndex));
const double fEdgeLength(B3DVector(aNextPoint - aCurrentPoint).getLength());
if(!fTools::equalZero(fEdgeLength))
{
+ double fLastDotDashMovingLength(0.0);
while(fTools::less(fDotDashMovingLength, fEdgeLength))
{
// new split is inside edge, create and append snippet [fLastDotDashMovingLength, fDotDashMovingLength]