summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-03-14 23:08:11 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-03-19 10:22:23 +0000
commita0e94c5ce7dc2ad00d48cd9c0681c044bd0f96d1 (patch)
tree81c0f0876f83b60c8b8e93dac752f1ce41b4518b
parentb4bba09ba98cfa40d559f98aaf8ae4730c6f075a (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) Change-Id: I958f1403ad23d0c0631eca5dbbef977a9ca1210d (cherry picked from commit 6795b251e2011cae945c6bb903de8053953b5e30) Reviewed-on: https://gerrit.libreoffice.org/8596 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 6857a266c5e8037f097ed7e727671f7da543f178) Reviewed-on: https://gerrit.libreoffice.org/8622 Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/ui/uiview/viewport.cxx15
1 files changed, 5 insertions, 10 deletions
diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx
index 1d4acb347873..ac0b21ac729a 100644
--- a/sw/source/ui/uiview/viewport.cxx
+++ b/sw/source/ui/uiview/viewport.cxx
@@ -1242,14 +1242,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() )
@@ -1260,7 +1255,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())
{
// mobile touch zoom (pinch) section
// remember the center location to reach in logic
@@ -1304,13 +1299,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();