]> Pileus Git - ~andy/gtk/commitdiff
Bugfix from Brandon Long <blong@fiction.net> - Do the intended thing with
authorJeff Garzik <jgarzik@src.gnome.org>
Tue, 24 Nov 1998 04:25:38 +0000 (04:25 +0000)
committerJeff Garzik <jgarzik@src.gnome.org>
Tue, 24 Nov 1998 04:25:38 +0000 (04:25 +0000)
* gtk/gtkclist.c: (gtk_clist_swap_rows):
Bugfix from Brandon Long <blong@fiction.net> -
Do the intended thing with 'first' and 'last' list index

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkclist.c

index c59e0bef2c2b807d4959ae67de9eb7f691b18b3a..d3f679686710fdae08ae83f25b88e4f9376872f3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+1998-11-23  Jeff Garzik  <jgarzik@pobox.com>
+
+       * gtk/gtkclist.c: (gtk_clist_swap_rows):  Bugfix from
+       Brandon Long <blong@fiction.net> - do the right thing with first
+       and last, which are the absolute values of row arguments row1
+       and row2.
+
 Mon Nov 23 04:24:55 PST 1998 Manish Singh <yosh@gimp.org>
 
        * gtk/gtkprogress.c: (gtk_progress_set_adjustment): make a saner
index c59e0bef2c2b807d4959ae67de9eb7f691b18b3a..d3f679686710fdae08ae83f25b88e4f9376872f3 100644 (file)
@@ -1,3 +1,10 @@
+1998-11-23  Jeff Garzik  <jgarzik@pobox.com>
+
+       * gtk/gtkclist.c: (gtk_clist_swap_rows):  Bugfix from
+       Brandon Long <blong@fiction.net> - do the right thing with first
+       and last, which are the absolute values of row arguments row1
+       and row2.
+
 Mon Nov 23 04:24:55 PST 1998 Manish Singh <yosh@gimp.org>
 
        * gtk/gtkprogress.c: (gtk_progress_set_adjustment): make a saner
index c59e0bef2c2b807d4959ae67de9eb7f691b18b3a..d3f679686710fdae08ae83f25b88e4f9376872f3 100644 (file)
@@ -1,3 +1,10 @@
+1998-11-23  Jeff Garzik  <jgarzik@pobox.com>
+
+       * gtk/gtkclist.c: (gtk_clist_swap_rows):  Bugfix from
+       Brandon Long <blong@fiction.net> - do the right thing with first
+       and last, which are the absolute values of row arguments row1
+       and row2.
+
 Mon Nov 23 04:24:55 PST 1998 Manish Singh <yosh@gimp.org>
 
        * gtk/gtkprogress.c: (gtk_progress_set_adjustment): make a saner
index c59e0bef2c2b807d4959ae67de9eb7f691b18b3a..d3f679686710fdae08ae83f25b88e4f9376872f3 100644 (file)
@@ -1,3 +1,10 @@
+1998-11-23  Jeff Garzik  <jgarzik@pobox.com>
+
+       * gtk/gtkclist.c: (gtk_clist_swap_rows):  Bugfix from
+       Brandon Long <blong@fiction.net> - do the right thing with first
+       and last, which are the absolute values of row arguments row1
+       and row2.
+
 Mon Nov 23 04:24:55 PST 1998 Manish Singh <yosh@gimp.org>
 
        * gtk/gtkprogress.c: (gtk_progress_set_adjustment): make a saner
index c59e0bef2c2b807d4959ae67de9eb7f691b18b3a..d3f679686710fdae08ae83f25b88e4f9376872f3 100644 (file)
@@ -1,3 +1,10 @@
+1998-11-23  Jeff Garzik  <jgarzik@pobox.com>
+
+       * gtk/gtkclist.c: (gtk_clist_swap_rows):  Bugfix from
+       Brandon Long <blong@fiction.net> - do the right thing with first
+       and last, which are the absolute values of row arguments row1
+       and row2.
+
 Mon Nov 23 04:24:55 PST 1998 Manish Singh <yosh@gimp.org>
 
        * gtk/gtkprogress.c: (gtk_progress_set_adjustment): make a saner
