Commit 77d7fe18 authored by Michael Meeks's avatar Michael Meeks

Array fix for crash at least,

Improved excel function translation & warnings,
parent b2e3b26e
1999-06-02 Michael Meeks <michael@edenproject.org>
* src/expr.c (do_expr_decode_tree): Added ARRAY support.
1999-06-01 Morten Welinder <terra@diku.dk>
* src/format.c (format_value): Mark format for translation.
......
1999-06-02 Michael Meeks <michael@edenproject.org>
* src/expr.c (do_expr_decode_tree): Added ARRAY support.
1999-06-01 Morten Welinder <terra@diku.dk>
* src/format.c (format_value): Mark format for translation.
......
1999-06-02 Michael Meeks <michael@edenproject.org>
* src/expr.c (do_expr_decode_tree): Added ARRAY support.
1999-06-01 Morten Welinder <terra@diku.dk>
* src/format.c (format_value): Mark format for translation.
......
1999-06-02 Michael Meeks <michael@edenproject.org>
* src/expr.c (do_expr_decode_tree): Added ARRAY support.
1999-06-01 Morten Welinder <terra@diku.dk>
* src/format.c (format_value): Mark format for translation.
......
1999-06-02 Michael Meeks <michael@edenproject.org>
* ms-formula-read.c (ms_excel_parse_formula): Elucidate
error messages.
(ms_excel_parse_formula): clean debug.
(formula_func_data): Fix COUNT and BETADIST.
1999-06-01 Michael Meeks <michael@edenproject.org>
* ms-excel-write.c (write_sheet_bools): Added yet more
......
......@@ -67,7 +67,7 @@ FORMULA_OP_DATA formula_op_data[] = {
**/
FORMULA_FUNC_DATA formula_func_data[] =
{
{ "COUNT", 2 },
{ "COUNT", -1 },
{ "IF", -1 },
{ "ISNA", 1 },
{ "ISERROR", 1 },
......@@ -337,7 +337,7 @@ FORMULA_FUNC_DATA formula_func_data[] =
{ "0x10b", 8 },
{ "0x10c", 8 },
{ "AVEDEV", -1 },
{ "BETADIST", 3 },
{ "BETADIST", -1 },
{ "GAMMALN", 1 },
{ "BETAINV", 3 },
{ "BINOMDIST", 4 },
......@@ -1052,10 +1052,15 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
if (attrs == 00) /* bitFSpace : ignore it */
/* Could perhaps pop top arg & append space ? */ ;
else
#if FORMULA_DEBUG > 1
printf ("Redundant whitespace in formula 0x%x count %d\n", attrs, num_space) ;
#else
;
#endif
} else {
if (FORMULA_DEBUG>0)
printf ("Unknown PTG Attr 0x%x 0x%x\n", grbit, w) ;
#if FORMULA_DEBUG > 0
printf ("Unknown PTG Attr 0x%x 0x%x\n", grbit, w) ;
#endif
error = 1 ;
}
break ;
......@@ -1122,8 +1127,9 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
tr->u.binary.value_a = parse_list_pop (&stack);
parse_list_push (&stack, tr);
} else {
if (FORMULA_DEBUG>0)
printf ("Unknown PTG 0x%x base %x\n", ptg, ptgbase);
#if FORMULA_DEBUG > 0
printf ("Unknown PTG 0x%x base %x\n", ptg, ptgbase);
#endif
error=1 ;
}
}
......@@ -1133,8 +1139,7 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
cur+= (ptg_length+1) ;
len_left-= (ptg_length+1) ;
}
if (error)
{
if (error) {
if (FORMULA_DEBUG>0) {
printf ("Unknown Formula/Array at [%d, %d]\n", fn_col, fn_row) ;
printf ("formula data : \n") ;
......@@ -1146,9 +1151,10 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
}
if (!stack)
return expr_tree_string ("Stack too short");
return expr_tree_string ("Stack too short - unusual");
if (g_list_length(stack) > 1)
return expr_tree_string ("Too much data on stack");
return expr_tree_string ("Too much data on stack - probable cause: "
"fixed args function is var-arg, put '-1' in the table above");
return parse_list_pop (&stack);
}
......@@ -1445,6 +1445,9 @@ do_expr_decode_tree (ExprTree *tree, Sheet *sheet, int col, int row, int paren_l
return res;
}
case VALUE_ARRAY:
return value_get_as_string (v);
default:
g_assert_not_reached ();
return NULL;
......
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