]> saetta.ns0.it Git - libgtkform/commitdiff
Bugfix on setting locale in GtkFormFieldFloat.
authorAndrea Zagli <azagli@libero.it>
Sat, 11 Dec 2010 08:35:08 +0000 (09:35 +0100)
committerAndrea Zagli <azagli@libero.it>
Sat, 11 Dec 2010 08:35:08 +0000 (09:35 +0100)
src/fieldfloat.c

index 59cfb5b069d84810044cba7a8bcdf70308b04ab7..26941bdbcb947784a41ee0a78124357d42d71179 100644 (file)
@@ -187,13 +187,13 @@ gchar
 
        if (value != NULL)
                {
-                       char *cur = setlocale (LC_NUMERIC, NULL);
+                       char *cur = g_strdup (setlocale (LC_NUMERIC, NULL));
                        gfloat fval = strtod (value, NULL);
-               
+
                        setlocale (LC_NUMERIC, "C");
 
                        ret = g_strdup_printf ("%f", fval);
-               
+
                        setlocale (LC_NUMERIC, cur);
 
                        g_free (value);
@@ -373,7 +373,7 @@ gtk_form_field_float_set_from_hashtable (GtkFormField *field, GHashTable *hashta
                                        priv->original_value = 0.0;
 
                                        setlocale (LC_NUMERIC, "");
-                                       ret = gtk_form_field_float_set_value_stringify (field, "0.0");                          
+                                       ret = gtk_form_field_float_set_value_stringify (field, "0.0");
                                }
                        else
                                {