]> git.saurik.com Git - wxWidgets.git/commitdiff
assert if AddRoot() is called twice for a wxTR_HIDE_ROOT tree
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 26 Mar 2007 13:07:15 +0000 (13:07 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 26 Mar 2007 13:07:15 +0000 (13:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45061 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/treectrl.cpp

index 948d9878fabafa9a88aec4aa0345a7361f67a2da..3a83d4f0574015b73fd3a5595a1d6bbc78882e16 100644 (file)
@@ -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);