Help SvTreeListBox survive post dispose.

Change-Id: I7a4aca5918b2bdadc32810a84afb84477e97fd2e
diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
index ed81c37..56ffb51 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 b4861c3..bc5e933e 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();
}