summaryrefslogtreecommitdiff
path: root/basegfx
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2012-06-06 22:40:37 +0200
committerJulien Nabet <serval2412@yahoo.fr>2012-06-06 22:41:07 +0200
commitc9e4cc279371a87495bfbc7c52f56686f9ab42c9 (patch)
tree4873a45c425c980404253267c981524ed00cbe7d /basegfx
parent633178bffaf23ae322060e2c304c9c2cf12b46cc (diff)
Some cppcheck cleaning
Change-Id: I7a5f34715faecd689900b5d41eae9c782e99b47b
Diffstat (limited to 'basegfx')
-rw-r--r--basegfx/source/polygon/b2dlinegeometry.cxx2
-rw-r--r--basegfx/source/polygon/b2dpolygoncutandtouch.cxx4
-rw-r--r--basegfx/source/polygon/b2dpolygontools.cxx2
-rw-r--r--basegfx/source/polygon/b2dpolypolygoncutter.cxx4
-rw-r--r--basegfx/source/range/b2drangeclipper.cxx5
-rw-r--r--basegfx/source/workbench/bezierclip.cxx3
6 files changed, 10 insertions, 10 deletions
diff --git a/basegfx/source/polygon/b2dlinegeometry.cxx b/basegfx/source/polygon/b2dlinegeometry.cxx
index cf28c909a87a..b68cd6fe2a66 100644
--- a/basegfx/source/polygon/b2dlinegeometry.cxx
+++ b/basegfx/source/polygon/b2dlinegeometry.cxx
@@ -619,7 +619,6 @@ namespace basegfx
if(nPointCount)
{
B2DPolyPolygon aRetval;
- const bool bEventuallyCreateLineJoin(B2DLINEJOIN_NONE != eJoin);
const bool bIsClosed(aCandidate.isClosed());
const sal_uInt32 nEdgeCount(bIsClosed ? nPointCount : nPointCount - 1);
@@ -628,6 +627,7 @@ namespace basegfx
B2DCubicBezier aEdge;
B2DCubicBezier aPrev;
+ const bool bEventuallyCreateLineJoin(B2DLINEJOIN_NONE != eJoin);
// prepare edge
aEdge.setStartPoint(aCandidate.getB2DPoint(0));
diff --git a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
index 73a01be154d2..ca3f7c6fcdad 100644
--- a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
+++ b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
@@ -563,7 +563,6 @@ namespace basegfx
{
rCandidate.getBezierSegment(b, aCubicB);
aCubicB.testAndSolveTrivialBezier();
- const bool bEdgeBIsCurve(aCubicB.isBezier());
const B2DRange aRangeB(aCubicB.getRange());
// only overlapping segments need to be tested
@@ -575,6 +574,7 @@ namespace basegfx
bOverlap = aRangeA.overlapsMore(aRangeB);
if( bOverlap)
{
+ const bool bEdgeBIsCurve(aCubicB.isBezier());
if(bEdgeAIsCurve && bEdgeBIsCurve)
{
// test for bezier-bezier cuts
@@ -816,7 +816,6 @@ namespace basegfx
{
rCandidateB.getBezierSegment(b, aCubicB);
aCubicB.testAndSolveTrivialBezier();
- const bool bEdgeBIsCurve(aCubicB.isBezier());
const B2DRange aRangeB(aCubicB.getRange());
// consecutive segments touch of course
@@ -827,6 +826,7 @@ namespace basegfx
bOverlap = aRangeA.overlapsMore(aRangeB);
if( bOverlap)
{
+ const bool bEdgeBIsCurve(aCubicB.isBezier());
if(bEdgeAIsCurve && bEdgeBIsCurve)
{
// test for bezier-bezier cuts
diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx
index babc779e2144..baae69a3ab62 100644
--- a/basegfx/source/polygon/b2dpolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolygontools.cxx
@@ -3066,10 +3066,10 @@ namespace basegfx
}
const bool bHasWidth(!fTools::equalZero(fWaveWidth));
- const bool bHasHeight(!fTools::equalZero(fWaveHeight));
if(bHasWidth)
{
+ const bool bHasHeight(!fTools::equalZero(fWaveHeight));
if(bHasHeight)
{
// width and height, create waveline. First subdivide to reduce input to line segments
diff --git a/basegfx/source/polygon/b2dpolypolygoncutter.cxx b/basegfx/source/polygon/b2dpolypolygoncutter.cxx
index b5a0868f250b..522bc3701556 100644
--- a/basegfx/source/polygon/b2dpolypolygoncutter.cxx
+++ b/basegfx/source/polygon/b2dpolypolygoncutter.cxx
@@ -903,7 +903,7 @@ namespace basegfx
// first step: prepareForPolygonOperation and simple merge of non-overlapping
// PolyPolygons for speedup; this is possible for the wanted OR-operation
- if(aInput.size())
+ if(!aInput.empty())
{
std::vector< basegfx::B2DPolyPolygon > aResult;
aResult.reserve(aInput.size());
@@ -912,7 +912,7 @@ namespace basegfx
{
const basegfx::B2DPolyPolygon aCandidate(prepareForPolygonOperation(aInput[a]));
- if(aResult.size())
+ if(!aResult.empty())
{
const B2DRange aCandidateRange(aCandidate.getB2DRange());
bool bCouldMergeSimple(false);
diff --git a/basegfx/source/range/b2drangeclipper.cxx b/basegfx/source/range/b2drangeclipper.cxx
index 1deede8fc967..273b4ab70b92 100644
--- a/basegfx/source/range/b2drangeclipper.cxx
+++ b/basegfx/source/range/b2drangeclipper.cxx
@@ -329,11 +329,10 @@ namespace basegfx
// unconditionally
append(aIntersectionPoint);
- const bool isSweepLineEnteringRect(
- rEvent.getEdgeType() == SweepLineEvent::STARTING_EDGE);
if( isFinishingEdge )
{
- if( isSweepLineEnteringRect )
+ // isSweepLineEnteringRect ?
+ if( rEvent.getEdgeType() == SweepLineEvent::STARTING_EDGE)
handleFinalOwnRightEdge(rActiveEdge);
else
handleFinalOwnLeftEdge(rActiveEdge,
diff --git a/basegfx/source/workbench/bezierclip.cxx b/basegfx/source/workbench/bezierclip.cxx
index 2070e760c7c0..68c8e3f83a60 100644
--- a/basegfx/source/workbench/bezierclip.cxx
+++ b/basegfx/source/workbench/bezierclip.cxx
@@ -232,7 +232,7 @@ bool Impl_calcSafeParams( double& t1,
{
// calc intersection of convex hull segment with
// one of the horizontal bounds lines
- const double r_x( p1.x - p0.x );
+ // to optimize a bit, r_x is calculated only in else case
const double r_y( p1.y - p0.y );
if( tolZero(r_y) )
@@ -252,6 +252,7 @@ bool Impl_calcSafeParams( double& t1,
{
// check against lower and higher bounds
// =====================================
+ const double r_x( p1.x - p0.x );
// calc intersection with horizontal dMin line
const double currTLow( (lowerYBound - p0.y) * r_x / r_y + p0.x );