You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by hd...@apache.org on 2014/06/13 11:55:17 UTC
svn commit: r1602354 - in /openoffice/branches/AOO410: ./ main/
main/vcl/aqua/source/window/salframeview.mm
Author: hdu
Date: Fri Jun 13 09:55:17 2014
New Revision: 1602354
URL: http://svn.apache.org/r1602354
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
Tested-by: jsc@apache.org
Merged from AOO trunk revision 1596491
Modified:
openoffice/branches/AOO410/ (props changed)
openoffice/branches/AOO410/main/ (props changed)
openoffice/branches/AOO410/main/vcl/aqua/source/window/salframeview.mm
Propchange: openoffice/branches/AOO410/
------------------------------------------------------------------------------
Merged /openoffice/trunk:r1596491
Propchange: openoffice/branches/AOO410/main/
------------------------------------------------------------------------------
Merged /openoffice/trunk/main:r1596491
Modified: openoffice/branches/AOO410/main/vcl/aqua/source/window/salframeview.mm
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/vcl/aqua/source/window/salframeview.mm?rev=1602354&r1=1602353&r2=1602354&view=diff
==============================================================================
--- openoffice/branches/AOO410/main/vcl/aqua/source/window/salframeview.mm (original)
+++ openoffice/branches/AOO410/main/vcl/aqua/source/window/salframeview.mm Fri Jun 13 09:55:17 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<long>(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<long>(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<long>(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<long>(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;