[gcalctool] Fix bit editor
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcalctool] Fix bit editor
- Date: Wed, 20 Apr 2011 02:05:47 +0000 (UTC)
commit 3b78fe5a00c19a1348371c6fd0d844dd8df9ff81
Author: Robert Ancell <robert ancell canonical com>
Date: Wed Apr 20 12:05:42 2011 +1000
Fix bit editor
NEWS | 1 +
src/math-equation.c | 15 ++++++++++-----
2 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/NEWS b/NEWS
index c62d60c..7848ddb 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ Overview of changes in gcalctool 6.1.0
* Only write to GSettings when settings change, don't sync on exit
(Bug #647327)
* Fix crash when not all currencies downloaded
+ * Fix bit editor (Bug #646142)
Overview of changes in gcalctool 6.0.0
diff --git a/src/math-equation.c b/src/math-equation.c
index f0c0975..5cbdfeb 100644
--- a/src/math-equation.c
+++ b/src/math-equation.c
@@ -871,11 +871,16 @@ math_equation_get_number(MathEquation *equation, MPNumber *z)
g_return_val_if_fail(equation != NULL, FALSE);
g_return_val_if_fail(z != NULL, FALSE);
- text = math_equation_get_equation(equation);
- result = !mp_serializer_from_string(equation->priv->serializer, text, z);
- g_free(text);
-
- return result;
+ if (math_equation_is_result(equation)) {
+ mp_set_from_mp(math_equation_get_answer(equation), z);
+ return TRUE;
+ }
+ else {
+ text = math_equation_get_equation(equation);
+ result = !mp_serializer_from_string(equation->priv->serializer, text, z);
+ g_free(text);
+ return result;
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]