[gcalctool] Connect up functions to just run through the parser. Not really what they say they should do but th



commit 1f0ff3e2ed4f0e2b3f2a6d644f8a74f413dd3240
Author: Robert Ancell <robert ancell gmail com>
Date:   Mon Jul 27 10:39:24 2009 +1000

    Connect up functions to just run through the parser.  Not really what they say they should do but the functions have been completely broken anyway

 src/functions.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/functions.c b/src/functions.c
index 56b68c5..a4a0970 100644
--- a/src/functions.c
+++ b/src/functions.c
@@ -177,8 +177,9 @@ do_function(int index)
     assert(index >= 0);
     assert(index <= 9);
 
-    ret = 0;//FIXME: mp_equation_udf_parse(function_get_value(index));
-    if (!ret) {
+    ret = mp_equation_parse(function_get_value(index), display_get_answer(&v->display));
+    if (ret == 0) {
+        display_set_answer(&v->display);
         ui_set_statusbar("", "");
     } else {
         /* Translators: This message is displayed in the status bar when an
@@ -445,7 +446,7 @@ do_expression(int function, int arg, int cursor_start, int cursor_end)
         
         case FN_FUNCTION:
             do_function(arg);
-            return;
+            break;
         
         case FN_PASTE:
             do_paste(cursor_start, cursor_end, (const char *)arg); // FIXME: Probably not 64 bit safe



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