diff options
Diffstat (limited to 'vcl/source/window/event.cxx')
-rw-r--r-- | vcl/source/window/event.cxx | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx index da38fde26b36..9c954125779d 100644 --- a/vcl/source/window/event.cxx +++ b/vcl/source/window/event.cxx @@ -94,6 +94,9 @@ bool Window::Notify( NotifyEvent& rNEvt ) { bool nRet = false; + if (IsDisposed()) + return false; + // check for docking window // but do nothing if window is docked and locked ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this ); @@ -221,6 +224,9 @@ void Window::CallEventListeners( sal_uLong nEvent, void* pData ) { pWindow->ImplAddDel( &aDelData ); + if ( aDelData.IsDead() ) + return; + pWindow->mpWindowImpl->maChildEventListeners.Call( &aEvent ); if ( aDelData.IsDead() ) @@ -277,7 +283,7 @@ ImplSVEvent * Window::PostUserEvent( const Link& rLink, void* pCaller ) void Window::RemoveUserEvent( ImplSVEvent * nUserEvent ) { - DBG_ASSERT( nUserEvent->mpWindow == this, + DBG_ASSERT( nUserEvent->mpWindow.get() == this, "Window::RemoveUserEvent(): Event doesn't send to this window or is already removed" ); DBG_ASSERT( nUserEvent->mbCall, "Window::RemoveUserEvent(): Event is already removed" ); @@ -515,14 +521,14 @@ void Window::ImplCallFocusChangeActivate( vcl::Window* pNewOverlapWindow, { if ( pSVData->maWinData.mpLastDeacWin ) { - if ( pSVData->maWinData.mpLastDeacWin == pNewOverlapWindow ) + if ( pSVData->maWinData.mpLastDeacWin.get() == pNewOverlapWindow ) bCallActivate = false; else { vcl::Window* pLastRealWindow = pSVData->maWinData.mpLastDeacWin->ImplGetWindow(); pSVData->maWinData.mpLastDeacWin->mpWindowImpl->mbActive = false; pSVData->maWinData.mpLastDeacWin->Deactivate(); - if ( pLastRealWindow != pSVData->maWinData.mpLastDeacWin ) + if ( pLastRealWindow != pSVData->maWinData.mpLastDeacWin.get() ) { pLastRealWindow->mpWindowImpl->mbActive = true; pLastRealWindow->Activate(); @@ -568,5 +574,21 @@ void Window::ImplCallFocusChangeActivate( vcl::Window* pNewOverlapWindow, } /* namespace vcl */ +NotifyEvent::NotifyEvent() +{ + mpWindow = NULL; + mpData = NULL; + mnEventType = MouseNotifyEvent::NONE; + mnRetValue = 0; +} + +NotifyEvent::NotifyEvent( MouseNotifyEvent nEventType, vcl::Window* pWindow, + const void* pEvent, long nRet ) +{ + mpWindow = pWindow; + mpData = const_cast<void*>(pEvent); + mnEventType = nEventType; + mnRetValue = nRet; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |