[gcalctool/gnome-2-32] Re-fix broken thousands separator code (Bug #635517)



commit 90eeeb56abd761d703efa312199a29592bebab88
Author: Robert Ancell <robert ancell canonical com>
Date:   Tue Nov 23 10:02:58 2010 +1100

    Re-fix broken thousands separator code (Bug #635517)

 NEWS                |    1 +
 src/math-equation.c |    2 +-
 src/mp-convert.c    |    9 ---------
 3 files changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/NEWS b/NEWS
index 0562511..d94b3a2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
 Overview of changes in gcalctool 5.32.2
 
     * Fix incorrect calculation of tanh
+    * Re-fix broken thousands separator code
 
 Overview of changes in gcalctool 5.32.1
 
diff --git a/src/math-equation.c b/src/math-equation.c
index 58b2bfc..ed4c108 100644
--- a/src/math-equation.c
+++ b/src/math-equation.c
@@ -915,7 +915,7 @@ math_equation_get_number(MathEquation *equation, MPNumber *z)
     gchar *text;
     gboolean result;
 
-    text = math_equation_get_display(equation);
+    text = math_equation_get_equation(equation);
     result = !mp_set_from_string(text, equation->priv->base, z);
     g_free (text);
 
diff --git a/src/mp-convert.c b/src/mp-convert.c
index 49588b5..c81e9d3 100644
--- a/src/mp-convert.c
+++ b/src/mp-convert.c
@@ -839,12 +839,6 @@ mp_set_from_string(const char *str, int default_base, MPNumber *z)
     const char *fractions[]     = {"½", "â??", "â??", "¼", "¾", "â??", "â??", "â??", "â??", "â??", "â??", "â??", "â??", "â??", "â??", NULL};
     int numerators[]            = { 1,   1,   2,   1,   3,   1,   2,   3,   4,   1,   5,   1,   3,   5,   7};
     int denominators[]          = { 2,   3,   3,   4,   4,   5,   5,   5,   5,   6,   6,   8,   8,   8,   8};
-    static const char *tsep = NULL;
-
-    if (tsep == NULL) {
-        tsep = nl_langinfo(THOUSEP);
-        tsep = *tsep ? g_locale_to_utf8(tsep, -1, NULL, NULL, NULL) : tsep;
-    }
 
     if (strstr(str, "°"))
         return set_from_sexagesimal(str, strlen(str), z);
@@ -888,9 +882,6 @@ mp_set_from_string(const char *str, int default_base, MPNumber *z)
             return true;
         mp_multiply_integer(z, base, z);
         mp_add_integer(z, i, z);
-
-        if (*tsep && strncmp(c, tsep, strlen(tsep)) == 0)
-            c += strlen(tsep);
     }
 
     /* Look for fraction characters, e.g. â?? */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]