cui/source/tabpages/transfrm.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit ad268373dc4b7d412d0c690d1f4e2b9ad03b3544
Author: Katarina Behrens <bu...@bubli.org>
Date:   Wed Nov 5 15:52:32 2014 +0100

    Use basegfx library function to clamp numbers
    
    Change-Id: I3142f55ecf94ce2143e92492243bc5959322704f

diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index ba6587b..e1193c1 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -1194,10 +1194,10 @@ void SvxPositionSizeTabPage::SetMinMaxPosition()
     }
 
     const double fMaxLong((double)(MetricField::ConvertValue( LONG_MAX, 0, 
MAP_100TH_MM, meDlgUnit ) - 1L));
-    fLeft = (fLeft > fMaxLong) ? fMaxLong : (fLeft < -fMaxLong) ? -fMaxLong : 
fLeft;
-    fRight = (fRight > fMaxLong) ? fMaxLong : (fRight < -fMaxLong) ? -fMaxLong 
: fRight;
-    fTop = (fTop > fMaxLong) ? fMaxLong : (fTop < -fMaxLong) ? -fMaxLong : 
fTop;
-    fBottom = (fBottom > fMaxLong) ? fMaxLong : (fBottom < -fMaxLong) ? 
-fMaxLong : fBottom;
+    fLeft = basegfx::clamp(fLeft, -fMaxLong, fMaxLong);
+    fRight = basegfx::clamp(fRight, -fMaxLong, fMaxLong);
+    fTop = basegfx::clamp(fTop, - fMaxLong, fMaxLong);
+    fBottom = basegfx::clamp(fBottom, -fMaxLong, fMaxLong);
 
     // #i75273# normalizing when setting the min/max values was wrong, removed
     m_pMtrPosX->SetMin(basegfx::fround64(fLeft));
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to