diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-11-16 16:07:30 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-11-16 21:43:09 +0100 |
commit | 50d3ad9127aaf63afcfa299adcea060c9b09faa4 (patch) | |
tree | af3bf48ae8e31e180003c9f998831dd7777d1f5b /sd | |
parent | cd4a239063a77d49fe178255c20f0558e337a82f (diff) |
Instead of labs, use overloaded abs
...more likely to pick an appropriate version for the involved integer types,
esp. after the recent long -> tools::Long changes
Change-Id: Ia91259ca35aaf74b0e907de6831fc926f30057f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105949
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsClipboard.cxx | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index fba5f93f5499..4c7dc3d0eb42 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -41,6 +41,8 @@ #include <sdpage.hxx> #include <cfloat> +#include <cstdlib> + #include <rtl/character.hxx> using namespace css; @@ -2695,14 +2697,14 @@ void SdOOXMLExportTest2::testTdf1225573_FontWorkScaleX() awt::Rectangle aBoundRectArch; xShapeArchProps->getPropertyValue(UNO_NAME_MISC_OBJ_BOUNDRECT) >>= aBoundRectArch; // difference should be zero, but allow some range for stroke thickness - CPPUNIT_ASSERT_LESS(50L, labs(aBoundRectArch.Width - 13081)); + CPPUNIT_ASSERT_LESS(sal_Int32(50), std::abs(aBoundRectArch.Width - 13081)); // Error was, that text in shapes of category "Warp" was not scaled to the path. uno::Reference<beans::XPropertySet> xShapeWaveProps(getShapeFromPage(0, 1, xDocShRef)); awt::Rectangle aBoundRectWave; xShapeWaveProps->getPropertyValue(UNO_NAME_MISC_OBJ_BOUNDRECT) >>= aBoundRectWave; // difference should be zero, but allow some range for stroke thickness - CPPUNIT_ASSERT_LESS(50L, labs(aBoundRectWave.Width - 11514)); + CPPUNIT_ASSERT_LESS(sal_Int32(50), std::abs(aBoundRectWave.Width - 11514)); xDocShRef->DoClose(); } diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index c45e782be567..25e2aaea7b56 100644 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -20,6 +20,7 @@ #include <sal/config.h> #include <cassert> +#include <cstdlib> #include <controller/SlsClipboard.hxx> @@ -699,9 +700,9 @@ sal_Int8 Clipboard::ExecuteDrop ( SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; const Point aEventModelPosition ( pTargetWindow->PixelToLogic (rEvent.maPosPixel)); - const sal_Int32 nXOffset (labs (pDragTransferable->GetStartPos().X() + const sal_Int32 nXOffset (std::abs (pDragTransferable->GetStartPos().X() - aEventModelPosition.X())); - const sal_Int32 nYOffset (labs (pDragTransferable->GetStartPos().Y() + const sal_Int32 nYOffset (std::abs (pDragTransferable->GetStartPos().Y() - aEventModelPosition.Y())); bool bContinue = ( pDragTransferable->GetView() != &mrSlideSorter.GetView() ) |