[Libreoffice-commits] .: sc/source sd/source svx/source sw/source

Korrawit Pruegsanusak korrawit at kemper.freedesktop.org
Mon Jan 16 09:19:14 PST 2012


 sc/source/ui/view/prevwsh.cxx          |    5 +++--
 sc/source/ui/view/tabview.cxx          |    5 +++--
 sd/source/ui/view/viewshel.cxx         |    5 +++--
 svx/source/stbctrls/zoomsliderctrl.cxx |    5 +++--
 sw/source/ui/uiview/viewport.cxx       |    5 +++--
 5 files changed, 15 insertions(+), 10 deletions(-)

New commits:
commit a9ebfbc2b6c8db7997d5982435951c068120af6f
Author: Korrawit Pruegsanusak <detective.conan.1412 at gmail.com>
Date:   Tue Jan 17 00:18:08 2012 +0700

    Use platform-independent ::rtl::math::round to fix msvc build

diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index b25a464..e85f9ca 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -76,6 +76,7 @@
 #include <svx/dialogs.hrc>
 
 #include <svx/zoom_def.hxx>
+#include <rtl/math.hxx>
 
 #include "sc.hrc"
 #include "scabstdlg.hxx"
@@ -448,9 +449,9 @@ sal_Bool ScPreviewShell::ScrollCommand( const CommandEvent& rCEvt )
         long nOld = pPreview->GetZoom();
         long nNew = nOld;
         if ( pData->GetDelta() < 0 )
-            nNew = Max( (long) MINZOOM, (long)round( nOld / ZOOM_FACTOR ));
+            nNew = Max( (long) MINZOOM, (long)::rtl::math::round( nOld / ZOOM_FACTOR ));
         else
-            nNew = Min( (long) MAXZOOM, (long)round( nOld * ZOOM_FACTOR ));
+            nNew = Min( (long) MAXZOOM, (long)::rtl::math::round( nOld * ZOOM_FACTOR ));
 
         if ( nNew != nOld )
         {
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 738aeec..326af1a 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -150,6 +150,7 @@
 #include <algorithm>
 
 #include <svx/zoom_def.hxx>
+#include <rtl/math.hxx>
 
 #define SPLIT_MARGIN    30
 #define SC_ICONSIZE     36
@@ -1059,9 +1060,9 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos )
             long nOld = (long)(( rOldY.GetNumerator() * 100 ) / rOldY.GetDenominator());
             long nNew = nOld;
             if ( pData->GetDelta() < 0 )
-                nNew = Max( (long) MINZOOM, (long)round( nOld / ZOOM_FACTOR ));
+                nNew = Max( (long) MINZOOM, (long)::rtl::math::round( nOld / ZOOM_FACTOR ));
             else
-                nNew = Min( (long) MAXZOOM, (long)round( nOld * ZOOM_FACTOR ));
+                nNew = Min( (long) MAXZOOM, (long)::rtl::math::round( nOld * ZOOM_FACTOR ));
 
             if ( nNew != nOld )
             {
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 6c79ec2..b1cc2d3 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -83,6 +83,7 @@
 #include "SpellDialogChildWindow.hxx"
 
 #include <svx/zoom_def.hxx>
+#include <rtl/math.hxx>
 
 #include "Window.hxx"
 #include "fupoor.hxx"
@@ -718,9 +719,9 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWi
                         long        nNewZoom;
 
                         if( pData->GetDelta() < 0L )
-                            nNewZoom = Max( (long) pWin->GetMinZoom(), (long)round( nOldZoom / ZOOM_FACTOR ));
+                            nNewZoom = Max( (long) pWin->GetMinZoom(), (long)::rtl::math::round( nOldZoom / ZOOM_FACTOR ));
                         else
-                            nNewZoom = Min( (long) pWin->GetMaxZoom(), (long)round( nOldZoom * ZOOM_FACTOR ));
+                            nNewZoom = Min( (long) pWin->GetMaxZoom(), (long)::rtl::math::round( nOldZoom * ZOOM_FACTOR ));
 
                         SetZoom( nNewZoom );
                         Invalidate( SID_ATTR_ZOOM );
diff --git a/svx/source/stbctrls/zoomsliderctrl.cxx b/svx/source/stbctrls/zoomsliderctrl.cxx
index b270480..a845eb9 100644
--- a/svx/source/stbctrls/zoomsliderctrl.cxx
+++ b/svx/source/stbctrls/zoomsliderctrl.cxx
@@ -37,6 +37,7 @@
 #include <svx/dialogs.hrc>
 
 #include <svx/zoom_def.hxx>
+#include <rtl/math.hxx>
 
 #include <set>
 
@@ -359,11 +360,11 @@ sal_Bool SvxZoomSliderControl::MouseButtonDown( const MouseEvent & rEvt )
 
     // click to - button
     if ( nXDiff >= nButtonLeftOffset && nXDiff <= nButtonRightOffset )
-        mpImpl->mnCurrentZoom = round( mpImpl->mnCurrentZoom / ZOOM_FACTOR );
+        mpImpl->mnCurrentZoom = ::rtl::math::round( mpImpl->mnCurrentZoom / ZOOM_FACTOR );
     // click to + button
     else if ( nXDiff >= aControlRect.GetWidth() - nSliderXOffset + nButtonLeftOffset &&
               nXDiff <= aControlRect.GetWidth() - nSliderXOffset + nButtonRightOffset )
-        mpImpl->mnCurrentZoom = round( mpImpl->mnCurrentZoom * ZOOM_FACTOR );
+        mpImpl->mnCurrentZoom = ::rtl::math::round( mpImpl->mnCurrentZoom * ZOOM_FACTOR );
     // click to slider
     else if( nXDiff >= nSliderXOffset && nXDiff <= aControlRect.GetWidth() - nSliderXOffset )
         mpImpl->mnCurrentZoom = Offset2Zoom( nXDiff );
diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx
index 6bbb5d6..e630087 100644
--- a/sw/source/ui/uiview/viewport.cxx
+++ b/sw/source/ui/uiview/viewport.cxx
@@ -53,6 +53,7 @@
 #include <IDocumentSettingAccess.hxx>
 
 #include <svx/zoom_def.hxx>
+#include <rtl/math.hxx>
 
 //Das SetVisArea der DocShell darf nicht vom InnerResizePixel gerufen werden.
 //Unsere Einstellungen muessen aber stattfinden.
@@ -1311,9 +1312,9 @@ sal_Bool SwView::HandleWheelCommands( const CommandEvent& rCEvt )
     {
         sal_uInt16 nFact = pWrtShell->GetViewOptions()->GetZoom();
         if( 0L > pWData->GetDelta() )
-            nFact = static_cast< sal_uInt16 >(Max( 20, (int)round( nFact / ZOOM_FACTOR )));
+            nFact = static_cast< sal_uInt16 >(Max( 20, (int)::rtl::math::round( nFact / ZOOM_FACTOR )));
         else
-            nFact = static_cast< sal_uInt16 >(Min( 600, (int)round( nFact * ZOOM_FACTOR )));
+            nFact = static_cast< sal_uInt16 >(Min( 600, (int)::rtl::math::round( nFact * ZOOM_FACTOR )));
 
         SetZoom( SVX_ZOOM_PERCENT, nFact );
         bOk = sal_True;


More information about the Libreoffice-commits mailing list