Return-Path: X-Original-To: apmail-openoffice-commits-archive@www.apache.org Delivered-To: apmail-openoffice-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D6A2511737 for ; Wed, 21 May 2014 06:52:04 +0000 (UTC) Received: (qmail 34600 invoked by uid 500); 21 May 2014 06:51:56 -0000 Delivered-To: apmail-openoffice-commits-archive@openoffice.apache.org Received: (qmail 34569 invoked by uid 500); 21 May 2014 06:51:56 -0000 Mailing-List: contact commits-help@openoffice.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openoffice.apache.org Delivered-To: mailing list commits@openoffice.apache.org Received: (qmail 34556 invoked by uid 99); 21 May 2014 06:51:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 May 2014 06:51:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 May 2014 06:51:54 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 6A62B238896F; Wed, 21 May 2014 06:51:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1596491 - /openoffice/trunk/main/vcl/aqua/source/window/salframeview.mm Date: Wed, 21 May 2014 06:51:34 -0000 To: commits@openoffice.apache.org From: hdu@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140521065134.6A62B238896F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: hdu Date: Wed May 21 06:51:34 2014 New Revision: 1596491 URL: http://svn.apache.org/r1596491 Log: #i124191# fix horizontal scroll events on Mac A problem with horizontal scrolling was reported on Mac. Reviewing the relevant code identified some problems. The patch to fix them was confirmed to also fix the reported problem. Found-by: erben.fr@gmail.com Tested-by: cemonadresse@orange.fr Tested-by: TrolliusX@t-online.de Tested-by: thorsten.wagner.4@gmail.com Modified: openoffice/trunk/main/vcl/aqua/source/window/salframeview.mm Modified: openoffice/trunk/main/vcl/aqua/source/window/salframeview.mm URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/aqua/source/window/salframeview.mm?rev=1596491&r1=1596490&r2=1596491&view=diff ============================================================================== --- openoffice/trunk/main/vcl/aqua/source/window/salframeview.mm (original) +++ openoffice/trunk/main/vcl/aqua/source/window/salframeview.mm Wed May 21 06:51:34 2014 @@ -803,8 +803,8 @@ private: mpFrame->mnLastModifierFlags = [pEvent modifierFlags]; // merge pending scroll wheel events - float dX = 0.0; - float dY = 0.0; + CGFloat dX = 0.0; + CGFloat dY = 0.0; for(;;) { dX += [pEvent deltaX]; @@ -833,7 +833,7 @@ private: if( dX != 0.0 ) { aEvent.mnDelta = static_cast(floor(dX)); - aEvent.mnNotchDelta = dX < 0 ? -1 : 1; + aEvent.mnNotchDelta = (dX < 0) ? -1 : +1; if( aEvent.mnDelta == 0 ) aEvent.mnDelta = aEvent.mnNotchDelta; aEvent.mbHorz = TRUE; @@ -843,7 +843,7 @@ private: if( dY != 0.0 && AquaSalFrame::isAlive( mpFrame )) { aEvent.mnDelta = static_cast(floor(dY)); - aEvent.mnNotchDelta = dY < 0 ? -1 : 1; + aEvent.mnNotchDelta = (dY < 0) ? -1 : +1; if( aEvent.mnDelta == 0 ) aEvent.mnDelta = aEvent.mnNotchDelta; aEvent.mbHorz = FALSE; @@ -863,8 +863,8 @@ private: mpFrame->mnLastModifierFlags = [pEvent modifierFlags]; // merge pending scroll wheel events - float dX = 0.0; - float dY = 0.0; + CGFloat dX = 0.0; + CGFloat dY = 0.0; for(;;) { dX += [pEvent deltaX]; @@ -893,11 +893,11 @@ private: if( dX != 0.0 ) { aEvent.mnDelta = static_cast(floor(dX)); - aEvent.mnNotchDelta = dX < 0 ? -1 : 1; + aEvent.mnNotchDelta = (dX < 0) ? -1 : +1; if( aEvent.mnDelta == 0 ) aEvent.mnDelta = aEvent.mnNotchDelta; aEvent.mbHorz = TRUE; - aEvent.mnScrollLines = dY > 0 ? dX/WHEEL_EVENT_FACTOR : -dX/WHEEL_EVENT_FACTOR; + aEvent.mnScrollLines = (dX > 0) ? +dX/WHEEL_EVENT_FACTOR : -dX/WHEEL_EVENT_FACTOR; if( aEvent.mnScrollLines == 0 ) aEvent.mnScrollLines = 1; @@ -906,11 +906,11 @@ private: if( dY != 0.0 && AquaSalFrame::isAlive( mpFrame ) ) { aEvent.mnDelta = static_cast(floor(dY)); - aEvent.mnNotchDelta = dY < 0 ? -1 : 1; + aEvent.mnNotchDelta = (dY < 0) ? -1 : +1; if( aEvent.mnDelta == 0 ) aEvent.mnDelta = aEvent.mnNotchDelta; aEvent.mbHorz = FALSE; - aEvent.mnScrollLines = dY > 0 ? dY/WHEEL_EVENT_FACTOR : -dY/WHEEL_EVENT_FACTOR; + aEvent.mnScrollLines = (dY > 0) ? +dY/WHEEL_EVENT_FACTOR : -dY/WHEEL_EVENT_FACTOR; if( aEvent.mnScrollLines < 1 ) aEvent.mnScrollLines = 1;