From 11f20f99ee9593276c96f9fbebc3aa190dae01a0 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 21 Jan 2009 14:53:50 +0000 Subject: [PATCH 1/1] iter = NULL in iter_n_children() means root git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58266 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/dataview.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index 9d9e7d47fa..58bdbbb501 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -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); - 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 ); } @@ -3343,6 +3345,9 @@ gint wxDataViewCtrlInternal::iter_n_children( GtkTreeIter *iter ) } else { + if (iter == NULL) + return m_root->GetChildCount(); + wxDataViewItem item( (void*) iter->user_data ); if (!m_wx_model->IsContainer( item )) -- 2.45.2