Commit 94e76233 authored by Morten Welinder's avatar Morten Welinder

Fix problem with Excel loading of TRUE and FALSE as functions.

parent 16922981
999-06-22 Jukka-Pekka Iivonen <iivonen@iki.fi>
1999-06-22 Morten Welinder <terra@diku.dk>
* src/expr.c (eval_funcall): Add sanity check.
* src/fn-stat.c (callback_function_ttest): Make static.
* src/expr.h: Delete unwanted member "sym".
1999-06-22 Jukka-Pekka Iivonen <iivonen@iki.fi>
* samples/statfuns.xls: Added MMULT and MINVERSE tests.
* samples/lookfuns.xls: Added a new file for testing lookup and
......
999-06-22 Jukka-Pekka Iivonen <iivonen@iki.fi>
1999-06-22 Morten Welinder <terra@diku.dk>
* src/expr.c (eval_funcall): Add sanity check.
* src/fn-stat.c (callback_function_ttest): Make static.
* src/expr.h: Delete unwanted member "sym".
1999-06-22 Jukka-Pekka Iivonen <iivonen@iki.fi>
* samples/statfuns.xls: Added MMULT and MINVERSE tests.
* samples/lookfuns.xls: Added a new file for testing lookup and
......
999-06-22 Jukka-Pekka Iivonen <iivonen@iki.fi>
1999-06-22 Morten Welinder <terra@diku.dk>
* src/expr.c (eval_funcall): Add sanity check.
* src/fn-stat.c (callback_function_ttest): Make static.
* src/expr.h: Delete unwanted member "sym".
1999-06-22 Jukka-Pekka Iivonen <iivonen@iki.fi>
* samples/statfuns.xls: Added MMULT and MINVERSE tests.
* samples/lookfuns.xls: Added a new file for testing lookup and
......
999-06-22 Jukka-Pekka Iivonen <iivonen@iki.fi>
1999-06-22 Morten Welinder <terra@diku.dk>
* src/expr.c (eval_funcall): Add sanity check.
* src/fn-stat.c (callback_function_ttest): Make static.
* src/expr.h: Delete unwanted member "sym".
1999-06-22 Jukka-Pekka Iivonen <iivonen@iki.fi>
* samples/statfuns.xls: Added MMULT and MINVERSE tests.
* samples/lookfuns.xls: Added a new file for testing lookup and
......
1999-06-21 Morten Welinder <terra@diku.dk>
* ms-formula-read.c (make_function): Handle constant symbols.
* ms-excel-read.c (ms_excel_read_cell): Insert bools as values,
not constant expresssions.
(biff_get_text): Make a little more quiet.
......
......@@ -692,8 +692,16 @@ make_function (PARSE_LIST **stack, int fn_idx, int numargs)
parse_list_free (&args);
return 0;
}
symbol_ref (name);
parse_list_push (stack, expr_tree_new_funcall (name, args));
if (name->type == SYMBOL_FUNCTION) {
symbol_ref (name);
parse_list_push (stack, expr_tree_new_funcall (name, args));
} else {
if (args) {
fprintf (stderr, "Ignoring args for %s\n", fd->prefix);
parse_list_free (&args);
}
parse_list_push_raw (stack, value_duplicate (name->data));
}
return 1 ;
}
else
......
......@@ -4108,7 +4108,7 @@ typedef struct {
gboolean first;
} stat_ttest_t;
int
static int
callback_function_ttest (Sheet *sheet, Value *value, char **error_string,
void *closure)
{
......
......@@ -727,16 +727,22 @@ free_values (Value **values, int top)
static Value *
eval_funcall (Sheet *sheet, ExprTree *tree, int eval_col, int eval_row, char **error_string)
{
const Symbol *sym;
FunctionDefinition *fd;
GList *l;
int argc, arg, i;
Value *v = NULL;
fd = (FunctionDefinition *) tree->u.function.symbol->data;
sym = tree->u.function.symbol;
l = tree->u.function.arg_list;
argc = g_list_length (l);
if (sym->type != SYMBOL_VALUE) {
*error_string = _("Internal error");
return NULL;
}
fd = (FunctionDefinition *)sym->data;
if (fd->expr_fn)
{
/* Functions that deal with ExprNodes */
......@@ -747,8 +753,8 @@ eval_funcall (Sheet *sheet, ExprTree *tree, int eval_col, int eval_row, char **e
/* Functions that take pre-computed Values */
Value **values;
int fn_argc_min = 0, fn_argc_max = 0, var_len = 0;
char *arg_type = fd->args;
char *argptr = fd->args;
const char *arg_type = fd->args;
const char *argptr = fd->args;
/* Get variable limits */
while (*argptr){
......
......@@ -80,7 +80,6 @@ struct _Value {
Value ***vals; /* Array [x][y] */
} array ;
String *str;
Symbol *sym;
float_t v_float; /* floating point */
int_t v_int;
} v;
......
......@@ -4108,7 +4108,7 @@ typedef struct {
gboolean first;
} stat_ttest_t;
int
static int
callback_function_ttest (Sheet *sheet, Value *value, char **error_string,
void *closure)
{
......
......@@ -4108,7 +4108,7 @@ typedef struct {
gboolean first;
} stat_ttest_t;
int
static int
callback_function_ttest (Sheet *sheet, Value *value, char **error_string,
void *closure)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment