Commit 7fcd6e52 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

do a touch more. Still need to write the encoded path parser.


2002-08-12  Jody Goldberg <jody@gnome.org>

	* ms-excel-read.c (ms_excel_read_SUPBOOK) : do a touch more.
	Still need to write the encoded path parser.
parent 5c927b74
2002-08-12 Jody Goldberg <jody@gnome.org>
* ms-excel-read.c (ms_excel_read_SUPBOOK) : do a touch more.
Still need to write the encoded path parser.
2002-08-11 Jody Goldberg <jody@gnome.org>
* ms-excel-read.c (ms_excel_read_cf) : don't leak.
2002-08-11 Jody Goldberg <jody@gnome.org>
* ms-formula-read.c (ms_excel_parse_formula) : add bounds testing to
......
......@@ -3623,6 +3623,9 @@ ms_excel_read_cf (BiffQuery *q, ExcelSheet *esheet)
g_return_if_fail (q->length == offset + expr1_len + expr2_len);
gsf_mem_dump (q->data+6, 6);
if (expr1 != NULL) gnm_expr_unref (expr1);
if (expr2 != NULL) gnm_expr_unref (expr2);
#if 0
printf ("%d == %d (%d + %d + %d) (0x%x)\n",
q->length, offset + expr1_len + expr2_len,
......@@ -4433,6 +4436,8 @@ ms_excel_read_SUPBOOK (BiffQuery *q, ExcelWorkbook *ewb)
unsigned const numTabs = GSF_LE_GET_GUINT16 (q->data);
unsigned len = GSF_LE_GET_GUINT16 (q->data + 2);
unsigned i;
guint32 byte_length;
char *name;
guint8 encodeType, *data;
d (2, printf ("supbook %d has %d\n", ewb->supbooks->len, numTabs););
......@@ -4447,9 +4452,9 @@ ms_excel_read_SUPBOOK (BiffQuery *q, ExcelWorkbook *ewb)
return;
}
g_ptr_array_add (ewb->supbooks, 1);
gsf_mem_dump (q->data, q->length);
/* gsf_mem_dump (q->data, q->length); */
encodeType = GSF_LE_GET_GUINT8 (q->data + 2);
encodeType = GSF_LE_GET_GUINT8 (q->data + 4);
d (-1, {
printf ("Supporting workbook with %d Tabs\n", numTabs);
printf ("--> SUPBOOK VirtPath encoding = ");
......@@ -4464,15 +4469,16 @@ ms_excel_read_SUPBOOK (BiffQuery *q, ExcelWorkbook *ewb)
puts ("chSelf");
break;
default:
printf ("Unknown/Unencoded? (%x '%c') %d\n",
encodeType, encodeType, q->length);
printf ("Unknown/Unencoded? (%x) %d\n",
encodeType, len);
};
});
for (data = q->data + 2, i = 0; i < numTabs > 0; i++) {
guint32 byte_length, slen = GSF_LE_GET_GUINT16 (data);
char *name = biff_get_text (data + 2, slen, &byte_length);
puts (name);
gsf_mem_dump (q->data + 4 + 1, len);
for (data = q->data + 4 + 1 + len, i = 0; i < numTabs > 0; i++) {
len = GSF_LE_GET_GUINT16 (data);
name = biff_get_text (data + 2, len, &byte_length);
printf ("\t-> %s\n", name);
g_free (name);
data += byte_length + 2;
}
......
......@@ -625,7 +625,7 @@ make_function (GnmExprList **stack, int fn_idx, int numargs)
const FormulaFuncData *fd = &formula_func_data[fn_idx];
GnmExprList *args;
d (0, printf ("Function '%s', args %d, templ: %d\n",
d (2, printf ("Function '%s', args %d, templ: %d\n",
fd->prefix, numargs, fd->num_args););
/* Right args for multi-arg funcs. */
......@@ -741,9 +741,10 @@ ms_excel_parse_formula (ExcelWorkbook const *ewb,
g_return_val_if_fail (ewb != NULL, NULL);
#ifndef NO_DEBUG_EXCEL
if (ms_excel_formula_debug > 1 && esheet != NULL) {
if (ms_excel_formula_debug > 0 && esheet != NULL) {
ms_excel_dump_cellname (ewb, esheet, fn_col, fn_row);
gsf_mem_dump (mem, length);
if (ms_excel_formula_debug > 2)
gsf_mem_dump (mem, length);
}
#endif
......@@ -1455,5 +1456,15 @@ ms_excel_parse_formula (ExcelWorkbook const *ewb,
"Too much data on stack - probable cause: fixed args function is var-arg, put '-1' in the table above",
"#LongStack");
}
#ifndef NO_DEBUG_EXCEL
if (ms_excel_formula_debug > 0 && esheet != NULL) {
ParsePos pp;
GnmExpr const *expr = parse_list_pop (&stack);
parse_pos_init (&pp, NULL, esheet->gnum_sheet, fn_col, fn_row);
puts (gnm_expr_as_string (expr, &pp));
return expr;
}
#endif
return expr_tree_sharer_share (ewb->expr_sharer, parse_list_pop (&stack));
}
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