Commit 098168c3 authored by Jody Goldberg's avatar Jody Goldberg

XL sets the size of impossible cols sometimes.

parent 34dedd4c
1999-09-26 Jody Goldberg <jgoldberg@home.com>
* ms-excel-read.c (ms_excel_read_cell:COLINFO) : Seems like
XL periodically sends column widths for phantom columns.
1999-09-26 Michael Meeks <michael@nuclecu.unam.mx> 1999-09-26 Michael Meeks <michael@nuclecu.unam.mx>
* ms-excel-read.c (biff_name_data_new): add sheet scope. * ms-excel-read.c (biff_name_data_new): add sheet scope.
......
...@@ -389,16 +389,16 @@ biff_boundsheet_data_new (ExcelWorkbook *wb, BiffQuery *q, eBiff_version ver) ...@@ -389,16 +389,16 @@ biff_boundsheet_data_new (ExcelWorkbook *wb, BiffQuery *q, eBiff_version ver)
} }
ans->streamStartPos = MS_OLE_GET_GUINT32 (q->data); ans->streamStartPos = MS_OLE_GET_GUINT32 (q->data);
switch (MS_OLE_GET_GUINT8 (q->data + 4)) { switch (MS_OLE_GET_GUINT8 (q->data + 4)) {
case 00: case 0:
ans->type = eBiffTWorksheet; ans->type = eBiffTWorksheet;
break; break;
case 01: case 1:
ans->type = eBiffTMacrosheet; ans->type = eBiffTMacrosheet;
break; break;
case 02: case 2:
ans->type = eBiffTChart; ans->type = eBiffTChart;
break; break;
case 06: case 6:
ans->type = eBiffTVBModule; ans->type = eBiffTVBModule;
break; break;
default: default:
...@@ -962,8 +962,8 @@ typedef struct _BiffXFData { ...@@ -962,8 +962,8 @@ typedef struct _BiffXFData {
gboolean wrap; gboolean wrap;
guint8 rotation; guint8 rotation;
eBiff_eastern eastern; eBiff_eastern eastern;
guint8 border_color[4]; /* Array [StyleSide] */ guint8 border_color[STYLE_ORIENT_MAX];
StyleBorderType border_type[4]; /* Array [StyleSide] */ StyleBorderType border_type[STYLE_ORIENT_MAX];
eBiff_border_orientation border_orientation; eBiff_border_orientation border_orientation;
StyleBorderType border_linestyle; StyleBorderType border_linestyle;
guint8 fill_pattern_idx; guint8 fill_pattern_idx;
...@@ -2197,7 +2197,7 @@ ms_excel_read_cell (BiffQuery *q, ExcelSheet *sheet) ...@@ -2197,7 +2197,7 @@ ms_excel_read_cell (BiffQuery *q, ExcelSheet *sheet)
BiffXFData const *xf = NULL; BiffXFData const *xf = NULL;
BiffFontData const *fd = NULL; BiffFontData const *fd = NULL;
guint16 const firstcol = MS_OLE_GET_GUINT16(q->data); guint16 const firstcol = MS_OLE_GET_GUINT16(q->data);
guint16 const lastcol = MS_OLE_GET_GUINT16(q->data+2); guint16 lastcol = MS_OLE_GET_GUINT16(q->data+2);
guint16 width = MS_OLE_GET_GUINT16(q->data+4); guint16 width = MS_OLE_GET_GUINT16(q->data+4);
guint16 const cols_xf = MS_OLE_GET_GUINT16(q->data+6); guint16 const cols_xf = MS_OLE_GET_GUINT16(q->data+6);
guint16 const options = MS_OLE_GET_GUINT16(q->data+8); guint16 const options = MS_OLE_GET_GUINT16(q->data+8);
...@@ -2246,7 +2246,11 @@ ms_excel_read_cell (BiffQuery *q, ExcelSheet *sheet) ...@@ -2246,7 +2246,11 @@ ms_excel_read_cell (BiffQuery *q, ExcelSheet *sheet)
* horizontally. (NOTE : this is different from vertically) * horizontally. (NOTE : this is different from vertically)
*/ */
width *= .70; width *= .70;
for (lp=firstcol;lp<=lastcol;lp++)
/* NOTE : seems like this is inclusive firstcol, inclusive lastcol */
if (lastcol >= SHEET_MAX_COLS)
lastcol = SHEET_MAX_COLS-1;
for (lp = firstcol ; lp <= lastcol ; ++lp)
sheet_col_set_width (sheet->gnum_sheet, lp, sheet_col_set_width (sheet->gnum_sheet, lp,
width); width);
break; break;
...@@ -2490,7 +2494,6 @@ ms_excel_read_sheet (ExcelSheet *sheet, BiffQuery *q, ExcelWorkbook *wb) ...@@ -2490,7 +2494,6 @@ ms_excel_read_sheet (ExcelSheet *sheet, BiffQuery *q, ExcelWorkbook *wb)
sheet->gnum_sheet->name); sheet->gnum_sheet->name);
} }
return TRUE; return TRUE;
break;
case BIFF_OBJ: /* See: ms-obj.c and S59DAD.HTM */ case BIFF_OBJ: /* See: ms-obj.c and S59DAD.HTM */
sheet->obj_queue = g_list_append (sheet->obj_queue, sheet->obj_queue = g_list_append (sheet->obj_queue,
......
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