mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
If the item is already in the right place, don't move it. Bug #157670.
Mon Nov 29 17:51:51 2004 Søren Sandmann <sandmann@redhat.com> * gtk/gtksequence.c (_gtk_sequence_sort_changed): If the item is already in the right place, don't move it. Bug #157670. * gtk/gtksequence.c (already_in_place): New function
This commit is contained in:
parent
f688fff60a
commit
f985442ade
@ -1,3 +1,10 @@
|
||||
Mon Nov 29 17:51:51 2004 Søren Sandmann <sandmann@redhat.com>
|
||||
|
||||
* gtk/gtksequence.c (_gtk_sequence_sort_changed): If the item is
|
||||
already in the right place, don't move it. Bug #157670.
|
||||
|
||||
* gtk/gtksequence.c (already_in_place): New function
|
||||
|
||||
Mon Nov 29 17:28:53 2004 Søren Sandmann <sandmann@redhat.com>
|
||||
|
||||
* gtk/gtksequence.c (_gtk_sequence_sort): Take nodes in reverse
|
||||
|
@ -1,3 +1,10 @@
|
||||
Mon Nov 29 17:51:51 2004 Søren Sandmann <sandmann@redhat.com>
|
||||
|
||||
* gtk/gtksequence.c (_gtk_sequence_sort_changed): If the item is
|
||||
already in the right place, don't move it. Bug #157670.
|
||||
|
||||
* gtk/gtksequence.c (already_in_place): New function
|
||||
|
||||
Mon Nov 29 17:28:53 2004 Søren Sandmann <sandmann@redhat.com>
|
||||
|
||||
* gtk/gtksequence.c (_gtk_sequence_sort): Take nodes in reverse
|
||||
|
@ -1,3 +1,10 @@
|
||||
Mon Nov 29 17:51:51 2004 Søren Sandmann <sandmann@redhat.com>
|
||||
|
||||
* gtk/gtksequence.c (_gtk_sequence_sort_changed): If the item is
|
||||
already in the right place, don't move it. Bug #157670.
|
||||
|
||||
* gtk/gtksequence.c (already_in_place): New function
|
||||
|
||||
Mon Nov 29 17:28:53 2004 Søren Sandmann <sandmann@redhat.com>
|
||||
|
||||
* gtk/gtksequence.c (_gtk_sequence_sort): Take nodes in reverse
|
||||
|
@ -1,3 +1,10 @@
|
||||
Mon Nov 29 17:51:51 2004 Søren Sandmann <sandmann@redhat.com>
|
||||
|
||||
* gtk/gtksequence.c (_gtk_sequence_sort_changed): If the item is
|
||||
already in the right place, don't move it. Bug #157670.
|
||||
|
||||
* gtk/gtksequence.c (already_in_place): New function
|
||||
|
||||
Mon Nov 29 17:28:53 2004 Søren Sandmann <sandmann@redhat.com>
|
||||
|
||||
* gtk/gtksequence.c (_gtk_sequence_sort): Take nodes in reverse
|
||||
|
@ -448,6 +448,25 @@ _gtk_sequence_ptr_move (GtkSequencePtr ptr,
|
||||
return _gtk_sequence_node_find_by_pos (ptr, new_pos);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
already_in_place (GtkSequencePtr ptr,
|
||||
GCompareDataFunc cmp_func,
|
||||
gpointer data)
|
||||
{
|
||||
SortInfo info;
|
||||
|
||||
info.cmp = cmp_func;
|
||||
info.data = data;
|
||||
|
||||
if (node_compare (_gtk_sequence_node_prev (ptr), ptr, &info) <= 0 &&
|
||||
node_compare (_gtk_sequence_node_next (ptr), ptr, &info) >= 0)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
_gtk_sequence_sort_changed (GtkSequencePtr ptr,
|
||||
GCompareDataFunc cmp_func,
|
||||
@ -455,8 +474,12 @@ _gtk_sequence_sort_changed (GtkSequencePtr ptr,
|
||||
|
||||
{
|
||||
GtkSequence *seq;
|
||||
|
||||
|
||||
g_return_if_fail (ptr != NULL);
|
||||
g_return_if_fail (!ptr->is_end);
|
||||
|
||||
if (already_in_place (ptr, cmp_func, cmp_data))
|
||||
return;
|
||||
|
||||
seq = _gtk_sequence_node_get_sequence (ptr);
|
||||
_gtk_sequence_unlink (seq, ptr);
|
||||
|
Loading…
Reference in New Issue
Block a user