X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f313deaa38ebd9d8a9a2755a105e12999dd5493c..f4d084afdacb64aa4fe8330613c97d88fa2506ce:/src/common/treebase.cpp diff --git a/src/common/treebase.cpp b/src/common/treebase.cpp index e573f9cec9..57cfed1d19 100644 --- a/src/common/treebase.cpp +++ b/src/common/treebase.cpp @@ -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(); }