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
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();
}