]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/treectlg.cpp
compilation fix
[wxWidgets.git] / src / generic / treectlg.cpp
index 64e615f681265e10b08053d1ab5fa417486ba7e5..1994629da8f1d6999b60d4fabcef7a769ab690ca 100644 (file)
@@ -1201,6 +1201,11 @@ wxTreeItemId wxGenericTreeCtrl::AddRoot(const wxString& text,
 
     m_anchor = new wxGenericTreeItem((wxGenericTreeItem *)NULL, text,
                                    image, selImage, data);
+    if ( data != NULL )
+    {
+        data->m_pItem = (long) m_anchor;
+    }
+
     if (HasFlag(wxTR_HIDE_ROOT))
     {
         // if root is hidden, make sure we can navigate
@@ -1208,10 +1213,6 @@ wxTreeItemId wxGenericTreeCtrl::AddRoot(const wxString& text,
         m_anchor->SetHasPlus();
         Expand(m_anchor);
     }
-    if ( data != NULL )
-    {
-        data->m_pItem = (long) m_anchor;
-    }
 
     if (!HasFlag(wxTR_MULTIPLE))
     {