summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-08-02 11:33:14 +0500
committerMike Kaganski <mike.kaganski@collabora.com>2024-08-02 11:31:00 +0200
commit8bd57009d38f7551a77566a0e782a7b371aece23 (patch)
tree609d4d28392ff542138dd8bd0d030a014f29847b /oox
parentcfd3b14fd4e1ee889dd356523e5cdaa639786d37 (diff)
Fix wrong / misleading uses of fTools::(more|less|equal) with literal 0
These will never compare with tolerance (the zero is a special case in rtl_math_approxEqual used internally), so the calls like those don't do what they appear to do in these cases. Change-Id: I495ac92b7f45637e118e4fdc04bb6fad6fff31ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171391 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'oox')
-rw-r--r--oox/qa/unit/shape.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/oox/qa/unit/shape.cxx b/oox/qa/unit/shape.cxx
index 28266b8783c6..929fecc64a7c 100644
--- a/oox/qa/unit/shape.cxx
+++ b/oox/qa/unit/shape.cxx
@@ -590,7 +590,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testWriterFontwork3)
aColorStops = model::gradient::getColorStopsFromUno(aGradient.ColorStops);
CPPUNIT_ASSERT_EQUAL(size_t(2), aColorStops.size());
- CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0));
+ CPPUNIT_ASSERT_EQUAL(0.0, aColorStops[0].getStopOffset());
CPPUNIT_ASSERT_EQUAL(COL_LIGHTBLUE, Color(aColorStops[0].getStopColor()));
CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 1.0));
CPPUNIT_ASSERT_EQUAL(Color(0xf79646), Color(aColorStops[1].getStopColor()));
@@ -638,7 +638,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testWriterFontwork3)
aColorStops = model::gradient::getColorStopsFromUno(aGradient.ColorStops);
CPPUNIT_ASSERT_EQUAL(size_t(2), aColorStops.size());
- CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0));
+ CPPUNIT_ASSERT_EQUAL(0.0, aColorStops[0].getStopOffset());
CPPUNIT_ASSERT_EQUAL(Color(0xf79646), Color(aColorStops[0].getStopColor()));
CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 1.0));
CPPUNIT_ASSERT_EQUAL(COL_LIGHTBLUE, Color(aColorStops[1].getStopColor()));
@@ -762,7 +762,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testImportWordArtGradient)
aColorStops = model::gradient::getColorStopsFromUno(aGradient.ColorStops);
CPPUNIT_ASSERT_EQUAL(size_t(2), aColorStops.size());
- CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0));
+ CPPUNIT_ASSERT_EQUAL(0.0, aColorStops[0].getStopOffset());
CPPUNIT_ASSERT_EQUAL(Color(0xffc000), Color(aColorStops[0].getStopColor()));
CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 1.0));
CPPUNIT_ASSERT_EQUAL(Color(0xc00000), Color(aColorStops[1].getStopColor()));
@@ -794,7 +794,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testImportWordArtGradient)
aColorStops = model::gradient::getColorStopsFromUno(aGradient.ColorStops);
CPPUNIT_ASSERT_EQUAL(size_t(2), aColorStops.size());
- CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0));
+ CPPUNIT_ASSERT_EQUAL(0.0, aColorStops[0].getStopOffset());
CPPUNIT_ASSERT_EQUAL(Color(0x0083e0), Color(aColorStops[0].getStopColor()));
CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 1.0));
CPPUNIT_ASSERT_EQUAL(Color(0xe6e600), Color(aColorStops[1].getStopColor()));
@@ -809,7 +809,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testImportWordArtGradient)
// Transparency is encoded in gray color.
CPPUNIT_ASSERT_EQUAL(size_t(2), aColorStops.size());
- CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0));
+ CPPUNIT_ASSERT_EQUAL(0.0, aColorStops[0].getStopOffset());
CPPUNIT_ASSERT_EQUAL(COL_GRAY7, Color(aColorStops[0].getStopColor()));
CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 1.0));
CPPUNIT_ASSERT_EQUAL(Color(0x4d4d4d), Color(aColorStops[1].getStopColor()));
@@ -846,7 +846,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testImportWordArtGradient)
aColorStops = model::gradient::getColorStopsFromUno(aGradient.ColorStops);
CPPUNIT_ASSERT_EQUAL(size_t(2), aColorStops.size());
- CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0));
+ CPPUNIT_ASSERT_EQUAL(0.0, aColorStops[0].getStopOffset());
CPPUNIT_ASSERT_EQUAL(Color(0x4472c4), Color(aColorStops[0].getStopColor()));
CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 1.0));
CPPUNIT_ASSERT_EQUAL(Color(0x4472c4), Color(aColorStops[1].getStopColor()));
@@ -861,7 +861,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testImportWordArtGradient)
// Transparency is encoded in gray color.
CPPUNIT_ASSERT_EQUAL(size_t(2), aColorStops.size());
- CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0));
+ CPPUNIT_ASSERT_EQUAL(0.0, aColorStops[0].getStopOffset());
CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aColorStops[0].getStopColor()));
CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 1.0));
CPPUNIT_ASSERT_EQUAL(COL_WHITE, Color(aColorStops[1].getStopColor()));