X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f313deaa38ebd9d8a9a2755a105e12999dd5493c..b404a8f3b072129c107c6d9a5e0f6f53cd34807b:/src/common/treebase.cpp diff --git a/src/common/treebase.cpp b/src/common/treebase.cpp index e573f9cec9..483360b472 100644 --- a/src/common/treebase.cpp +++ b/src/common/treebase.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: treebase.cpp +// Name: src/common/treebase.cpp // Purpose: Base wxTreeCtrl classes // Author: Julian Smart // Created: 01/02/97 @@ -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(); }