Commit 989bc01e authored by Michael Meeks's avatar Michael Meeks

Make blank sheet culling use sheet_is_pristine,

Make sheet objects set seet->modified.
parent 09fc2e8d
2000-02-06 Michael Meeks <michael@helixcode.com>
* src/sheet-object.c (sheet_object_construct): mark sheet as modified.
2000-02-06 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/mathfunc.[ch], src/functions/fn-math.c: Moved mdeterm, mmult
......
2000-02-06 Michael Meeks <michael@helixcode.com>
* src/sheet-object.c (sheet_object_construct): mark sheet as modified.
2000-02-06 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/mathfunc.[ch], src/functions/fn-math.c: Moved mdeterm, mmult
......
2000-02-06 Michael Meeks <michael@helixcode.com>
* ms-excel-read.c (ms_excel_read_workbook): Move failed sheet removal
here + add pristine culling instead of 0 byte in sheet header, may
introduce bugs but will help fix sheet_is_pristine. Fix potential
sheet object leak. (ms_excel_read_sheet): do not detach in error case.
2000-01-30 Jon K Hellan <hellan@acm.org>
* ms-excel-write.c (write_sheet): Correct the max no. of rows check.
......
......@@ -3022,7 +3022,6 @@ ms_excel_read_mergecells (BiffQuery *q, ExcelSheet *sheet)
static gboolean
ms_excel_read_sheet (ExcelSheet *sheet, BiffQuery *q, ExcelWorkbook *wb)
{
guint32 const blankSheetPos = q->streamPos + q->length + 4;
PrintInformation *pi;
g_return_val_if_fail (wb != NULL, FALSE);
......@@ -3052,21 +3051,6 @@ ms_excel_read_sheet (ExcelSheet *sheet, BiffQuery *q, ExcelWorkbook *wb)
switch (q->ls_op) {
case BIFF_EOF:
if (q->streamPos == blankSheetPos) /* || sheet->blank) */ {
#ifndef NO_DEBUG_EXCEL
if (ms_excel_read_debug > 1)
printf ("Blank sheet\n");
if (ms_excel_read_debug > 5)
printf ("BIFF_EOF\n");
#endif
if (ms_excel_workbook_detach (sheet->wb, sheet)) {
ms_excel_sheet_destroy (sheet);
sheet = NULL;
return FALSE;
} else
printf ("Serious error detaching sheet '%s'\n",
sheet->gnum_sheet->name);
}
style_optimize (sheet, -1, -1);
return TRUE;
......@@ -3368,9 +3352,8 @@ ms_excel_read_sheet (ExcelSheet *sheet, BiffQuery *q, ExcelWorkbook *wb)
guint16 const pageBreakZoom = MS_OLE_GET_GUINT16(q->data + 10);
guint16 const normalZoom = MS_OLE_GET_GUINT16(q->data + 12);
if (ms_excel_read_debug > 2) {
if (ms_excel_read_debug > 2)
printf ("%hx %hx\n", normalZoom, pageBreakZoom);
}
#endif
}
break;
......@@ -3381,9 +3364,7 @@ ms_excel_read_sheet (ExcelSheet *sheet, BiffQuery *q, ExcelWorkbook *wb)
}
}
}
if (ms_excel_workbook_detach (sheet->wb, sheet))
ms_excel_sheet_destroy (sheet);
sheet = NULL;
printf ("Error, hit end without EOF\n");
return FALSE;
......@@ -3586,11 +3567,29 @@ ms_excel_read_workbook (CommandContext *context, Workbook *workbook,
else
{
ExcelSheet *sheet = ms_excel_workbook_get_sheet (wb, current_sheet);
gboolean kill = FALSE;
ms_excel_sheet_set_version (sheet, ver->version);
if (ms_excel_read_sheet (sheet, q, wb)) {
if (ms_excel_read_sheet (sheet, q, wb)) {
ms_excel_sheet_realize_objs (sheet);
ms_excel_sheet_destroy_objs (sheet);
if (sheet_is_pristine (sheet->gnum_sheet) &&
current_sheet > 0)
kill = TRUE;
} else
kill = TRUE;
ms_excel_sheet_destroy_objs (sheet);
if (kill) {
#ifndef NO_DEBUG_EXCEL
if (ms_excel_read_debug > 1)
printf ("Blank or broken sheet %d\n", current_sheet);
#endif
if (ms_excel_workbook_detach (sheet->wb, sheet))
ms_excel_sheet_destroy (sheet);
}
current_sheet++;
}
} else if (ver->type == eBiffTChart)
......
......@@ -140,6 +140,8 @@ sheet_object_construct (SheetObject *so, Sheet *sheet)
so->bbox_points = gnome_canvas_points_new (2);
sheet->objects = g_list_prepend (sheet->objects, so);
sheet->modified = TRUE;
}
void
......
......@@ -191,7 +191,7 @@ summary_item_dump (SummaryItem *sit)
static gint
g_str_case_equal (gconstpointer v, gconstpointer v2)
{
return g_strcasecmp ((const gchar*) v, (const gchar*)v2) == 0;
return g_strcasecmp ((const gchar*) v, (const gchar*)v2) == 0;
}
/* a char* hash function from ASU */
......
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