[gnumeric] Func: when inventing names, use lower case.



commit 25a3d03f0650a6e3c6688deb68d9be31c9277d49
Author: Morten Welinder <terra gnome org>
Date:   Thu Jan 10 20:14:56 2013 -0500

    Func: when inventing names, use lower case.

 ChangeLog  |    1 +
 src/func.c |    6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2181639..d0891c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
 	argument and assume TRUE.  Drop scope name and assume NULL (which
 	is what all callers should have used).  All callers changed.
 	(gnm_func_add_placeholder): Ditto.
+	(invent_name): Downcase the preferred name.
 
 	* src/gnm-plugin.c (plugin_service_function_group_activate):
 	Upgrade existing placeholder functions as needed.
diff --git a/src/func.c b/src/func.c
index 4bc7612..dad248c 100644
--- a/src/func.c
+++ b/src/func.c
@@ -1251,10 +1251,10 @@ static char *
 invent_name (const char *pref, GHashTable *h, const char *template)
 {
 	static int count = 0;
-	char *name = NULL;
+	char *name = g_utf8_strdown (pref, -1);
 
-	if (g_hash_table_lookup (h, pref) == NULL)
-		return g_strdup (pref);
+	if (g_hash_table_lookup (h, name) == NULL)
+		return name;
 
 	do {
 		count++;



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