[gtk+/composite-templates] GtkTreeModelFilter: Fix _iter_previous() when iter points at 2nd node
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/composite-templates] GtkTreeModelFilter: Fix _iter_previous() when iter points at 2nd node
- Date: Thu, 26 Jul 2012 11:52:27 +0000 (UTC)
commit a6f81334a023238806c63f62b5879b80aea5af22
Author: Rui Matos <tiagomatos gmail com>
Date: Sat Jul 14 02:34:26 2012 +0200
GtkTreeModelFilter: Fix _iter_previous() when iter points at 2nd node
GSequence iterators point at the position between two elements so an
iterator pointing at the N tree model node is actually between the N-1
and N sequence elements. This means that asking for the previous
sequence iterator first and then checking if it is the begin iterator
would yeld true for an iterator pointing at the 2nd tree model node
and make us return FALSE mistakenly.
https://bugzilla.gnome.org/show_bug.cgi?id=679910
gtk/gtktreemodelfilter.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtktreemodelfilter.c b/gtk/gtktreemodelfilter.c
index 2e7d218..a8ef24b 100644
--- a/gtk/gtktreemodelfilter.c
+++ b/gtk/gtktreemodelfilter.c
@@ -3227,12 +3227,12 @@ gtk_tree_model_filter_iter_previous (GtkTreeModel *model,
elt = iter->user_data2;
- siter = g_sequence_iter_prev (elt->visible_siter);
- if (g_sequence_iter_is_begin (siter))
+ if (g_sequence_iter_is_begin (elt->visible_siter))
{
iter->stamp = 0;
return FALSE;
}
+ siter = g_sequence_iter_prev (elt->visible_siter);
iter->user_data2 = GET_ELT (siter);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]