diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-02-17 17:14:14 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-09 22:22:03 +0100 |
commit | 8b9b9985b04b8f3b602890806ea905f8c7cb45ba (patch) | |
tree | 5f50404afd9113cd805ef7462fb841a33908f0c4 | |
parent | 6b7bad4da3b899c191a4a414e1ea8a722110029b (diff) |
vcl: don't emit events on disposed objects & handle some method calls.
Change-Id: If8940edceb379025e322553c4b011e348e2d79d4
-rw-r--r-- | vcl/source/window/event.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/window2.cxx | 40 |
2 files changed, 24 insertions, 19 deletions
diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx index d4e4601e1cd1..9b1e59df63e0 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 ); diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index d60d15daaa89..a3398ea17e2c 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1016,37 +1016,38 @@ const vcl::Window* Window::ImplGetFirstOverlapWindow() const vcl::Window* Window::ImplGetFrameWindow() const { - return mpWindowImpl->mpFrameWindow; + return mpWindowImpl ? mpWindowImpl->mpFrameWindow : NULL; } bool Window::IsDockingWindow() const { - return mpWindowImpl->mbDockWin; + return mpWindowImpl ? mpWindowImpl->mbDockWin : false; } bool Window::ImplIsFloatingWindow() const { - return mpWindowImpl->mbFloatWin; + return mpWindowImpl ? mpWindowImpl->mbFloatWin : false; } bool Window::ImplIsSplitter() const { - return mpWindowImpl->mbSplitter; + return mpWindowImpl ? mpWindowImpl->mbSplitter : false; } bool Window::ImplIsPushButton() const { - return mpWindowImpl->mbPushButton; + return mpWindowImpl ? mpWindowImpl->mbPushButton : false; } bool Window::ImplIsOverlapWindow() const { - return mpWindowImpl->mbOverlapWin; + return mpWindowImpl ? mpWindowImpl->mbOverlapWin : false; } void Window::ImplSetMouseTransparent( bool bTransparent ) { - mpWindowImpl->mbMouseTransparent = bTransparent; + if (mpWindowImpl) + mpWindowImpl->mbMouseTransparent = bTransparent; } Point Window::ImplOutputToFrame( const Point& rPos ) @@ -1061,7 +1062,8 @@ Point Window::ImplFrameToOutput( const Point& rPos ) void Window::SetCompoundControl( bool bCompound ) { - mpWindowImpl->mbCompoundControl = bCompound; + if (mpWindowImpl) + mpWindowImpl->mbCompoundControl = bCompound; } void Window::IncrementLockCount() @@ -1076,17 +1078,17 @@ void Window::DecrementLockCount() WinBits Window::GetStyle() const { - return mpWindowImpl->mnStyle; + return mpWindowImpl ? mpWindowImpl->mnStyle : 0; } WinBits Window::GetPrevStyle() const { - return mpWindowImpl->mnPrevStyle; + return mpWindowImpl ? mpWindowImpl->mnPrevStyle : 0; } WinBits Window::GetExtendedStyle() const { - return mpWindowImpl->mnExtendedStyle; + return mpWindowImpl ? mpWindowImpl->mnExtendedStyle : 0; } void Window::SetType( WindowType nType ) @@ -1120,22 +1122,22 @@ Dialog* Window::GetParentDialog() const bool Window::IsSystemWindow() const { - return mpWindowImpl->mbSysWin; + return mpWindowImpl ? mpWindowImpl->mbSysWin : false; } bool Window::IsDialog() const { - return mpWindowImpl->mbDialog; + return mpWindowImpl ? mpWindowImpl->mbDialog : false; } bool Window::IsMenuFloatingWindow() const { - return mpWindowImpl->mbMenuFloatingWindow; + return mpWindowImpl ? mpWindowImpl->mbMenuFloatingWindow : false; } bool Window::IsToolbarFloatingWindow() const { - return mpWindowImpl->mbToolbarFloatingWindow; + return mpWindowImpl ? mpWindowImpl->mbToolbarFloatingWindow : false; } void Window::EnableAllResize( bool bEnable ) @@ -1150,17 +1152,17 @@ void Window::EnableChildTransparentMode( bool bEnable ) bool Window::IsChildTransparentModeEnabled() const { - return mpWindowImpl->mbChildTransparent; + return mpWindowImpl ? mpWindowImpl->mbChildTransparent : false; } bool Window::IsMouseTransparent() const { - return mpWindowImpl->mbMouseTransparent; + return mpWindowImpl ? mpWindowImpl->mbMouseTransparent : false; } bool Window::IsPaintTransparent() const { - return mpWindowImpl->mbPaintTransparent; + return mpWindowImpl ? mpWindowImpl->mbPaintTransparent : false; } void Window::SetDialogControlStart( bool bStart ) @@ -1170,7 +1172,7 @@ void Window::SetDialogControlStart( bool bStart ) bool Window::IsDialogControlStart() const { - return mpWindowImpl->mbDlgCtrlStart; + return mpWindowImpl ? mpWindowImpl->mbDlgCtrlStart : false; } void Window::SetDialogControlFlags( sal_uInt16 nFlags ) |