Avoid collapsing the hidden root in wxTreeCtrl::CollapseAllChildren().
The hidden root item can't be collapsed so don't even try to do it as this just results in an assert. This is similar to the changes of r48097 in ExpandAllChildren(). Closes #12881. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66708 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
039aec5345
commit
06f1b70464
@ -323,8 +323,10 @@ void wxTreeCtrlBase::CollapseAllChildren(const wxTreeItemId& item)
|
||||
CollapseAllChildren(idCurr);
|
||||
}
|
||||
|
||||
// then collapse this element too
|
||||
Collapse(item);
|
||||
// then collapse this element too unless it's the hidden root which can't
|
||||
// be collapsed
|
||||
if ( item != GetRootItem() || !HasFlag(wxTR_HIDE_ROOT) )
|
||||
Collapse(item);
|
||||
Thaw();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user