diff options
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 11 | ||||
-rw-r--r-- | vcl/source/window/window2.cxx | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index cd93f9b4dd55..cb8194c1cabf 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -679,9 +679,7 @@ namespace { std::unique_ptr<LOKAsyncEventData> pLOKEv(static_cast<LOKAsyncEventData*>(pEv)); if (pLOKEv->mpWindow->isDisposed()) - { return; - } int nView = SfxLokHelper::getView(nullptr); if (nView != pLOKEv->mnView) @@ -700,6 +698,9 @@ namespace if (!pFocusWindow) pFocusWindow = pLOKEv->mpWindow; + if (pLOKEv->mpWindow->isDisposed()) + return; + switch (pLOKEv->mnEvent) { case VclEventId::WindowKeyInput: @@ -708,11 +709,13 @@ namespace KeyEvent singlePress(pLOKEv->maKeyEvent.GetCharCode(), pLOKEv->maKeyEvent.GetKeyCode()); for (sal_uInt16 i = 0; i <= nRepeat; ++i) - pFocusWindow->KeyInput(singlePress); + if (!pFocusWindow->isDisposed()) + pFocusWindow->KeyInput(singlePress); break; } case VclEventId::WindowKeyUp: - pFocusWindow->KeyUp(pLOKEv->maKeyEvent); + if (!pFocusWindow->isDisposed()) + pFocusWindow->KeyUp(pLOKEv->maKeyEvent); break; case VclEventId::WindowMouseButtonDown: pLOKEv->mpWindow->LogicMouseButtonDown(pLOKEv->maMouseEvent); diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index af4aeb10a564..1383bad0888f 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -311,7 +311,7 @@ void Window::EndTracking( TrackingEventFlags nFlags ) bool Window::IsTracking() const { - return (ImplGetSVData()->mpWinData->mpTrackWin == this); + return mpWindowImpl && (ImplGetSVData()->mpWinData->mpTrackWin == this); } void Window::StartAutoScroll( StartAutoScrollFlags nFlags ) |