Applied #11106: wxGenericDirCtrl can get into a state where it will no longer expand

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@62093 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2009-09-24 17:04:10 +00:00
parent 0b02609ffe
commit 620de0dfbe

View File

@@ -768,19 +768,12 @@ void wxGenericDirCtrl::CollapseDir(wxTreeItemId parentId)
return;
data->m_isExpanded = false;
wxTreeItemIdValue cookie;
/* Workaround because DeleteChildren has disapeared (why?) and
* CollapseAndReset doesn't work as advertised (deletes parent too) */
child = m_treeCtrl->GetFirstChild(parentId, cookie);
while (child.IsOk())
{
m_treeCtrl->Delete(child);
/* Not GetNextChild below, because the cookie mechanism can't
* handle disappearing children! */
child = m_treeCtrl->GetFirstChild(parentId, cookie);
}
m_treeCtrl->Freeze();
if (parentId != m_treeCtrl->GetRootItem())
m_treeCtrl->Collapse(parentId);
m_treeCtrl->CollapseAndReset(parentId);
m_treeCtrl->DeleteChildren(parentId);
m_treeCtrl->Thaw();
}
void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId)