summaryrefslogtreecommitdiff
path: root/emfio
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-11-16 16:07:30 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-11-16 21:43:09 +0100
commit50d3ad9127aaf63afcfa299adcea060c9b09faa4 (patch)
treeaf3bf48ae8e31e180003c9f998831dd7777d1f5b /emfio
parentcd4a239063a77d49fe178255c20f0558e337a82f (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 'emfio')
-rw-r--r--emfio/source/reader/mtftools.cxx3
-rw-r--r--emfio/source/reader/wmfreader.cxx8
2 files changed, 7 insertions, 4 deletions
diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx
index cd3110ba9cbc..e376e6f501c1 100644
--- a/emfio/source/reader/mtftools.cxx
+++ b/emfio/source/reader/mtftools.cxx
@@ -19,6 +19,7 @@
#include <mtftools.hxx>
+#include <cstdlib>
#include <memory>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
@@ -1160,7 +1161,7 @@ namespace emfio
UpdateClipRegion();
UpdateLineStyle();
UpdateFillStyle();
- mpGDIMetaFile->AddAction( new MetaRoundRectAction( ImplMap( rRect ), labs( ImplMap( rSize ).Width() ), labs( ImplMap( rSize ).Height() ) ) );
+ mpGDIMetaFile->AddAction( new MetaRoundRectAction( ImplMap( rRect ), std::abs( ImplMap( rSize ).Width() ), std::abs( ImplMap( rSize ).Height() ) ) );
}
void MtfTools::DrawEllipse( const tools::Rectangle& rRect )
diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx
index 1473930e83ec..0022fe9b1cb6 100644
--- a/emfio/source/reader/wmfreader.cxx
+++ b/emfio/source/reader/wmfreader.cxx
@@ -20,6 +20,7 @@
#include <wmfreader.hxx>
#include <emfreader.hxx>
+#include <cstdlib>
#include <memory>
#include <optional>
#include <o3tl/safeint.hxx>
@@ -1328,18 +1329,19 @@ namespace emfio
}
SetWinOrg( aPlaceableBound.TopLeft() );
- Size aWMFSize( labs( aPlaceableBound.GetWidth() ), labs( aPlaceableBound.GetHeight() ) );
+ Size aWMFSize(
+ std::abs( aPlaceableBound.GetWidth() ), std::abs( aPlaceableBound.GetHeight() ) );
SetWinExt( aWMFSize );
SAL_INFO("vcl.wmf", "WMF size w: " << aWMFSize.Width() << " h: " << aWMFSize.Height());
Size aDevExt( 10000, 10000 );
- if( ( labs( aWMFSize.Width() ) > 1 ) && ( labs( aWMFSize.Height() ) > 1 ) )
+ if( ( std::abs( aWMFSize.Width() ) > 1 ) && ( std::abs( aWMFSize.Height() ) > 1 ) )
{
const Fraction aFrac( 1, mnUnitsPerInch);
MapMode aWMFMap( MapUnit::MapInch, Point(), aFrac, aFrac );
Size aSize100(OutputDevice::LogicToLogic(aWMFSize, aWMFMap, MapMode(MapUnit::Map100thMM)));
- aDevExt = Size( labs( aSize100.Width() ), labs( aSize100.Height() ) );
+ aDevExt = Size( std::abs( aSize100.Width() ), std::abs( aSize100.Height() ) );
}
SetDevExt( aDevExt );