Commit 53412e27 authored by Jody Goldberg's avatar Jody Goldberg

Band-aid for recent name changes.

Need to do more work on how a name at workbook level can have a shared
formula reference ?  Is this another biff7 vs biff8 issue ?
parent a71e4882
......@@ -1778,7 +1778,7 @@ ms_excel_get_name (ExcelWorkbook *wb, int name_idx)
/* FIXME: S59DA9.HTM */
static void
ms_excel_read_name (BiffQuery *q, ExcelWorkbook *wb)
ms_excel_read_name (BiffQuery *q, ExcelSheet *sheet)
{
guint16 fn_grp_idx;
guint16 flags = BIFF_GET_GUINT16 (q->data);
......@@ -1860,15 +1860,15 @@ ms_excel_read_name (BiffQuery *q, ExcelWorkbook *wb)
printf (" BinData");
printf ("\n");
g_ptr_array_add (wb->internal_names, name);
g_ptr_array_add (sheet->wb->internal_names, name);
#ifndef NO_DEBUG_EXCEL
if (ms_excel_read_debug>1) {
printf ("NAME %d : %s\n", wb->internal_names->len, name);
printf ("NAME %d : %s\n", sheet->wb->internal_names->len, name);
}
tree = ms_excel_parse_formula (NULL, name_def_data,
0, 0, FALSE, name_def_len, NULL);
#endif
tree = ms_excel_parse_formula (sheet, name_def_data,
0, 0, FALSE, name_def_len, NULL);
}
/* S59D7E.HTM */
......@@ -2101,7 +2101,7 @@ ms_excel_read_cell (BiffQuery *q, ExcelSheet *sheet)
switch (q->opcode)
{
case BIFF_NAME:
ms_excel_read_name (q, sheet->wb);
ms_excel_read_name (q, sheet);
break;
case BIFF_BOOLERR: /* S59D5F.HTM */
......@@ -2759,10 +2759,6 @@ ms_excel_read_workbook (MsOle *file)
case BIFF_PASSWORD :
break;
case (BIFF_NAME & 0xff) : /* Why here and not as 18 */
ms_excel_read_name (q, wb);
break;
case (BIFF_STYLE & 0xff) : /* Why here and not as 93 */
break;
......@@ -2770,15 +2766,20 @@ ms_excel_read_workbook (MsOle *file)
break;
case BIFF_EXTERNNAME :
case (BIFF_NAME & 0xff) : /* Why here and not as 18 */
{
/* Create a pseudo-sheet */
ExcelSheet sheet;
sheet.wb = wb;
sheet.ver = ver->version;
sheet.gnum_sheet = NULL;
ms_excel_externname(q, &sheet);
break;
sheet.shared_formulae = NULL;
if (q->ls_op == (BIFF_EXTERNNAME&0xff))
ms_excel_externname (q, &sheet);
else
ms_excel_read_name (q, &sheet);
}
break;
case BIFF_BACKUP :
break;
......@@ -2792,7 +2793,7 @@ ms_excel_read_workbook (MsOle *file)
break;
case BIFF_OBPROJ :
puts("Visual Basic Project");
/* Flags that the project has some VBA */
break;
case BIFF_BOOKBOOL :
......
......@@ -678,9 +678,12 @@ make_function (PARSE_LIST **stack, int fn_idx, int numargs)
&unknownFunctionHandler);
name = symbol_lookup (global_symbol_table,
f_name);
/* We just added it, it better be there */
g_assert (name);
g_warning ("%s : unknown function.", f_name);
/* WISHLIST : it would be nice to have a log if these. */
g_warning ("EXCEL unknown function : %s", f_name);
}
expr_tree_unref (tmp);
symbol_ref (name);
......@@ -760,6 +763,8 @@ ms_excel_parse_formula (ExcelSheet *sheet, guint8 *mem,
if (array_element != NULL)
*array_element = FALSE;
g_return_val_if_fail (sheet != NULL, NULL);
#ifndef NO_DEBUG_EXCEL
if (ms_excel_formula_debug > 1) {
printf ("\n\n%s:%s%s\n", (sheet->gnum_sheet
......
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