[glade3] Use locale-independent strtod & dtostr
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade3] Use locale-independent strtod & dtostr
- Date: Thu, 30 Dec 2010 16:33:07 +0000 (UTC)
commit 5a98fe54f86039ac1e4ca1bf295c7fb7ad71dcdf
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 | 6 ++++--
2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b393b84..0d70f68 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>
* gladeui/glade-widget-adaptor.[ch], gladeui/glade-xml-utils.c, plugins/gtk+/glade-gtk.c,
diff --git a/plugins/gtk+/glade-attributes.c b/plugins/gtk+/glade-attributes.c
index 1eecdbc..d05cbcb 100644
--- a/plugins/gtk+/glade-attributes.c
+++ b/plugins/gtk+/glade-attributes.c
@@ -488,8 +488,10 @@ glade_gtk_string_from_attr (GladeAttribute * gattr)
/* PangoAttrFloat */
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 */
@@ -591,7 +593,7 @@ glade_gtk_attribute_from_string (PangoAttrType type, const gchar * strval)
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]