[gtk+] Bug 573321 – additional check in gtk_tree_model_filter_convert_*
- From: Kristian Rietveld <kristian src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+] Bug 573321 – additional check in gtk_tree_model_filter_convert_*
- Date: Thu, 30 Jul 2009 18:25:23 +0000 (UTC)
commit bce2a5173de6dea42d7cfeee88ab84f8cc6c95b0
Author: Kristian Rietveld <kris gtk org>
Date: Thu Jul 30 14:35:09 2009 +0200
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.
gtk/gtktreemodelfilter.c | 2 ++
gtk/gtktreemodelsort.c | 2 ++
2 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtktreemodelfilter.c b/gtk/gtktreemodelfilter.c
index cc5b86e..c865fcc 100644
--- a/gtk/gtktreemodelfilter.c
+++ b/gtk/gtktreemodelfilter.c
@@ -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))
{
diff --git a/gtk/gtktreemodelsort.c b/gtk/gtktreemodelsort.c
index 1dbdda4..4525bca 100644
--- a/gtk/gtktreemodelsort.c
+++ b/gtk/gtktreemodelsort.c
@@ -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))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]