summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2015-11-03 22:27:01 +0900
committerCaolán McNamara <caolanm@redhat.com>2015-11-03 16:23:47 +0000
commitb59bf9f6397641750ad3db50312a1133d7e8fc3f (patch)
tree8cd1dc8976b1e2679dc4d2b9dbde718c1e99255d /vcl/source
parentb846b03c709130564527da8d264660a131361221 (diff)
vcl: Prefer std::abs to a home-brewed macro
The arguments in use are of type sal_Int16, so now it's the overloaded one of type int in <cstdlib>. Change-Id: I83336c093cf58a351e9390c0eb4e20a5d5340f9e Reviewed-on: https://gerrit.libreoffice.org/19754 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/filter/sgvtext.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/vcl/source/filter/sgvtext.cxx b/vcl/source/filter/sgvtext.cxx
index e732ecade266..1ab48a9d565e 100644
--- a/vcl/source/filter/sgvtext.cxx
+++ b/vcl/source/filter/sgvtext.cxx
@@ -29,13 +29,10 @@
#include "sgfbram.hxx"
#include "sgvmain.hxx"
#include <memory>
+#include <cstdlib>
extern SgfFontLst* pSgfFonts;
-#ifndef abs
-#define abs(x) ((x)<0 ? -(x) : (x))
-#endif
-
// Limitations: only grey shadows, 2D and with fixed distance.
// Start of AbsBase.Pas
@@ -922,8 +919,8 @@ void TextType::Draw(OutputDevice& rOut)
xSize=32000 /2; // break
xSAdj=Pos2.x-Pos1.x; // to align for center/block
//if (xSize<=0) { xSize=32000 /2; LineFit=true; }
- FitXMul=sal::static_int_cast< sal_uInt16 >(abs(Pos2.x-Pos1.x)); FitXDiv=FitSize.x; if (FitXDiv==0) FitXDiv=1;
- FitYMul=sal::static_int_cast< sal_uInt16 >(abs(Pos2.y-Pos1.y)); FitYDiv=FitSize.y; if (FitYDiv==0) FitYDiv=1;
+ FitXMul=sal::static_int_cast< sal_uInt16 >(std::abs(Pos2.x-Pos1.x)); FitXDiv=FitSize.x; if (FitXDiv==0) FitXDiv=1;
+ FitYMul=sal::static_int_cast< sal_uInt16 >(std::abs(Pos2.y-Pos1.y)); FitYDiv=FitSize.y; if (FitYDiv==0) FitYDiv=1;
} else {
xSize=Pos2.x-Pos1.x;
xSAdj=xSize;