[glade3] * plugins/gtk+/glade-gtk.c: Fix alpha_sort_box_children() to give a consistent order to placehol



commit c65641d61a519bda85d649cd40f2c99fc3ba2b89
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Sun Dec 19 17:09:22 2010 +0900

    	* plugins/gtk+/glade-gtk.c: Fix alpha_sort_box_children() to give a consistent
    	  order to placeholders (bug 637534 fix by Marco Diego Aurélio Mesquita).

 ChangeLog                |    5 +++++
 plugins/gtk+/glade-gtk.c |   12 +++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 81ddd32..98348e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-12-19  Tristan Van Berkom <tristanvb openismus com>
+
+	* plugins/gtk+/glade-gtk.c: Fix alpha_sort_box_children() to give a consistent
+	  order to placeholders (bug 637534 fix by Marco Diego Aurélio Mesquita).
+
 2010-12-18  Tristan Van Berkom <tristanvb openismus com>
 
 	* src/Makefile.am, gladeui/Makefile.am, plugins/gtk+/Makefile.am, plugins/gnome/Makefile.am:
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
index b67df62..2c7f6ff 100644
--- a/plugins/gtk+/glade-gtk.c
+++ b/plugins/gtk+/glade-gtk.c
@@ -1708,10 +1708,16 @@ alpha_sort_box_children (GtkWidget *a, GtkWidget *b)
 	ga = glade_widget_get_from_gobject (a);
 	gb = glade_widget_get_from_gobject (b);
 
-	if (!ga || !gb)
+	if (!GLADE_IS_WIDGET (ga) && !GLADE_IS_WIDGET (gb))
+		return 0;
+
+	if (!GLADE_IS_WIDGET (ga))
 		return 1;
-	else 
-		return strcmp (ga->name, gb->name);
+
+	if (!GLADE_IS_WIDGET (gb))
+		return -1;
+
+	return strcmp (ga->name, gb->name);
 }
 
 GList *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]