[Libreoffice-commits] core.git: vcl/source
Takeshi Abe
tabe at fixedpoint.jp
Tue Nov 3 08:24:11 PST 2015
vcl/source/filter/sgvtext.cxx | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
New commits:
commit b59bf9f6397641750ad3db50312a1133d7e8fc3f
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date: Tue Nov 3 22:27:01 2015 +0900
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 at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/source/filter/sgvtext.cxx b/vcl/source/filter/sgvtext.cxx
index e732eca..1ab48a9 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;
More information about the Libreoffice-commits
mailing list