summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTim Hardeck <thardeck@suse.com>2012-01-18 16:42:55 +0100
committerJan Holesovsky <kendy@suse.cz>2012-01-25 12:35:54 +0100
commit315d2ddc161e4b296febe9e54c3cfc9270310bfe (patch)
treedbf07bd17f430ef980074f27f5a540a34abea5c5 /sc
parent554bcf4205ede6ec3adb9f39e676b77054b1e8a1 (diff)
optimized zoom to use more common intervals
Round zoom values beginning with 50 to a multiple of 5, with 100 to one of 10, with 500 to one of 50 and with 1000 to one of 100. The step 100 is enforced to have one fixed point.
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/prevwsh.cxx6
-rw-r--r--sc/source/ui/view/tabview.cxx7
2 files changed, 6 insertions, 7 deletions
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index e85f9ca66e65..9dbe51f0749f 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -75,8 +75,8 @@
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
+#include <basegfx/tools/zoomtools.hxx>
#include <svx/zoom_def.hxx>
-#include <rtl/math.hxx>
#include "sc.hrc"
#include "scabstdlg.hxx"
@@ -449,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)::rtl::math::round( nOld / ZOOM_FACTOR ));
+ nNew = Max( (long) MINZOOM, basegfx::zoomtools::zoomOut( nOld ));
else
- nNew = Min( (long) MAXZOOM, (long)::rtl::math::round( nOld * ZOOM_FACTOR ));
+ nNew = Min( (long) MAXZOOM, basegfx::zoomtools::zoomIn( nOld ));
if ( nNew != nOld )
{
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 326af1a57f19..8e8124aedc4f 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -149,8 +149,7 @@
#include <string>
#include <algorithm>
-#include <svx/zoom_def.hxx>
-#include <rtl/math.hxx>
+#include <basegfx/tools/zoomtools.hxx>
#define SPLIT_MARGIN 30
#define SC_ICONSIZE 36
@@ -1060,9 +1059,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)::rtl::math::round( nOld / ZOOM_FACTOR ));
+ nNew = Max( (long) MINZOOM, basegfx::zoomtools::zoomOut( nOld ));
else
- nNew = Min( (long) MAXZOOM, (long)::rtl::math::round( nOld * ZOOM_FACTOR ));
+ nNew = Min( (long) MAXZOOM, basegfx::zoomtools::zoomIn( nOld ));
if ( nNew != nOld )
{