diff --git a/ChangeLog b/ChangeLog index 46fa78cc66..42267390ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2002-05-10 Daniel Elstner + + [ merge from stable ] + + * gtk/gtktreemodel.c: #define INITIALIZE_TREE_ITER(), + which zeroes out all GtkTreeIter fields. (#81380) + (gtk_tree_model_get_iter): Use it. + (gtk_tree_model_iter_children): ditto + (gtk_tree_model_iter_nth_child): ditto + (gtk_tree_model_iter_parent): ditto + 2002-05-08 Michael Natterer * configure.in: fixed yesterdays fix for cross compiling: simply diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 46fa78cc66..42267390ee 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,14 @@ +2002-05-10 Daniel Elstner + + [ merge from stable ] + + * gtk/gtktreemodel.c: #define INITIALIZE_TREE_ITER(), + which zeroes out all GtkTreeIter fields. (#81380) + (gtk_tree_model_get_iter): Use it. + (gtk_tree_model_iter_children): ditto + (gtk_tree_model_iter_nth_child): ditto + (gtk_tree_model_iter_parent): ditto + 2002-05-08 Michael Natterer * configure.in: fixed yesterdays fix for cross compiling: simply diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 46fa78cc66..42267390ee 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,14 @@ +2002-05-10 Daniel Elstner + + [ merge from stable ] + + * gtk/gtktreemodel.c: #define INITIALIZE_TREE_ITER(), + which zeroes out all GtkTreeIter fields. (#81380) + (gtk_tree_model_get_iter): Use it. + (gtk_tree_model_iter_children): ditto + (gtk_tree_model_iter_nth_child): ditto + (gtk_tree_model_iter_parent): ditto + 2002-05-08 Michael Natterer * configure.in: fixed yesterdays fix for cross compiling: simply diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 46fa78cc66..42267390ee 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,14 @@ +2002-05-10 Daniel Elstner + + [ merge from stable ] + + * gtk/gtktreemodel.c: #define INITIALIZE_TREE_ITER(), + which zeroes out all GtkTreeIter fields. (#81380) + (gtk_tree_model_get_iter): Use it. + (gtk_tree_model_iter_children): ditto + (gtk_tree_model_iter_nth_child): ditto + (gtk_tree_model_iter_parent): ditto + 2002-05-08 Michael Natterer * configure.in: fixed yesterdays fix for cross compiling: simply diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 46fa78cc66..42267390ee 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,14 @@ +2002-05-10 Daniel Elstner + + [ merge from stable ] + + * gtk/gtktreemodel.c: #define INITIALIZE_TREE_ITER(), + which zeroes out all GtkTreeIter fields. (#81380) + (gtk_tree_model_get_iter): Use it. + (gtk_tree_model_iter_children): ditto + (gtk_tree_model_iter_nth_child): ditto + (gtk_tree_model_iter_parent): ditto + 2002-05-08 Michael Natterer * configure.in: fixed yesterdays fix for cross compiling: simply diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 46fa78cc66..42267390ee 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,14 @@ +2002-05-10 Daniel Elstner + + [ merge from stable ] + + * gtk/gtktreemodel.c: #define INITIALIZE_TREE_ITER(), + which zeroes out all GtkTreeIter fields. (#81380) + (gtk_tree_model_get_iter): Use it. + (gtk_tree_model_iter_children): ditto + (gtk_tree_model_iter_nth_child): ditto + (gtk_tree_model_iter_parent): ditto + 2002-05-08 Michael Natterer * configure.in: fixed yesterdays fix for cross compiling: simply diff --git a/gtk/gtktreemodel.c b/gtk/gtktreemodel.c index 925c4eb77a..d09f56c7e9 100644 --- a/gtk/gtktreemodel.c +++ b/gtk/gtktreemodel.c @@ -29,6 +29,15 @@ #include "gtksignal.h" +#define INITIALIZE_TREE_ITER(Iter) \ + G_STMT_START{ \ + (Iter)->stamp = 0; \ + (Iter)->user_data = NULL; \ + (Iter)->user_data2 = NULL; \ + (Iter)->user_data3 = NULL; \ + }G_STMT_END + + struct _GtkTreePath { gint depth; @@ -674,6 +683,8 @@ gtk_tree_model_get_iter (GtkTreeModel *tree_model, g_return_val_if_fail (GTK_TREE_MODEL_GET_IFACE (tree_model)->get_iter != NULL, FALSE); g_return_val_if_fail (path->depth > 0, FALSE); + INITIALIZE_TREE_ITER (iter); + return (* GTK_TREE_MODEL_GET_IFACE (tree_model)->get_iter) (tree_model, iter, path); } @@ -825,6 +836,8 @@ gtk_tree_model_iter_children (GtkTreeModel *tree_model, g_return_val_if_fail (iter != NULL, FALSE); g_return_val_if_fail (GTK_TREE_MODEL_GET_IFACE (tree_model)->iter_children != NULL, FALSE); + INITIALIZE_TREE_ITER (iter); + return (* GTK_TREE_MODEL_GET_IFACE (tree_model)->iter_children) (tree_model, iter, parent); } @@ -894,6 +907,8 @@ gtk_tree_model_iter_nth_child (GtkTreeModel *tree_model, g_return_val_if_fail (n >= 0, FALSE); g_return_val_if_fail (GTK_TREE_MODEL_GET_IFACE (tree_model)->iter_nth_child != NULL, FALSE); + INITIALIZE_TREE_ITER (iter); + return (* GTK_TREE_MODEL_GET_IFACE (tree_model)->iter_nth_child) (tree_model, iter, parent, n); } @@ -920,6 +935,8 @@ gtk_tree_model_iter_parent (GtkTreeModel *tree_model, g_return_val_if_fail (child != NULL, FALSE); g_return_val_if_fail (GTK_TREE_MODEL_GET_IFACE (tree_model)->iter_parent != NULL, FALSE); + INITIALIZE_TREE_ITER (iter); + return (* GTK_TREE_MODEL_GET_IFACE (tree_model)->iter_parent) (tree_model, iter, child); }