From e96e3e02af1689e72dcb2db69bf4c2d89e724bb5 Mon Sep 17 00:00:00 2001
From: Jens-Heiner Rechtien
Date: Wed, 7 Dec 2005 16:44:06 +0000
Subject: 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.
---
sd/source/ui/view/viewshel.cxx | 61 ++++++++++++++++++++++--------------------
1 file changed, 32 insertions(+), 29 deletions(-)
(limited to 'sd/source')
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());
+ }
}
}
}
--
cgit