[glade3/glade-3-8] Use locale-independent strtod & dtostr
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade3/glade-3-8] Use locale-independent strtod & dtostr
- Date: Thu, 30 Dec 2010 16:38:09 +0000 (UTC)
commit 01632029dee7025567a0a58a62ca189696ac7a63
Author: Christian Persch <chpe gnome org>
Date: Sun Apr 25 23:32:44 2010 +0200
Use locale-independent strtod & dtostr
Bug #616787.
ChangeLog | 5 +++++
plugins/gtk+/glade-attributes.c | 9 ++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 38a3733..941d65f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-12-30 Christian Persch <chpe gnome org>
+
+ * plugins/gtk+/glade-attributes.c: Use locale-independent strtod &
+ dtostr. Fixes bug 616787
+
2010-12-30 Tristan Van Berkom <tristanvb openismus com>
* plugins/gtk+/gtk+.xml.in: Updated catalog for 2.22 and 2.24 symbols.
diff --git a/plugins/gtk+/glade-attributes.c b/plugins/gtk+/glade-attributes.c
index 0d945a5..0d4f7fc 100755
--- a/plugins/gtk+/glade-attributes.c
+++ b/plugins/gtk+/glade-attributes.c
@@ -474,11 +474,14 @@ glade_gtk_string_from_attr (GladeAttribute *gattr)
break;
/* PangoAttrFloat */
- case PANGO_ATTR_SCALE:
+ case PANGO_ATTR_SCALE: {
/* doubles */
+ gchar buf[G_ASCII_DTOSTR_BUF_SIZE];
+
fval = g_value_get_double (&(gattr->value));
- ret = g_strdup_printf ("%f", fval);
+ ret = g_strdup (g_ascii_dtostr (buf, sizeof (buf), fval));
break;
+ }
/* PangoAttrColor */
case PANGO_ATTR_FOREGROUND:
@@ -579,7 +582,7 @@ glade_gtk_attribute_from_string (PangoAttrType type,
case PANGO_ATTR_SCALE:
/* doubles */
g_value_init (&(gattr->value), G_TYPE_DOUBLE);
- g_value_set_double (&(gattr->value), strtod (strval, NULL));
+ g_value_set_double (&(gattr->value), g_ascii_strtod (strval, NULL));
break;
/* PangoAttrColor */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]