From: Vadim Zeitlin Date: Thu, 9 Mar 2000 16:19:35 +0000 (+0000) Subject: don't allow multiple root in the tree X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0e93516996cf2bd0a6023b548c95fc32789fa4a7?ds=inline don't allow multiple root in the tree git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6540 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index f231242b85..7f8403c58f 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -1198,6 +1198,10 @@ wxTreeItemId wxTreeCtrl::DoInsertItem(const wxTreeItemId& parent, int image, int selectedImage, wxTreeItemData *data) { + wxCHECK_MSG( parent.IsOk() || !TreeView_GetRoot(GetHwnd()), + wxTreeItemId(), + _T("can't have more than one root in the tree") ); + TV_INSERTSTRUCT tvIns; tvIns.hParent = HITEM(parent); tvIns.hInsertAfter = HITEM(hInsertAfter);