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
This commit is contained in:
Rui Matos 2012-07-14 02:34:26 +02:00 committed by Kristian Rietveld
parent 96c19108fc
commit eaddf70a43

View File

@ -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);