fix for crash in wxTreeCtrl::GetSelections() when the tree is empty
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1414,7 +1414,12 @@ void wxTreeCtrl::FillArray(wxGenericTreeItem *item,
|
|||||||
size_t wxTreeCtrl::GetSelections(wxArrayTreeItemIds &array) const
|
size_t wxTreeCtrl::GetSelections(wxArrayTreeItemIds &array) const
|
||||||
{
|
{
|
||||||
array.Empty();
|
array.Empty();
|
||||||
FillArray(GetRootItem().m_pItem, array);
|
wxTreeItemId idRoot = GetRootItem();
|
||||||
|
if ( idRoot.IsOk() )
|
||||||
|
{
|
||||||
|
FillArray(idRoot.m_pItem, array);
|
||||||
|
}
|
||||||
|
//else: the tree is empty, so no selections
|
||||||
|
|
||||||
return array.Count();
|
return array.Count();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user