From 3f0635b3506c0825aac53d5b586689a2f6b5b4fc Mon Sep 17 00:00:00 2001 From: Maxim Monastirsky Date: Mon, 2 May 2016 00:19:50 +0300 Subject: tdf#99338 Fix GrabFocus during dispose crashes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I309e1e5f0d28c408c8a95190bf645abf680491b6 (cherry picked from commit 097bf754c09e8b1ba57e3367baa010898611b61b) Reviewed-on: https://gerrit.libreoffice.org/24794 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- svx/source/tbxctrls/linectrl.cxx | 3 ++- svx/source/tbxctrls/tbcontrl.cxx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx index 6f66d5cd4226..314b95fc3efa 100644 --- a/svx/source/tbxctrls/linectrl.cxx +++ b/svx/source/tbxctrls/linectrl.cxx @@ -595,7 +595,8 @@ void SvxLineEndWindow::GetFocus() SfxPopupWindow::GetFocus(); // Grab the focus to the line ends value set so that it can be controlled // with the keyboard. - aLineEndSet->GrabFocus(); + if ( aLineEndSet ) + aLineEndSet->GrabFocus(); } SvxLineEndToolBoxControl::SvxLineEndToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) : diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index ce7d8777273b..e850661720fb 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -1943,7 +1943,8 @@ vcl::Window* SvxLineWindow_Impl::GetPreferredKeyInputWindow() void SvxLineWindow_Impl::GetFocus() { - m_aLineStyleLb->GrabFocus(); + if ( m_aLineStyleLb ) + m_aLineStyleLb->GrabFocus(); } void SvxLineWindow_Impl::DataChanged( const DataChangedEvent& rDCEvt ) -- cgit v1.2.3