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>
* 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)
}
ans->streamStartPos = MS_OLE_GET_GUINT32 (q->data);
switch (MS_OLE_GET_GUINT8 (q->data + 4)) {
case 00:
case 0:
ans->type = eBiffTWorksheet;
break;
case 01:
case 1:
ans->type = eBiffTMacrosheet;
break;
case 02:
case 2:
ans->type = eBiffTChart;
break;
case 06:
case 6:
ans->type = eBiffTVBModule;
break;
default:
......@@ -962,8 +962,8 @@ typedef struct _BiffXFData {
gboolean wrap;
guint8 rotation;
eBiff_eastern eastern;
guint8 border_color[4]; /* Array [StyleSide] */
StyleBorderType border_type[4]; /* Array [StyleSide] */
guint8 border_color[STYLE_ORIENT_MAX];
StyleBorderType border_type[STYLE_ORIENT_MAX];
eBiff_border_orientation border_orientation;
StyleBorderType border_linestyle;
guint8 fill_pattern_idx;
......@@ -2197,7 +2197,7 @@ ms_excel_read_cell (BiffQuery *q, ExcelSheet *sheet)
BiffXFData const *xf = NULL;
BiffFontData const *fd = NULL;
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 const cols_xf = MS_OLE_GET_GUINT16(q->data+6);
guint16 const options = MS_OLE_GET_GUINT16(q->data+8);
......@@ -2246,7 +2246,11 @@ ms_excel_read_cell (BiffQuery *q, ExcelSheet *sheet)
* horizontally. (NOTE : this is different from vertically)
*/
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,
width);
break;
......@@ -2490,7 +2494,6 @@ ms_excel_read_sheet (ExcelSheet *sheet, BiffQuery *q, ExcelWorkbook *wb)
sheet->gnum_sheet->name);
}
return TRUE;
break;
case BIFF_OBJ: /* See: ms-obj.c and S59DAD.HTM */
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