PATCH: gnome_app_find_men_pos fix.



gnome_app_find_menu_pos() was not working, due to a faulty optimisation.
I'm not sure what changed since gnome-libs 1.2, but the problem is
solved by removing the optimisation. This fixes
gnome_app_insert_menus(), which uses it.

Permission to commit?

-- 
Murray Cumming
murrayc usa net
www.murrayc.com
? libgnomeui.kdevprj
? libgnomeui.kdevses
? gnome_about_construct.patch
? gnome_client_gbooleans.patch
? gnomefontselector_const.patch
? gnome_app_find_pos.patch
? libgnomeui/temp.txt
? libgnomeui/gnome-app-helper.c2
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/libgnomeui/ChangeLog,v
retrieving revision 1.75
diff -u -u -p -r1.75 ChangeLog
--- ChangeLog	2001/12/14 15:33:34	1.75
+++ ChangeLog	2001/12/15 23:53:08
@@ -1,3 +1,11 @@
+2001-12-16  Murray Cumming  <murrayc usa net>
+
+	* libgnomeui/gnome-app-helper.cc: gnome_app_find_menu_pos() was
+	not working, due to a faulty optimisation. I'm not sure what 
+	changed since gnome-libs 1.2, but the problem is solved by 
+	removing the optimisation. This fixes gnome_app_insert_menus(),
+	which uses it.
+
 2001-12-14  Anders Carlsson  <andersca gnu org>
 
 	* configure.in: Up version, disable tests/
Index: libgnomeui/gnome-app-helper.c
===================================================================
RCS file: /cvs/gnome/libgnomeui/libgnomeui/gnome-app-helper.c,v
retrieving revision 1.185
diff -u -u -p -r1.185 gnome-app-helper.c
--- libgnomeui/gnome-app-helper.c	2001/12/14 21:29:00	1.185
+++ libgnomeui/gnome-app-helper.c	2001/12/15 23:53:09
@@ -2126,7 +2126,6 @@ gnome_app_find_menu_pos (GtkWidget *pare
 	const gchar *transl;
 	gint p;
 	int  path_len;
-	int  stripped_path_len;
 	
 	g_return_val_if_fail (parent != NULL, NULL);
 	g_return_val_if_fail (path != NULL, NULL);
@@ -2158,11 +2157,6 @@ gnome_app_find_menu_pos (GtkWidget *pare
 	part[path_len] = '\0';
 	transl = L_(part);
 	path_len = strlen(transl);
-
-	stripped_path_len = path_len;
-	for ( p = 0; p < path_len; p++ )
-	        if( transl[p] == '_' )
-		        stripped_path_len--;
 		
 	p = 0;
 
@@ -2180,8 +2174,7 @@ gnome_app_find_menu_pos (GtkWidget *pare
 			label = GTK_LABEL (item->child)->label;
 		else
 			label = NULL; /* something that we just can't handle */
-		if (label && (stripped_path_len == strlen (label)) &&
-		    (g_strncmp_ignore_char (transl, label, path_len, '_') == 0)){
+		if (label && (g_strncmp_ignore_char (transl, label, path_len, '_') == 0)){
 			if (name_end == NULL) {
 				*pos = p;
 				g_free(part);


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