diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-04-14 20:59:00 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-14 21:06:47 +0100 |
commit | 35237cb348d22c60dbde4b3378f7eab5546631d3 (patch) | |
tree | 5848733749dee49a23af543e2b1900aeea151f35 | |
parent | e8eed1d31dedd28cfe649d18d09de3b77add6f10 (diff) |
Help SvTreeListBox survive post dispose.
Change-Id: I7a4aca5918b2bdadc32810a84afb84477e97fd2e
-rw-r--r-- | include/svtools/treelistbox.hxx | 6 | ||||
-rw-r--r-- | svtools/source/contnr/treelistbox.cxx | 5 |
2 files changed, 5 insertions, 6 deletions
diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx index ed81c3700501..56ffb5161b23 100644 --- a/include/svtools/treelistbox.hxx +++ b/include/svtools/treelistbox.hxx @@ -349,11 +349,11 @@ public: sal_uLong GetEntryCount() const { - return pModel->GetEntryCount(); + return pModel ? pModel->GetEntryCount() : 0; } SvTreeListEntry* First() const { - return pModel->First(); + return pModel ? pModel->First() : NULL; } SvTreeListEntry* Next( SvTreeListEntry* pEntry, sal_uInt16* pDepth = 0 ) const { @@ -365,7 +365,7 @@ public: } SvTreeListEntry* Last() const { - return pModel->Last(); + return pModel ? pModel->Last() : NULL; } SvTreeListEntry* FirstChild( SvTreeListEntry* pParent ) const; diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index b4861c3daa20..bc5e933e9b19 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -2221,10 +2221,9 @@ void SvTreeListBox::LoseFocus() { //If there is no item in the tree, delete visual focus. if( !First()) - { Invalidate(); - } - pImp->LoseFocus(); + if( pImp ) + pImp->LoseFocus(); Control::LoseFocus(); } |