diff --git a/ChangeLog b/ChangeLog index bc04a321dd..7d526c5a7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-11-03 Matthias Clasen + + * gtk/gtkliststore.c (gtk_list_store_move): Take into account + that a can be NULL even if position is not. This fixes the + inability of gtk_list_store_move() to move rows to the very + beginning. (#155545, John Finlay) + 2004-11-01 Matthias Clasen * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Don't crash on diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index bc04a321dd..7d526c5a7a 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +2004-11-03 Matthias Clasen + + * gtk/gtkliststore.c (gtk_list_store_move): Take into account + that a can be NULL even if position is not. This fixes the + inability of gtk_list_store_move() to move rows to the very + beginning. (#155545, John Finlay) + 2004-11-01 Matthias Clasen * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Don't crash on diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index bc04a321dd..7d526c5a7a 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +2004-11-03 Matthias Clasen + + * gtk/gtkliststore.c (gtk_list_store_move): Take into account + that a can be NULL even if position is not. This fixes the + inability of gtk_list_store_move() to move rows to the very + beginning. (#155545, John Finlay) + 2004-11-01 Matthias Clasen * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Don't crash on diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index bc04a321dd..7d526c5a7a 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +2004-11-03 Matthias Clasen + + * gtk/gtkliststore.c (gtk_list_store_move): Take into account + that a can be NULL even if position is not. This fixes the + inability of gtk_list_store_move() to move rows to the very + beginning. (#155545, John Finlay) + 2004-11-01 Matthias Clasen * gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Don't crash on diff --git a/gtk/gtkliststore.c b/gtk/gtkliststore.c index 2f20030f79..a833ecf4ac 100644 --- a/gtk/gtkliststore.c +++ b/gtk/gtkliststore.c @@ -1867,12 +1867,12 @@ gtk_list_store_move (GtkListStore *store, if (a == iter->user_data) goto free_paths_and_out; } - else if (before) + else if (before && !position) { if (iter->user_data == store->tail) goto free_paths_and_out; } - else + else if (!position) { if (iter->user_data == store->root) goto free_paths_and_out; @@ -1920,8 +1920,16 @@ gtk_list_store_move (GtkListStore *store, } else if (!a && before) { - G_SLIST (store->tail)->next = G_SLIST (iter->user_data); - G_SLIST (iter->user_data)->next = NULL; + if (position) + { + G_SLIST (iter->user_data)->next = G_SLIST (store->root); + store->root = G_SLIST (iter->user_data); + } + else + { + G_SLIST (store->tail)->next = G_SLIST (iter->user_data); + G_SLIST (iter->user_data)->next = NULL; + } } /* update tail if needed */