summaryrefslogtreecommitdiff
path: root/vcl/source/filter/sgvspln.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-01-25 13:33:17 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-01-28 06:43:39 +0000
commit556ce647aacc635ea05bd6d6e030d93d341b5624 (patch)
tree457e37642e98f5ff6616ec7c6de2b960494112c4 /vcl/source/filter/sgvspln.cxx
parenteea67332da825306abd3e49450850abb323eb91c (diff)
loplugin:fpcomparison in vcl/
Change-Id: I29f8c2c0f19e2440565f5300deffc412faa5870e Reviewed-on: https://gerrit.libreoffice.org/21775 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/source/filter/sgvspln.cxx')
-rw-r--r--vcl/source/filter/sgvspln.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/vcl/source/filter/sgvspln.cxx b/vcl/source/filter/sgvspln.cxx
index 84e65e3316e8..40f168ac614f 100644
--- a/vcl/source/filter/sgvspln.cxx
+++ b/vcl/source/filter/sgvspln.cxx
@@ -19,6 +19,7 @@
#include <tools/poly.hxx>
#include <memory>
+#include <rtl/math.hxx>
#include <sgvspln.hxx>
#include <cmath>
@@ -498,7 +499,7 @@ sal_uInt16 PeriodicSpline(sal_uInt16 n, double* x, double* y,
if (n<2) return 4;
nm1=n-1;
for (i=0;i<=nm1;i++) if (x[i+1]<=x[i]) return 2; // should be strictly monotonically decreasing!
- if (y[n]!=y[0]) return 3; // begin and end should be equal!
+ if (!rtl::math::approxEqual(y[n],y[0])) return 3; // begin and end should be equal!
a.reset(new double[n+1]);
lowrow.reset(new double[n+1]);
@@ -577,8 +578,8 @@ sal_uInt16 ParaSpline(sal_uInt16 n, double* x, double* y, sal_uInt8 MargCond,
alphY=Marg02; betY=MargN2;
} break;
case 3: {
- if (x[n]!=x[0]) return 3;
- if (y[n]!=y[0]) return 4;
+ if (!rtl::math::approxEqual(x[n],x[0])) return 3;
+ if (!rtl::math::approxEqual(y[n],y[0])) return 4;
} break;
case 4: {
if (std::abs(Marg01)>=MAXROOT) {