[gnumeric] Evaluation: move evaluation flags into structure.



commit ef65e2e91a5878f9b0eb7304e83b07eaa99c9919
Author: Morten Welinder <terra gnome org>
Date:   Tue Oct 22 14:58:32 2013 -0400

    Evaluation: move evaluation flags into structure.
    
    This allows functions to look at them.  That will be needed for
    HYPERLINK.

 ChangeLog  |    5 +++++
 src/expr.c |    6 ++++--
 src/func.c |    6 ++++--
 src/func.h |    4 ++--
 4 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 498ea1d..a4922cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-10-22  Morten Welinder  <terra gnome org>
+
+       * src/func.c (function_call_with_exprs): Move flags argument into
+       structure.
+
 2013-10-19  Morten Welinder  <terra gnome org>
 
        * src/hlink.c (_gnm_hlink_init): New function.
diff --git a/src/expr.c b/src/expr.c
index c3a4baa..356d58b 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -670,7 +670,8 @@ gnm_expr_extract_ref (GnmRangeRef *res, GnmExpr const *expr,
 
                ei.pos = pos;
                ei.func_call = &expr->func;
-               v = function_call_with_exprs (&ei, flags);
+               ei.flags = flags;
+               v = function_call_with_exprs (&ei);
 
                if (v != NULL) {
                        if (v->type == VALUE_CELLRANGE) {
@@ -1448,7 +1449,8 @@ gnm_expr_eval (GnmExpr const *expr, GnmEvalPos const *pos,
                GnmFuncEvalInfo ei;
                ei.pos = pos;
                ei.func_call = &expr->func;
-               res = function_call_with_exprs (&ei, flags);
+               ei.flags = flags;
+               res = function_call_with_exprs (&ei);
                if (res == NULL)
                        return (flags & GNM_EXPR_EVAL_PERMIT_EMPTY)
                            ? NULL : value_new_int (0);
diff --git a/src/func.c b/src/func.c
index a518df2..6ca649d 100644
--- a/src/func.c
+++ b/src/func.c
@@ -1732,14 +1732,13 @@ free_values (GnmValue **values, int top)
 /**
  * function_call_with_exprs:
  * @ei: EvalInfo containing valid fn_def!
- * @flags:
  *
  * Do the guts of calling a function.
  *
  * Returns the result.
  **/
 GnmValue *
-function_call_with_exprs (GnmFuncEvalInfo *ei, GnmExprEvalFlags flags)
+function_call_with_exprs (GnmFuncEvalInfo *ei)
 {
        GnmFunc const *fn_def;
        int       i, iter_count, iter_width = 0, iter_height = 0;
@@ -1748,10 +1747,13 @@ function_call_with_exprs (GnmFuncEvalInfo *ei, GnmExprEvalFlags flags)
        int      *iter_item = NULL;
        int argc;
        GnmExprConstPtr *argv;
+       GnmExprEvalFlags flags;
 
        g_return_val_if_fail (ei != NULL, NULL);
        g_return_val_if_fail (ei->func_call != NULL, NULL);
 
+       flags = ei->flags;
+
        argc = ei->func_call->argc;
        argv = ei->func_call->argv;
        fn_def = ei->func_call->func;
diff --git a/src/func.h b/src/func.h
index eee4eae..3ec536e 100644
--- a/src/func.h
+++ b/src/func.h
@@ -218,6 +218,7 @@ struct _GnmFunc {
 struct _GnmFuncEvalInfo {
        GnmEvalPos const *pos;
        GnmExprFunction const *func_call;
+       GnmExprEvalFlags flags;
 };
 
 GType       gnm_func_get_type        (void);
@@ -266,8 +267,7 @@ char       *gnm_func_convert_markup_to_pango (char const *desc,
 
 /*************************************************************************/
 
-GnmValue *function_call_with_exprs     (GnmFuncEvalInfo *ei,
-                                        GnmExprEvalFlags flags);
+GnmValue *function_call_with_exprs     (GnmFuncEvalInfo *ei);
 GnmValue *function_call_with_values     (GnmEvalPos const *ep, char const *name,
                                         int argc, GnmValue const * const *values);
 GnmValue *function_def_call_with_values (GnmEvalPos const *ep, GnmFunc const *fn,


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