diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-19 10:26:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-19 12:53:42 +0200 |
commit | 3d8400a8d938be7b116298d6a79bb49d7cc0cc99 (patch) | |
tree | c1ae099e540025c1dfa7e6d62f6f6d9e5ce90c12 /basegfx | |
parent | 2e51afc77c0800dda6c09bb645d8962ae125b2ba (diff) |
loplugin:comparisonwithconstant in accessibility..basegfx
re-running this plugin on these modules now that sberg has improved
the plugin.
Change-Id: I1818b1fa540cf62b81219a4f3ed2dcae8ff0e838
Reviewed-on: https://gerrit.libreoffice.org/37805
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basegfx')
-rw-r--r-- | basegfx/source/color/bcolormodifier.cxx | 6 | ||||
-rw-r--r-- | basegfx/source/curve/b2dcubicbezier.cxx | 2 | ||||
-rw-r--r-- | basegfx/source/matrix/b3dhommatrix.cxx | 2 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dlinegeometry.cxx | 4 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dpolygontools.cxx | 14 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dpolypolygoncutter.cxx | 4 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dpolypolygontools.cxx | 6 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dtrapezoid.cxx | 4 | ||||
-rw-r--r-- | basegfx/source/tools/gradienttools.cxx | 4 |
9 files changed, 23 insertions, 23 deletions
diff --git a/basegfx/source/color/bcolormodifier.cxx b/basegfx/source/color/bcolormodifier.cxx index 64941c24dad2..6704f7ea489b 100644 --- a/basegfx/source/color/bcolormodifier.cxx +++ b/basegfx/source/color/bcolormodifier.cxx @@ -35,7 +35,7 @@ namespace basegfx bool BColorModifier_gray::operator==(const BColorModifier& rCompare) const { - return nullptr != dynamic_cast< const BColorModifier_gray* >(&rCompare); + return dynamic_cast< const BColorModifier_gray* >(&rCompare) != nullptr; } ::basegfx::BColor BColorModifier_gray::getModifiedColor(const ::basegfx::BColor& aSourceColor) const @@ -54,7 +54,7 @@ namespace basegfx bool BColorModifier_invert::operator==(const BColorModifier& rCompare) const { - return nullptr != dynamic_cast< const BColorModifier_invert* >(&rCompare); + return dynamic_cast< const BColorModifier_invert* >(&rCompare) != nullptr; } ::basegfx::BColor BColorModifier_invert::getModifiedColor(const ::basegfx::BColor& aSourceColor) const @@ -71,7 +71,7 @@ namespace basegfx bool BColorModifier_luminance_to_alpha::operator==(const BColorModifier& rCompare) const { - return nullptr != dynamic_cast< const BColorModifier_luminance_to_alpha* >(&rCompare); + return dynamic_cast< const BColorModifier_luminance_to_alpha* >(&rCompare) != nullptr; } ::basegfx::BColor BColorModifier_luminance_to_alpha::getModifiedColor(const ::basegfx::BColor& aSourceColor) const diff --git a/basegfx/source/curve/b2dcubicbezier.cxx b/basegfx/source/curve/b2dcubicbezier.cxx index c0f4c6b0cf8e..2b9394e0ff70 100644 --- a/basegfx/source/curve/b2dcubicbezier.cxx +++ b/basegfx/source/curve/b2dcubicbezier.cxx @@ -746,7 +746,7 @@ namespace basegfx } } - if(0.0 == fPosition || 1.0 == fPosition) + if(fPosition == 0.0 || fPosition == 1.0) { // if we are completely left or right, we are done break; diff --git a/basegfx/source/matrix/b3dhommatrix.cxx b/basegfx/source/matrix/b3dhommatrix.cxx index 919a00c9fb50..1a88c8b5c777 100644 --- a/basegfx/source/matrix/b3dhommatrix.cxx +++ b/basegfx/source/matrix/b3dhommatrix.cxx @@ -390,7 +390,7 @@ namespace basegfx return false; // If determinant is zero, decomposition is not possible - if(0.0 == determinant()) + if(determinant() == 0.0) return false; // isolate translation diff --git a/basegfx/source/polygon/b2dlinegeometry.cxx b/basegfx/source/polygon/b2dlinegeometry.cxx index b6829d68d7f5..8ae52d508fd2 100644 --- a/basegfx/source/polygon/b2dlinegeometry.cxx +++ b/basegfx/source/polygon/b2dlinegeometry.cxx @@ -679,7 +679,7 @@ namespace basegfx double fMiterMinimumAngle) { OSL_ENSURE(fHalfLineWidth > 0.0, "createAreaGeometryForJoin: LineWidth too small (!)"); - OSL_ENSURE(B2DLineJoin::NONE != eJoin, "createAreaGeometryForJoin: B2DLineJoin::NONE not allowed (!)"); + OSL_ENSURE(eJoin != B2DLineJoin::NONE, "createAreaGeometryForJoin: B2DLineJoin::NONE not allowed (!)"); // LineJoin from tangent rPerpendPrev to tangent rPerpendEdge in rPoint B2DPolygon aEdgePolygon; @@ -715,7 +715,7 @@ namespace basegfx double fCutPos(0.0); tools::findCut(aStartPoint, rTangentPrev, aEndPoint, rTangentEdge, CutFlagValue::ALL, &fCutPos); - if(0.0 != fCutPos) + if(fCutPos != 0.0) { const B2DPoint aCutPoint(aStartPoint + (rTangentPrev * fCutPos)); aEdgePolygon.append(aCutPoint); diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx index 0b0f1712b54e..e40f17c8a3cb 100644 --- a/basegfx/source/polygon/b2dpolygontools.cxx +++ b/basegfx/source/polygon/b2dpolygontools.cxx @@ -199,7 +199,7 @@ namespace basegfx // add curved edge and generate DistanceBound double fBound(0.0); - if(0.0 == fDistanceBound) + if(fDistanceBound == 0.0) { // If not set, use B2DCubicBezier functionality to guess a rough value const double fRoughLength((aBezier.getEdgeLength() + aBezier.getControlPolygonLength()) / 2.0); @@ -269,7 +269,7 @@ namespace basegfx aRetval.append(aBezier.getStartPoint()); // #i37443# prepare convenient AngleBound if none was given - if(0.0 == fAngleBound) + if(fAngleBound == 0.0) { #ifdef DBG_UTIL fAngleBound = fAngleBoundStartValue; @@ -2392,7 +2392,7 @@ namespace basegfx fEdgeDist = getSmallestDistancePointToEdge(aBezier.getStartPoint(), aBezier.getEndPoint(), rTestPoint, fNewCut); } - if(DBL_MAX == fRetval || fEdgeDist < fRetval) + if(fRetval == DBL_MAX || fEdgeDist < fRetval) { fRetval = fEdgeDist; rEdgeIndex = a; @@ -2457,7 +2457,7 @@ namespace basegfx { const sal_uInt32 nPointCount(rCandidate.count()); - if(nPointCount && 0.0 != rOriginal.getWidth() && 0.0 != rOriginal.getHeight()) + if(nPointCount && rOriginal.getWidth() != 0.0 && rOriginal.getHeight() != 0.0) { B2DPolygon aRetval; @@ -2696,7 +2696,7 @@ namespace basegfx B2DPolygon growInNormalDirection(const B2DPolygon& rCandidate, double fValue) { - if(0.0 != fValue) + if(fValue != 0.0) { if(rCandidate.areControlPointsUsed()) { @@ -3301,7 +3301,7 @@ namespace basegfx B2DPoint aControlB; // first point is not allowed to be a control point - OSL_ENSURE(css::drawing::PolygonFlags_CONTROL != ePolygonFlag, + OSL_ENSURE(ePolygonFlag != css::drawing::PolygonFlags_CONTROL, "UnoPolygonBezierCoordsToB2DPolygon: Start point is a control point, illegal input polygon (!)"); // add first point as start point @@ -3342,7 +3342,7 @@ namespace basegfx // two or no control points are consumed, another one would be an error. // It's also an error if only one control point was read - SAL_WARN_IF(css::drawing::PolygonFlags_CONTROL == ePolygonFlag || bControlA != bControlB, + SAL_WARN_IF(ePolygonFlag == css::drawing::PolygonFlags_CONTROL || bControlA != bControlB, "basegfx", "UnoPolygonBezierCoordsToB2DPolygon: Illegal source polygon (!)"); // the previous writes used the B2DPolyPoygon -> tools::PolyPolygon converter diff --git a/basegfx/source/polygon/b2dpolypolygoncutter.cxx b/basegfx/source/polygon/b2dpolypolygoncutter.cxx index 7bd7ce4a365b..cbd5a50112af 100644 --- a/basegfx/source/polygon/b2dpolypolygoncutter.cxx +++ b/basegfx/source/polygon/b2dpolypolygoncutter.cxx @@ -592,7 +592,7 @@ namespace basegfx { PN& rPN = maPNV[a]; - if(SAL_MAX_UINT32 != rPN.mnI) + if(rPN.mnI != SAL_MAX_UINT32) { // unused node, start new part polygon B2DPolygon aNewPart; @@ -622,7 +622,7 @@ namespace basegfx nCountdown--; pPNCurr = &(maPNV[pPNCurr->mnIN]); } - while(pPNCurr != &rPN && SAL_MAX_UINT32 != pPNCurr->mnI); + while(pPNCurr != &rPN && pPNCurr->mnI != SAL_MAX_UINT32); // close and add aNewPart.setClosed(true); diff --git a/basegfx/source/polygon/b2dpolypolygontools.cxx b/basegfx/source/polygon/b2dpolypolygontools.cxx index c2c1cb25befc..d0353f5640c8 100644 --- a/basegfx/source/polygon/b2dpolypolygontools.cxx +++ b/basegfx/source/polygon/b2dpolypolygontools.cxx @@ -233,7 +233,7 @@ namespace basegfx void applyLineDashing(const B2DPolyPolygon& rCandidate, const std::vector<double>& rDotDashArray, B2DPolyPolygon* pLineTarget, B2DPolyPolygon* pGapTarget, double fFullDashDotLen) { - if(0.0 == fFullDashDotLen && rDotDashArray.size()) + if(fFullDashDotLen == 0.0 && rDotDashArray.size()) { // calculate fFullDashDotLen from rDotDashArray fFullDashDotLen = std::accumulate(rDotDashArray.begin(), rDotDashArray.end(), 0.0); @@ -327,7 +327,7 @@ namespace basegfx double fNewCut(0.0); const double fNewDistance(getSmallestDistancePointToPolygon(aCandidate, rTestPoint, nNewEdgeIndex, fNewCut)); - if(DBL_MAX == fRetval || fNewDistance < fRetval) + if(fRetval == DBL_MAX || fNewDistance < fRetval) { fRetval = fNewDistance; rPolygonIndex = a; @@ -378,7 +378,7 @@ namespace basegfx B2DPolyPolygon growInNormalDirection(const B2DPolyPolygon& rCandidate, double fValue) { - if(0.0 != fValue) + if(fValue != 0.0) { B2DPolyPolygon aRetval; diff --git a/basegfx/source/polygon/b2dtrapezoid.cxx b/basegfx/source/polygon/b2dtrapezoid.cxx index 6d2dad568332..e60bc1fb1ce8 100644 --- a/basegfx/source/polygon/b2dtrapezoid.cxx +++ b/basegfx/source/polygon/b2dtrapezoid.cxx @@ -115,7 +115,7 @@ namespace basegfx // data write access to StartPoint void setStart( const B2DPoint* pNewStart) { - OSL_ENSURE(nullptr != pNewStart, "No null pointer allowed here (!)"); + OSL_ENSURE(pNewStart != nullptr, "No null pointer allowed here (!)"); if(mpStart != pNewStart) { @@ -129,7 +129,7 @@ namespace basegfx // data write access to EndPoint void setEnd( const B2DPoint* pNewEnd) { - OSL_ENSURE(nullptr != pNewEnd, "No null pointer allowed here (!)"); + OSL_ENSURE(pNewEnd != nullptr, "No null pointer allowed here (!)"); if(mpEnd != pNewEnd) { diff --git a/basegfx/source/tools/gradienttools.cxx b/basegfx/source/tools/gradienttools.cxx index 119c900c767a..a3c42a6b7e75 100644 --- a/basegfx/source/tools/gradienttools.cxx +++ b/basegfx/source/tools/gradienttools.cxx @@ -176,7 +176,7 @@ namespace basegfx aTextureTransform.translate(fTargetOffsetX, fTargetOffsetY); // prepare aspect for texture - const double fAspectRatio(0.0 == fTargetSizeY ? 1.0 : (fTargetSizeX / fTargetSizeY)); + const double fAspectRatio(fTargetSizeY == 0.0 ? 1.0 : (fTargetSizeX / fTargetSizeY)); return ODFGradientInfo(aTextureTransform, fAspectRatio, nSteps); } @@ -253,7 +253,7 @@ namespace basegfx aTextureTransform.translate(fTargetOffsetX, fTargetOffsetY); // prepare aspect for texture - const double fAspectRatio(0.0 == fTargetSizeY ? 1.0 : (fTargetSizeX / fTargetSizeY)); + const double fAspectRatio(fTargetSizeY == 0.0 ? 1.0 : (fTargetSizeX / fTargetSizeY)); return ODFGradientInfo(aTextureTransform, fAspectRatio, nSteps); } |