summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorTomaž Vajngerl <quikee@gmail.com>2013-09-15 16:19:04 +0200
committerTomaž Vajngerl <quikee@gmail.com>2013-09-15 16:19:04 +0200
commitfcc436bc62cfd8d14efe12391f5f58e7e1d7e594 (patch)
tree6f4a3899b05ffad58498cbd259d86a5bb6ed4d44 /svx
parentb0c3f45becac49ae05bff2b694c3ffe906439979 (diff)
use rtl::math::round for rounding, std:round is C++11
Change-Id: Ibba1a3e712de56844be454a87a0bb65c26ae4fe1
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/svxruler.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 6d9adeefe023..a41d0e07d5e2 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -19,7 +19,6 @@
#include <cstring>
#include <climits>
-#include <cmath>
#include <tools/shl.hxx>
#include <vcl/image.hxx>
@@ -366,7 +365,7 @@ long SvxRuler::MakePositionSticky(long aPosition, long aPointOfReference, bool a
// Convert position to current selected map mode
long aPositionLogic = pEditWin->PixelToLogic(Size(aTranslatedPosition, 0), GetCurrentMapMode()).Width();
// Normalize -- snap to nearest tick
- aPositionLogic = std::round((aPositionLogic + aHalfTick) / aTick) * aTick;
+ aPositionLogic = rtl::math::round((aPositionLogic + aHalfTick) / aTick) * aTick;
// Convert back to pixels
aPosition = pEditWin->LogicToPixel(Size(aPositionLogic, 0), GetCurrentMapMode()).Width();
// Move "coordinate system" back to original position
@@ -2080,7 +2079,7 @@ long SvxRuler::RoundToCurrentMapMode(long lValue) const
double aRoundingFactor = aUnitData.nTickUnit / aUnitData.nTick1;
long lNewValue = pEditWin->LogicToLogic(Size(lValue, 0), pEditWin->GetMapMode(), GetCurrentMapMode()).Width();
- lNewValue = (std::round(lNewValue / (double) aUnitData.nTickUnit * aRoundingFactor) / aRoundingFactor) * aUnitData.nTickUnit;
+ lNewValue = (rtl::math::round(lNewValue / (double) aUnitData.nTickUnit * aRoundingFactor) / aRoundingFactor) * aUnitData.nTickUnit;
return pEditWin->LogicToLogic(Size(lNewValue, 0), GetCurrentMapMode(), pEditWin->GetMapMode()).Width();
}