From: Andrea Zagli Date: Fri, 7 Jan 2011 07:58:02 +0000 (+0100) Subject: Adapted locale setting to libgda. X-Git-Tag: 0.1.5~1 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=a57233947e9b0772e289cebd2fea727ea46e5198;p=libgtkform Adapted locale setting to libgda. --- diff --git a/src/fieldfloat.c b/src/fieldfloat.c index 26941bd..29c8854 100644 --- a/src/fieldfloat.c +++ b/src/fieldfloat.c @@ -188,13 +188,16 @@ gchar if (value != NULL) { char *cur = g_strdup (setlocale (LC_NUMERIC, NULL)); + gda_locale_changed (); gfloat fval = strtod (value, NULL); setlocale (LC_NUMERIC, "C"); + gda_locale_changed (); ret = g_strdup_printf ("%f", fval); setlocale (LC_NUMERIC, cur); + gda_locale_changed (); g_free (value); } @@ -336,6 +339,7 @@ gtk_form_field_float_set_from_datamodel (GtkFormField *field, GdaDataModel *dm, value = gdaex_data_model_get_field_value_float_at (dm, row, field_name); setlocale (LC_NUMERIC, ""); + gda_locale_changed (); ret = gtk_form_field_float_set_value_stringify (field, g_strdup_printf ("%f", value)); priv->original_value = value; @@ -373,6 +377,7 @@ gtk_form_field_float_set_from_hashtable (GtkFormField *field, GHashTable *hashta priv->original_value = 0.0; setlocale (LC_NUMERIC, ""); + gda_locale_changed (); ret = gtk_form_field_float_set_value_stringify (field, "0.0"); } else @@ -380,6 +385,7 @@ gtk_form_field_float_set_from_hashtable (GtkFormField *field, GHashTable *hashta priv->original_value = g_value_get_float (gval); setlocale (LC_NUMERIC, ""); + gda_locale_changed (); ret = gtk_form_field_float_set_value_stringify (field, g_strdup_printf ("%f", priv->original_value)); } } @@ -412,6 +418,7 @@ gtk_form_field_float_set_value (GtkFormField *field, GValue *gvalue) priv->original_value = g_value_get_float (gvalue); setlocale (LC_NUMERIC, ""); + gda_locale_changed (); ret = gtk_form_field_float_set_value_stringify (field, g_strdup_printf ("%f", priv->original_value)); return ret; diff --git a/src/form.c b/src/form.c index 1620f68..a02280b 100644 --- a/src/form.c +++ b/src/form.c @@ -149,6 +149,7 @@ GtkForm *gtk_form_new () { setlocale (LC_ALL, ""); + gda_locale_changed (); bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); textdomain (GETTEXT_PACKAGE); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");