From baca9020b83c09dc486e706a1e99060cf0dac063 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Thu, 16 Apr 2015 09:34:30 +0100 Subject: More protection for SvTreeListBox. Change-Id: I55731cd69aa12f5709e300759f556e29e8ceff5d --- svtools/source/contnr/treelistbox.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'svtools') diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index bc5e933e9b19..1091438dd0ce 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -2219,10 +2219,10 @@ void SvTreeListBox::GetFocus() void SvTreeListBox::LoseFocus() { - //If there is no item in the tree, delete visual focus. - if( !First()) + // If there is no item in the tree, delete visual focus. + if ( !First() ) Invalidate(); - if( pImp ) + if ( pImp ) pImp->LoseFocus(); Control::LoseFocus(); } @@ -3514,6 +3514,8 @@ void SvTreeListBox::NotifyScrolled() void SvTreeListBox::Invalidate( sal_uInt16 nInvalidateFlags ) { + if (!pImp) + return; if( nFocusWidth == -1 ) // to make sure that the control doesn't show the wrong focus rectangle // after painting -- cgit