]> saetta.ns0.it Git - libgtkform/commitdiff
Adapted locale setting to libgda.
authorAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Fri, 7 Jan 2011 07:58:02 +0000 (08:58 +0100)
committerAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Fri, 7 Jan 2011 07:58:02 +0000 (08:58 +0100)
src/fieldfloat.c
src/form.c

index 26941bdbcb947784a41ee0a78124357d42d71179..29c8854667356261584274a9973a34023194c831 100644 (file)
@@ -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;
index 1620f68b62c5a94ee6e3d409b8fe33c82a623d9e..a02280b38af12064d3ccff7c0342c997b3d5872d 100644 (file)
@@ -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");