]> git.saurik.com Git - wxWidgets.git/commitdiff
iter = NULL in iter_n_children() means root
authorRobert Roebling <robert@roebling.de>
Wed, 21 Jan 2009 14:53:50 +0000 (14:53 +0000)
committerRobert Roebling <robert@roebling.de>
Wed, 21 Jan 2009 14:53:50 +0000 (14:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58266 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/dataview.cpp

index 9d9e7d47fa9c4e39ac5477eacc80ac7f2fe6efc4..58bdbbb501293a8bdf0e82d73c48a9a110be32da 100644 (file)
@@ -641,8 +641,10 @@ wxgtk_tree_model_iter_n_children (GtkTreeModel *tree_model,
 {
     GtkWxTreeModel *wxtree_model = (GtkWxTreeModel *) tree_model;
     g_return_val_if_fail (GTK_IS_WX_TREE_MODEL (wxtree_model), FALSE);
 {
     GtkWxTreeModel *wxtree_model = (GtkWxTreeModel *) tree_model;
     g_return_val_if_fail (GTK_IS_WX_TREE_MODEL (wxtree_model), FALSE);
-    g_return_val_if_fail (wxtree_model->stamp == iter->stamp, 0);
-
+    
+    if (iter != NULL)
+        g_return_val_if_fail (wxtree_model->stamp == iter->stamp, 0);
+        
     return wxtree_model->internal->iter_n_children( iter );
 }
 
     return wxtree_model->internal->iter_n_children( iter );
 }
 
@@ -3343,6 +3345,9 @@ gint wxDataViewCtrlInternal::iter_n_children( GtkTreeIter *iter )
     }
     else
     {
     }
     else
     {
+        if (iter == NULL)
+            return m_root->GetChildCount();
+            
         wxDataViewItem item( (void*) iter->user_data );
 
         if (!m_wx_model->IsContainer( item ))
         wxDataViewItem item( (void*) iter->user_data );
 
         if (!m_wx_model->IsContainer( item ))