Commit ceb2594c authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Make utf8 safe. (file_saver_description_cmp): Ditto. Make utf8 safe. Make

2002-10-18  Morten Welinder  <terra@diku.dk>

	* src/gui-file.c (file_opener_description_cmp): Make utf8 safe.
	(file_saver_description_cmp): Ditto.
	* src/func.c (function_category_compare): Make utf8 safe.
	* src/value.c (value_diff): Make utf8 safe.

	* src/value.c (value_compare): Make utf8 safe.

2002-10-18  Morten Welinder  <terra@diku.dk>

	* gnm-py-interpreter.c (gnm_py_interpreter_compare): Make utf8
	safe.
parent 8aea57de
2002-10-18 Morten Welinder <terra@diku.dk>
* src/gui-file.c (file_opener_description_cmp): Make utf8 safe.
(file_saver_description_cmp): Ditto.
* src/func.c (function_category_compare): Make utf8 safe.
* src/value.c (value_diff): Make utf8 safe.
* src/value.c (value_compare): Make utf8 safe.
* src/plugin-service.c (gnum_plugin_file_opener_probe): Use
......
2002-10-18 Morten Welinder <terra@diku.dk>
* src/gui-file.c (file_opener_description_cmp): Make utf8 safe.
(file_saver_description_cmp): Ditto.
* src/func.c (function_category_compare): Make utf8 safe.
* src/value.c (value_diff): Make utf8 safe.
* src/value.c (value_compare): Make utf8 safe.
* src/plugin-service.c (gnum_plugin_file_opener_probe): Use
......
2002-10-18 Morten Welinder <terra@diku.dk>
* src/gui-file.c (file_opener_description_cmp): Make utf8 safe.
(file_saver_description_cmp): Ditto.
* src/func.c (function_category_compare): Make utf8 safe.
* src/value.c (value_diff): Make utf8 safe.
* src/value.c (value_compare): Make utf8 safe.
* src/plugin-service.c (gnum_plugin_file_opener_probe): Use
......
2002-10-18 Morten Welinder <terra@diku.dk>
* gnm-py-interpreter.c (gnm_py_interpreter_compare): Make utf8
safe.
2002-10-11 Jon K Hellan <hellan@acm.org>
* gnm-python.c: Include stdlib.h for setenv
......
......@@ -226,8 +226,7 @@ gnm_py_interpreter_compare (gconstpointer a, gconstpointer b)
} else if (int_b->plugin == NULL) {
return 1;
} else {
return strcoll (
gnm_plugin_get_name (int_a->plugin),
gnm_plugin_get_name (int_b->plugin));
return g_utf8_collate (gnm_plugin_get_name (int_a->plugin),
gnm_plugin_get_name (int_b->plugin));
}
}
2002-10-18 Morten Welinder <terra@diku.dk>
* dialog-plugin-manager.c (plugin_compare_name): Make utf8 safe.
2002-10-17 Morten Welinder <terra@diku.dk>
* dialog-define-names.c (name_guru_populate_list): Sort names.
......
......@@ -92,8 +92,8 @@ plugin_compare_name (gconstpointer a, gconstpointer b)
{
GnmPlugin *plugin_a = (GnmPlugin *) a, *plugin_b = (GnmPlugin *) b;
return strcoll (gnm_plugin_get_name (plugin_a),
gnm_plugin_get_name (plugin_b));
return g_utf8_collate (gnm_plugin_get_name (plugin_a),
gnm_plugin_get_name (plugin_b));
}
static gboolean
......
......@@ -188,22 +188,9 @@ function_category_compare (gconstpointer a, gconstpointer b)
{
GnmFuncGroup const *cat_a = a;
GnmFuncGroup const *cat_b = b;
char *str_a, *str_b;
g_return_val_if_fail (cat_a->display_name != NULL, 0);
g_return_val_if_fail (cat_b->display_name != NULL, 0);
#if 0
str_a = g_utf8_casefold (cat_a->display_name->str, -1);
str_b = g_utf8_casefold (cat_b->display_name->str, -1);
#endif
str_a = g_alloca (strlen (cat_a->display_name->str) + 1);
str_b = g_alloca (strlen (cat_b->display_name->str) + 1);
g_strdown (strcpy (str_a, cat_a->display_name->str));
g_strdown (strcpy (str_b, cat_b->display_name->str));
return strcoll (str_a, str_b);
return g_utf8_collate (cat_a->display_name,
cat_b->display_name);
}
GnmFuncGroup *
......@@ -214,26 +201,23 @@ gnm_func_group_fetch (char const *name)
GnmFuncGroup *
gnm_func_group_fetch_with_translation (char const *name,
char const *translation)
char const *translation)
{
GnmFuncGroup *cat = NULL;
char *int_name;
GList *l;
g_return_val_if_fail (name != NULL, NULL);
int_name = g_alloca (strlen (name) + 1);
g_strdown (strcpy (int_name, name));
for (l = categories; l != NULL; l = l->next) {
cat = l->data;
if (strcmp (cat->internal_name->str, int_name) == 0) {
if (strcmp (cat->internal_name->str, name) == 0) {
break;
}
}
if (l == NULL) {
cat = g_new (GnmFuncGroup, 1);
cat->internal_name = string_get (int_name);
cat->internal_name = string_get (name);
if (translation != NULL) {
cat->display_name = string_get (translation);
cat->has_translation = TRUE;
......
......@@ -34,8 +34,8 @@ file_opener_description_cmp (gconstpointer a, gconstpointer b)
{
GnumFileOpener const *fo_a = a, *fo_b = b;
return strcoll (gnum_file_opener_get_description (fo_a),
gnum_file_opener_get_description (fo_b));
return g_utf8_collate (gnum_file_opener_get_description (fo_a),
gnum_file_opener_get_description (fo_b));
}
static gint
......@@ -43,8 +43,8 @@ file_saver_description_cmp (gconstpointer a, gconstpointer b)
{
GnumFileSaver const *fs_a = a, *fs_b = b;
return strcoll (gnum_file_saver_get_description (fs_a),
gnum_file_saver_get_description (fs_b));
return g_utf8_collate (gnum_file_saver_get_description (fs_a),
gnum_file_saver_get_description (fs_b));
}
static GtkWidget *
......
......@@ -922,7 +922,7 @@ value_diff (Value const *a, Value const *b)
/* If both are strings compare as string */
case VALUE_STRING :
{
gint t = strcoll (a->v_str.val->str, b->v_str.val->str);
gint t = g_utf8_collate (a->v_str.val->str, b->v_str.val->str);
if (t == 0)
return 0.;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment