summaryrefslogtreecommitdiff
path: root/svx
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 /svx
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 'svx')
-rw-r--r--svx/inc/svx/zoom_def.hxx4
-rw-r--r--svx/source/stbctrls/zoomsliderctrl.cxx7
2 files changed, 3 insertions, 8 deletions
diff --git a/svx/inc/svx/zoom_def.hxx b/svx/inc/svx/zoom_def.hxx
index 9f1a8ef2bd07..0a244763ed98 100644
--- a/svx/inc/svx/zoom_def.hxx
+++ b/svx/inc/svx/zoom_def.hxx
@@ -8,8 +8,4 @@
#endif
-// Zoom factor for Calc, Writer, Draw and Impress
-// We use 2^(1/4) so that 4 steps lead to double / half size
-#define ZOOM_FACTOR 1.1892071150027210667175
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/stbctrls/zoomsliderctrl.cxx b/svx/source/stbctrls/zoomsliderctrl.cxx
index a845eb987d48..afab9c4dd3a0 100644
--- a/svx/source/stbctrls/zoomsliderctrl.cxx
+++ b/svx/source/stbctrls/zoomsliderctrl.cxx
@@ -36,8 +36,7 @@
#include <svx/dialmgr.hxx>
#include <svx/dialogs.hrc>
-#include <svx/zoom_def.hxx>
-#include <rtl/math.hxx>
+#include <basegfx/tools/zoomtools.hxx>
#include <set>
@@ -360,11 +359,11 @@ sal_Bool SvxZoomSliderControl::MouseButtonDown( const MouseEvent & rEvt )
// click to - button
if ( nXDiff >= nButtonLeftOffset && nXDiff <= nButtonRightOffset )
- mpImpl->mnCurrentZoom = ::rtl::math::round( mpImpl->mnCurrentZoom / ZOOM_FACTOR );
+ mpImpl->mnCurrentZoom = basegfx::zoomtools::zoomOut( mpImpl->mnCurrentZoom );
// click to + button
else if ( nXDiff >= aControlRect.GetWidth() - nSliderXOffset + nButtonLeftOffset &&
nXDiff <= aControlRect.GetWidth() - nSliderXOffset + nButtonRightOffset )
- mpImpl->mnCurrentZoom = ::rtl::math::round( mpImpl->mnCurrentZoom * ZOOM_FACTOR );
+ mpImpl->mnCurrentZoom = basegfx::zoomtools::zoomIn( mpImpl->mnCurrentZoom );
// click to slider
else if( nXDiff >= nSliderXOffset && nXDiff <= aControlRect.GetWidth() - nSliderXOffset )
mpImpl->mnCurrentZoom = Offset2Zoom( nXDiff );