index c59e0bef2c2b807d4959ae67de9eb7f691b18b3a..d3f679686710fdae08ae83f25b88e4f9376872f3 100644 (file)
@@ -1,3 +1,10 @@
+1998-11-23  Jeff Garzik  <jgarzik@pobox.com>
+
+       * gtk/gtkclist.c: (gtk_clist_swap_rows):  Bugfix from
+       Brandon Long <blong@fiction.net> - do the right thing with first
+       and last, which are the absolute values of row arguments row1
+       and row2.
+
 Mon Nov 23 04:24:55 PST 1998 Manish Singh <yosh@gimp.org>
 
        * gtk/gtkprogress.c: (gtk_progress_set_adjustment): make a saner
index c59e0bef2c2b807d4959ae67de9eb7f691b18b3a..d3f679686710fdae08ae83f25b88e4f9376872f3 100644 (file)
@@ -1,3 +1,10 @@
+1998-11-23  Jeff Garzik  <jgarzik@pobox.com>
+
+       * gtk/gtkclist.c: (gtk_clist_swap_rows):  Bugfix from
+       Brandon Long <blong@fiction.net> - do the right thing with first
+       and last, which are the absolute values of row arguments row1
+       and row2.
+
 Mon Nov 23 04:24:55 PST 1998 Manish Singh <yosh@gimp.org>
 
        * gtk/gtkprogress.c: (gtk_progress_set_adjustment): make a saner
index c363421664bd1a1b48ebd0da55fb0db3ccece466..ecd92bdc423549ede74f2397c6768d70e4ac7a71 100644 (file)
@@ -2871,6 +2871,7 @@ gtk_clist_swap_rows (GtkCList *clist,
   
   g_return_if_fail (clist != NULL);
   g_return_if_fail (GTK_IS_CLIST (clist));
+  g_return_if_fail (row1 != row2);
 
   if (GTK_CLIST_AUTO_SORT (clist))
     return;
@@ -2885,7 +2886,7 @@ gtk_clist_swap_rows (GtkCList *clist,
   last = MAX (row1, row2);
 
   link1 = g_list_nth (clist->row_list, first);
-  link2 = g_list_nth (link1, row2 - row1);
+  link2 = g_list_nth (link1, last - first);
 
   swap = link1->data;
   link1->data = link2->data;
@@ -2896,8 +2897,7 @@ gtk_clist_swap_rows (GtkCList *clist,
     {
       if (GPOINTER_TO_INT (list->data) == row1)
        list->data = GINT_TO_POINTER (row2);
-      
-      if (GPOINTER_TO_INT (list->data) == row2)
+      else if (GPOINTER_TO_INT (list->data) == row2)
        list->data = GINT_TO_POINTER (row1);
       
       list = list->next;
@@ -2905,13 +2905,13 @@ gtk_clist_swap_rows (GtkCList *clist,
   
   if (!GTK_CLIST_FROZEN (clist))
     {
-      if (gtk_clist_row_is_visible (clist, row1) != GTK_VISIBILITY_NONE)
+      if (gtk_clist_row_is_visible (clist, last) != GTK_VISIBILITY_NONE)
        GTK_CLIST_CLASS_FW (clist)->draw_row
-         (clist, NULL, row1, GTK_CLIST_ROW (link2));
+         (clist, NULL, last, GTK_CLIST_ROW (link2));
 
-      if (gtk_clist_row_is_visible (clist, row2) != GTK_VISIBILITY_NONE)
+      if (gtk_clist_row_is_visible (clist, first) != GTK_VISIBILITY_NONE)
        GTK_CLIST_CLASS_FW (clist)->draw_row
-         (clist, NULL, row2, GTK_CLIST_ROW (link1));
+         (clist, NULL, first, GTK_CLIST_ROW (link1));
     }
 }