summaryrefslogtreecommitdiff
path: root/svx
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 /svx
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 'svx')
-rw-r--r--svx/source/customshapes/EnhancedCustomShape3d.cxx2
-rw-r--r--svx/source/svdraw/svdotextdecomposition.cxx7
2 files changed, 4 insertions, 5 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index 56dd2a18337a..cd2d1c751eba 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -1034,7 +1034,7 @@ rtl::Reference<SdrObject> EnhancedCustomShape3d::Create3DObject(
const Color& rMatColor
= pNext->GetProperties().GetItem(XATTR_FILLCOLOR).GetColorValue();
Color aOldMatColor(rMatColor);
- if (basegfx::fTools::more(fDiffusion, 0.0)
+ if (fDiffusion > 0.0 && !basegfx::fTools::equalZero(fDiffusion)
&& !basegfx::fTools::equal(fDiffusion, 1.0))
{
// Occurs e.g. with MS surface preset 'Metal'.
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index 76e27768224c..21db5c3da4c0 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -1455,7 +1455,6 @@ void SdrTextObj::impDecomposeStretchTextPrimitive(
// timing generators
#define ENDLESS_LOOP (0xffffffff)
#define ENDLESS_TIME (double(0xffffffff))
-#define PIXEL_DPI (96.0)
void SdrTextObj::impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const
{
@@ -1639,12 +1638,12 @@ void SdrTextObj::impGetScrollTextTiming(drawinglayer::animation::AnimationEntryL
fAnimationDelay = 50.0;
}
- if(basegfx::fTools::less(fSingleStepWidth, 0.0))
+ if (fSingleStepWidth < 0.0)
{
- // data is in pixels, convert to logic. Imply PIXEL_DPI dpi.
+ // data is in pixels, convert to logic. Imply 96 dpi.
// It makes no sense to keep the view-transformation centered
// definitions, so get rid of them here.
- fSingleStepWidth = (-fSingleStepWidth * (2540.0 / PIXEL_DPI));
+ fSingleStepWidth = o3tl::convert(-fSingleStepWidth, o3tl::Length::px, o3tl::Length::mm100);
}
if(basegfx::fTools::equalZero(fSingleStepWidth))