From 2a69b4e84936e8c06cc611a8f8d75c4dd2f1e70c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 26 Mar 2007 13:07:15 +0000 Subject: [PATCH] assert if AddRoot() is called twice for a wxTR_HIDE_ROOT tree git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45061 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/treectrl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 948d9878fa..3a83d4f057 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -1481,9 +1481,10 @@ wxTreeItemId wxTreeCtrl::AddRoot(const wxString& text, int image, int selectedImage, wxTreeItemData *data) { - if ( HasFlag(wxTR_HIDE_ROOT) ) { + wxASSERT_MSG( !m_pVirtualRoot, _T("tree can have only a single root") ); + // create a virtual root item, the parent for all the others wxTreeItemParam *param = new wxTreeItemParam; param->SetData(data); -- 2.45.2