diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-03-14 23:08:11 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-19 10:27:37 +0000 |
commit | 715cb73a20bbe9db6406a863201370996c04c1b7 (patch) | |
tree | 6092263e055dedb0f70810826a8ea44db198c90e | |
parent | e8b686149f2a9f21a7a52bb5710a8a6362cd7a35 (diff) |
fdo#75460: sw: fix AutoScroll
This reverts commit 5141201fba2d080841b81e02be92f4b47aae2684. which
fixed a crash but unfortunately also prevents the
m_pEditWin->HandleScrollCommand from being called, thus disabling
AutoScroll. Fix the crash in the ugly way by another pWData check.
(regression from 8880c773e779710dc0a08760e92afd709a73ca31)
(cherry picked from commit 6795b251e2011cae945c6bb903de8053953b5e30)
Conflicts:
sw/source/ui/uiview/viewport.cxx
Change-Id: I958f1403ad23d0c0631eca5dbbef977a9ca1210d
Reviewed-on: https://gerrit.libreoffice.org/8597
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/ui/uiview/viewport.cxx | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx index e9f5d1ac6e73..aabbda93186f 100644 --- a/sw/source/ui/uiview/viewport.cxx +++ b/sw/source/ui/uiview/viewport.cxx @@ -1253,14 +1253,9 @@ void SwView::Move() sal_Bool SwView::HandleWheelCommands( const CommandEvent& rCEvt ) { - const CommandWheelData* pWData = rCEvt.GetWheelData(); - if (!pWData) - { - return sal_False; - } - sal_Bool bOk = sal_False; - if( COMMAND_WHEEL_ZOOM == pWData->GetMode() ) + const CommandWheelData* pWData = rCEvt.GetWheelData(); + if (pWData && COMMAND_WHEEL_ZOOM == pWData->GetMode()) { long nFact = m_pWrtShell->GetViewOptions()->GetZoom(); if( 0L > pWData->GetDelta() ) @@ -1271,7 +1266,7 @@ sal_Bool SwView::HandleWheelCommands( const CommandEvent& rCEvt ) SetZoom( SVX_ZOOM_PERCENT, nFact ); bOk = sal_True; } - else if( COMMAND_WHEEL_ZOOM_SCALE == pWData->GetMode() ) + else if (pWData && COMMAND_WHEEL_ZOOM_SCALE == pWData->GetMode()) { int newZoom = 100 * (m_pWrtShell->GetViewOptions()->GetZoom() / 100.0) * (pWData->GetDelta() / 100.0); SetZoom( SVX_ZOOM_PERCENT, std::max( 20, std::min( 600, newZoom ) ) ); @@ -1279,13 +1274,13 @@ sal_Bool SwView::HandleWheelCommands( const CommandEvent& rCEvt ) } else { - if(pWData->GetMode()==COMMAND_WHEEL_SCROLL) + if (pWData && pWData->GetMode()==COMMAND_WHEEL_SCROLL) { // This influences whether quick help is shown m_bWheelScrollInProgress=true; } - if ((COMMAND_WHEEL_SCROLL==pWData->GetMode()) && (((sal_uLong)0xFFFFFFFF) == pWData->GetScrollLines())) + if (pWData && (COMMAND_WHEEL_SCROLL==pWData->GetMode()) && (((sal_uLong)0xFFFFFFFF) == pWData->GetScrollLines())) { if (pWData->GetDelta()<0) PhyPageDown(); |