Bug 573321 – additional check in gtk_tree_model_filter_convert_*

Added checks to see whether the passed iterators are not the same in
convert_child_iter_to_iter() and iter_to_child_iter() functions in both
the sort and filter models.

Fixes bug 573321, suggestion by Vadim Godunko.
This commit is contained in:
Kristian Rietveld 2009-07-30 14:35:09 +02:00
parent 069a593b0f
commit bce2a5173d
2 changed files with 4 additions and 0 deletions

View File

@ -3037,6 +3037,7 @@ gtk_tree_model_filter_convert_child_iter_to_iter (GtkTreeModelFilter *filter,
g_return_val_if_fail (filter->priv->child_model != NULL, FALSE);
g_return_val_if_fail (filter_iter != NULL, FALSE);
g_return_val_if_fail (child_iter != NULL, FALSE);
g_return_val_if_fail (filter_iter != child_iter, FALSE);
filter_iter->stamp = 0;
@ -3076,6 +3077,7 @@ gtk_tree_model_filter_convert_iter_to_child_iter (GtkTreeModelFilter *filter,
g_return_if_fail (child_iter != NULL);
g_return_if_fail (filter_iter != NULL);
g_return_if_fail (filter_iter->stamp == filter->priv->stamp);
g_return_if_fail (filter_iter != child_iter);
if (GTK_TREE_MODEL_FILTER_CACHE_CHILD_ITERS (filter))
{

View File

@ -2084,6 +2084,7 @@ gtk_tree_model_sort_convert_child_iter_to_iter (GtkTreeModelSort *tree_model_sor
g_return_val_if_fail (tree_model_sort->child_model != NULL, FALSE);
g_return_val_if_fail (sort_iter != NULL, FALSE);
g_return_val_if_fail (child_iter != NULL, FALSE);
g_return_val_if_fail (sort_iter != child_iter, FALSE);
sort_iter->stamp = 0;
@ -2182,6 +2183,7 @@ gtk_tree_model_sort_convert_iter_to_child_iter (GtkTreeModelSort *tree_model_sor
g_return_if_fail (tree_model_sort->child_model != NULL);
g_return_if_fail (child_iter != NULL);
g_return_if_fail (VALID_ITER (sorted_iter, tree_model_sort));
g_return_if_fail (sorted_iter != child_iter);
if (GTK_TREE_MODEL_SORT_CACHE_CHILD_ITERS (tree_model_sort))
{