[Libreoffice-commits] core.git: svx/source
Tomaž Vajngerl
quikee at gmail.com
Sun Sep 15 07:22:52 PDT 2013
svx/source/dialog/svxruler.cxx | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
New commits:
commit fcc436bc62cfd8d14efe12391f5f58e7e1d7e594
Author: Tomaž Vajngerl <quikee at gmail.com>
Date: Sun Sep 15 16:19:04 2013 +0200
use rtl::math::round for rounding, std:round is C++11
Change-Id: Ibba1a3e712de56844be454a87a0bb65c26ae4fe1
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 6d9adee..a41d0e0 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();
}
More information about the Libreoffice-commits
mailing list