Some cppcheck cleaning

Change-Id: I7a5f34715faecd689900b5d41eae9c782e99b47b
This commit is contained in:
Julien Nabet
2012-06-06 22:40:37 +02:00
parent 633178bffa
commit c9e4cc2793
6 changed files with 10 additions and 10 deletions

View File

@@ -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));

View File

@@ -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

View File

@@ -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

View File

@@ -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);

View File

@@ -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,

View File

@@ -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 );