summaryrefslogtreecommitdiff
path: root/basegfx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-10-06 17:26:44 +0200
committerEike Rathke <erack@redhat.com>2016-10-06 20:55:28 +0000
commita5442b696697e4a24566b1f5b7e5c9bc77a9fd03 (patch)
tree989ed9b2f781fae584a03392b138e4e7dd27fae3 /basegfx
parentff085ed8fd6438d855526a8a4d699960e4d3cc73 (diff)
rtl::math::approxEqual(value,0.0) never yields true for value!=0.0
... so replace with a simple value == 0.0 also in other modules than sc. Change-Id: Ie7316505a1cf9c15100114b45d300facceb03b7e Reviewed-on: https://gerrit.libreoffice.org/29575 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'basegfx')
-rw-r--r--basegfx/source/polygon/b2dlinegeometry.cxx2
-rw-r--r--basegfx/source/polygon/b2dpolygontools.cxx14
-rw-r--r--basegfx/source/polygon/b2dpolypolygontools.cxx4
-rw-r--r--basegfx/source/polygon/b2dsvgpolypolygon.cxx2
-rw-r--r--basegfx/source/tools/gradienttools.cxx4
5 files changed, 13 insertions, 13 deletions
diff --git a/basegfx/source/polygon/b2dlinegeometry.cxx b/basegfx/source/polygon/b2dlinegeometry.cxx
index 574c9c1b31d6..1b5b7be6da61 100644
--- a/basegfx/source/polygon/b2dlinegeometry.cxx
+++ b/basegfx/source/polygon/b2dlinegeometry.cxx
@@ -715,7 +715,7 @@ namespace basegfx
double fCutPos(0.0);
tools::findCut(aStartPoint, rTangentPrev, aEndPoint, rTangentEdge, CutFlagValue::ALL, &fCutPos);
- if(!rtl::math::approxEqual(0.0, fCutPos))
+ if(0.0 != fCutPos)
{
const B2DPoint aCutPoint(aStartPoint + (rTangentPrev * fCutPos));
aEdgePolygon.append(aCutPoint);
diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx
index dac94db082ef..d47366827296 100644
--- a/basegfx/source/polygon/b2dpolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolygontools.cxx
@@ -200,7 +200,7 @@ namespace basegfx
// add curved edge and generate DistanceBound
double fBound(0.0);
- if(rtl::math::approxEqual(0.0, fDistanceBound))
+ if(0.0 == fDistanceBound)
{
// If not set, use B2DCubicBezier functionality to guess a rough value
const double fRoughLength((aBezier.getEdgeLength() + aBezier.getControlPolygonLength()) / 2.0);
@@ -270,7 +270,7 @@ namespace basegfx
aRetval.append(aBezier.getStartPoint());
// #i37443# prepare convenient AngleBound if none was given
- if(rtl::math::approxEqual(0.0, fAngleBound))
+ if(0.0 == fAngleBound)
{
#ifdef DBG_UTIL
fAngleBound = fAngleBoundStartValue;
@@ -2187,7 +2187,7 @@ namespace basegfx
// tdf#88352 increase numerical correctness and use rtl::math::approxEqual
// instead of fTools::equalZero which compares with a fixed small value
- if(rtl::math::approxEqual(fCrossA, 0.0))
+ if(fCrossA == 0.0)
{
// one point on the line
return bWithLine;
@@ -2197,7 +2197,7 @@ namespace basegfx
const double fCrossB(aLineVector.cross(aVectorToB));
// increase numerical correctness
- if(rtl::math::approxEqual(fCrossB, 0.0))
+ if(fCrossB == 0.0)
{
// one point on the line
return bWithLine;
@@ -2234,7 +2234,7 @@ namespace basegfx
/// return 0 for input of 0, -1 for negative and 1 for positive input
inline int lcl_sgn( const double n )
{
- return rtl::math::approxEqual(n, 0.0) ? 0 : 1 - 2*int(rtl::math::isSignBitSet(n));
+ return n == 0.0 ? 0 : 1 - 2*int(rtl::math::isSignBitSet(n));
}
}
@@ -2530,7 +2530,7 @@ namespace basegfx
{
const sal_uInt32 nPointCount(rCandidate.count());
- if(nPointCount && !rtl::math::approxEqual(0.0, rOriginal.getWidth()) && !rtl::math::approxEqual(0.0, rOriginal.getHeight()))
+ if(nPointCount && 0.0 != rOriginal.getWidth() && 0.0 != rOriginal.getHeight())
{
B2DPolygon aRetval;
@@ -2769,7 +2769,7 @@ namespace basegfx
B2DPolygon growInNormalDirection(const B2DPolygon& rCandidate, double fValue)
{
- if(!rtl::math::approxEqual(0.0, fValue))
+ if(0.0 != fValue)
{
if(rCandidate.areControlPointsUsed())
{
diff --git a/basegfx/source/polygon/b2dpolypolygontools.cxx b/basegfx/source/polygon/b2dpolypolygontools.cxx
index 5afd298d3fa5..0c50e527458c 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(rtl::math::approxEqual(0.0, fFullDashDotLen) && rDotDashArray.size())
+ if(0.0 == fFullDashDotLen && rDotDashArray.size())
{
// calculate fFullDashDotLen from rDotDashArray
fFullDashDotLen = ::std::accumulate(rDotDashArray.begin(), rDotDashArray.end(), 0.0);
@@ -378,7 +378,7 @@ namespace basegfx
B2DPolyPolygon growInNormalDirection(const B2DPolyPolygon& rCandidate, double fValue)
{
- if(!rtl::math::approxEqual(0.0, fValue))
+ if(0.0 != fValue)
{
B2DPolyPolygon aRetval;
diff --git a/basegfx/source/polygon/b2dsvgpolypolygon.cxx b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
index 812cd02a8ada..7504edc9825c 100644
--- a/basegfx/source/polygon/b2dsvgpolypolygon.cxx
+++ b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
@@ -473,7 +473,7 @@ namespace basegfx
if( rtl::math::approxEqual(nX, nLastX) && rtl::math::approxEqual(nY, nLastY) )
continue; // start==end -> skip according to SVG spec
- if( rtl::math::approxEqual(fRX, 0.0) || rtl::math::approxEqual(fRY, 0.0) )
+ if( fRX == 0.0 || fRY == 0.0 )
{
// straight line segment according to SVG spec
aCurrPoly.append(B2DPoint(nX, nY));
diff --git a/basegfx/source/tools/gradienttools.cxx b/basegfx/source/tools/gradienttools.cxx
index e8f2f3091d4f..119c900c767a 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(rtl::math::approxEqual(0.0, fTargetSizeY) ? 1.0 : (fTargetSizeX / fTargetSizeY));
+ const double fAspectRatio(0.0 == fTargetSizeY ? 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(rtl::math::approxEqual(0.0, fTargetSizeY) ? 1.0 : (fTargetSizeX / fTargetSizeY));
+ const double fAspectRatio(0.0 == fTargetSizeY ? 1.0 : (fTargetSizeX / fTargetSizeY));
return ODFGradientInfo(aTextureTransform, fAspectRatio, nSteps);
}