mirror of https://github.com/GNOME/gimp.git
serialize doubles and floats using the locale independent
2002-04-15 Sven Neumann <sven@gimp.org> * app/config/gimpconfig-serialize.c: serialize doubles and floats using the locale independent g_ascii_formatd().
This commit is contained in:
parent
2a8bab17de
commit
21fb2943b5
|
@ -1,3 +1,8 @@
|
|||
2002-04-15 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/config/gimpconfig-serialize.c: serialize doubles and floats
|
||||
using the locale independent g_ascii_formatd().
|
||||
|
||||
2002-04-14 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/core/gimpunits.c: serialize the unit factor with
|
||||
|
|
|
@ -245,6 +245,22 @@ gimp_config_serialize_value (const GValue *value,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
if (G_VALUE_HOLDS_DOUBLE (value) || G_VALUE_HOLDS_FLOAT (value))
|
||||
{
|
||||
gdouble v_double;
|
||||
gchar buf[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
if (G_VALUE_HOLDS_DOUBLE (value))
|
||||
v_double = g_value_get_double (value);
|
||||
else
|
||||
v_double = (gdouble) g_value_get_float (value);
|
||||
|
||||
g_ascii_formatd (buf, sizeof (buf), "%f", v_double);
|
||||
g_string_append_c (str, ' ');
|
||||
g_string_append (str, buf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (g_value_type_transformable (G_VALUE_TYPE (value), G_TYPE_STRING))
|
||||
{
|
||||
GValue tmp_value = { 0, };
|
||||
|
|
|
@ -245,6 +245,22 @@ gimp_config_serialize_value (const GValue *value,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
if (G_VALUE_HOLDS_DOUBLE (value) || G_VALUE_HOLDS_FLOAT (value))
|
||||
{
|
||||
gdouble v_double;
|
||||
gchar buf[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
if (G_VALUE_HOLDS_DOUBLE (value))
|
||||
v_double = g_value_get_double (value);
|
||||
else
|
||||
v_double = (gdouble) g_value_get_float (value);
|
||||
|
||||
g_ascii_formatd (buf, sizeof (buf), "%f", v_double);
|
||||
g_string_append_c (str, ' ');
|
||||
g_string_append (str, buf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (g_value_type_transformable (G_VALUE_TYPE (value), G_TYPE_STRING))
|
||||
{
|
||||
GValue tmp_value = { 0, };
|
||||
|
|
Loading…
Reference in New Issue