[Libreoffice-commits] core.git: vcl/osx

Douglas Mencken dougmencken at gmail.com
Sun Mar 30 07:54:38 PDT 2014


 vcl/osx/salframeview.mm |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit f8f28ae91d9a57fdf9d39105ea5537fc7e95fa84
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Sun Mar 30 08:52:41 2014 -0400

    vcl-osx fix: 'NSEvent' may not respond to '-magnification'
    
    (error: invalid operands of types 'float' and 'objc_object*' to binary 'operator+')
    
    Change-Id: Iade7acde31fad21d7dde1a8c20c8900d9cbbd446
    Reviewed-on: https://gerrit.libreoffice.org/8792
    Tested-by: Norbert Thiebaud <nthiebaud at gmail.com>
    Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index e556bf3..d44411f 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -765,11 +765,19 @@ private:
 
         if( bNewSeries )
             mfMagnifyDeltaSum = 0.0;
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
+        mfMagnifyDeltaSum += [pEvent deltaZ];
+#else
         mfMagnifyDeltaSum += [pEvent magnification];
+#endif
 
-		mfLastMagnifyTime = [pEvent timestamp];
-		// TODO: change to 0.1 when COMMAND_WHEEL_ZOOM handlers allow finer zooming control
-		static const float fMagnifyFactor = 0.25*500;
+        mfLastMagnifyTime = [pEvent timestamp];
+// TODO: change to 0.1 when COMMAND_WHEEL_ZOOM handlers allow finer zooming control
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
+        static const float fMagnifyFactor = 0.25;
+#else
+        static const float fMagnifyFactor = 0.25*500; // steps are 500 times smaller for -magnification
+#endif
         static const float fMinMagnifyStep = 15.0 / fMagnifyFactor;
         if( fabs(mfMagnifyDeltaSum) <= fMinMagnifyStep )
             return;


More information about the Libreoffice-commits mailing list