diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2005-12-07 16:44:06 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2005-12-07 16:44:06 +0000 |
commit | e96e3e02af1689e72dcb2db69bf4c2d89e724bb5 (patch) | |
tree | 4b3728f3b32f550449d17af9d00611ce4062f15e /sd/source | |
parent | 00c9539422336b2d6a1e9908f2bfe979397e3927 (diff) |
INTEGRATION: CWS impress80 (1.52.22); FILE MERGED
2005/12/07 15:59:24 af 1.52.22.1: #128397# Do not access CommandWheelData in HandleScrollCommand when that object is NULL.
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/view/viewshel.cxx | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index ac725e5c5ef0..49a1e7f49d3f 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -4,9 +4,9 @@ * * $RCSfile: viewshel.cxx,v $ * - * $Revision: 1.52 $ + * $Revision: 1.53 $ * - * last change: $Author: obo $ $Date: 2005-11-16 09:22:34 $ + * last change: $Author: hr $ $Date: 2005-12-07 17:44:06 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -778,37 +778,40 @@ BOOL ViewShell::HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWi { const CommandWheelData* pData = rCEvt.GetWheelData(); - if( pData && pData->IsMod1() ) + if (pData != NULL) { - if( !GetDocSh()->IsUIActive() ) + if (pData->IsMod1()) { - const long nOldZoom = GetActiveWindow()->GetZoom(); - long nNewZoom; - - if( pData->GetDelta() < 0L ) - nNewZoom = Max( (long) pWin->GetMinZoom(), (long)(nOldZoom - DELTA_ZOOM) ); - else - nNewZoom = Min( (long) pWin->GetMaxZoom(), (long)(nOldZoom + DELTA_ZOOM) ); - - SetZoom( nNewZoom ); - Invalidate( SID_ATTR_ZOOM ); - bDone = TRUE; + if( !GetDocSh()->IsUIActive() ) + { + const long nOldZoom = GetActiveWindow()->GetZoom(); + long nNewZoom; + + if( pData->GetDelta() < 0L ) + nNewZoom = Max( (long) pWin->GetMinZoom(), (long)(nOldZoom - DELTA_ZOOM) ); + else + nNewZoom = Min( (long) pWin->GetMaxZoom(), (long)(nOldZoom + DELTA_ZOOM) ); + + SetZoom( nNewZoom ); + Invalidate( SID_ATTR_ZOOM ); + bDone = TRUE; + } } - } - else - { - if( mpContentWindow.get() == pWin ) + else { - ULONG nScrollLines = pData->GetScrollLines(); - if(IsPageFlipMode()) - nScrollLines = COMMAND_WHEEL_PAGESCROLL; - CommandWheelData aWheelData( pData->GetDelta(),pData->GetNotchDelta(), - nScrollLines,pData->GetMode(),pData->GetModifier(),pData->IsHorz() ); - CommandEvent aReWrite( rCEvt.GetMousePosPixel(),rCEvt.GetCommand(), - rCEvt.IsMouseEvent(),(const void *) &aWheelData ); - bDone = pWin->HandleScrollCommand( aReWrite, - mpHorizontalScrollBar.get(), - mpVerticalScrollBar.get()); + if( mpContentWindow.get() == pWin ) + { + ULONG nScrollLines = pData->GetScrollLines(); + if(IsPageFlipMode()) + nScrollLines = COMMAND_WHEEL_PAGESCROLL; + CommandWheelData aWheelData( pData->GetDelta(),pData->GetNotchDelta(), + nScrollLines,pData->GetMode(),pData->GetModifier(),pData->IsHorz() ); + CommandEvent aReWrite( rCEvt.GetMousePosPixel(),rCEvt.GetCommand(), + rCEvt.IsMouseEvent(),(const void *) &aWheelData ); + bDone = pWin->HandleScrollCommand( aReWrite, + mpHorizontalScrollBar.get(), + mpVerticalScrollBar.get()); + } } } } |