After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 679910 - GtkTreeModelFilter: Fix _iter_previous() when iter points at 2nd node
GtkTreeModelFilter: Fix _iter_previous() when iter points at 2nd node
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
unspecified
Other All
: High critical
: ---
Assigned To: gtktreeview-bugs
gtktreeview-bugs
Depends on:
Blocks:
 
 
Reported: 2012-07-14 03:51 UTC by Rui Matos
Modified: 2012-07-17 08:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GtkTreeModelFilter: Fix _iter_previous() when iter points at 2nd node (1.32 KB, patch)
2012-07-14 03:51 UTC, Rui Matos
none Details | Review
tests/filtermodel: Add test for bug 679910 (1.80 KB, patch)
2012-07-16 23:50 UTC, Rui Matos
none Details | Review

Description Rui Matos 2012-07-14 03:51:13 UTC
Patch attached.
Comment 1 Rui Matos 2012-07-14 03:51:15 UTC
Created attachment 218785 [details] [review]
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.
Comment 2 Kristian Rietveld 2012-07-14 11:48:31 UTC
Could you also extend the unit tests for test for this?  (gtk/tests/filtermodel.c)
Comment 3 Rui Matos 2012-07-16 23:50:43 UTC
Created attachment 218957 [details] [review]
tests/filtermodel: Add test for bug 679910

--
(In reply to comment #2)
> Could you also extend the unit tests for test for this?
> (gtk/tests/filtermodel.c)

Sure, here it is.
Comment 4 Kristian Rietveld 2012-07-17 08:51:55 UTC
> Sure, here it is.

Thanks!
Comment 5 Kristian Rietveld 2012-07-17 08:55:11 UTC
Pushed to master and gtk-3-4.