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

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62094 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2009-09-24 17:04:44 +00:00
parent c25bb73116
commit 5b806097fd

View File

@@ -785,19 +785,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)