Commit f103433a authored by Michael Meeks's avatar Michael Meeks

Sheet.c 'fix', various small excel touchups, nicer default size.

parent c7f8e1c0
1999-04-06 Michael Meeks <michael@imaginator.com>
* src/workbook.c (workbook_new): More sensible default
size.
* src/sheet.c (sheet_row_set_height): use sheet_row_new()
instead of sheet_duplicate_colrow(), as we get duff span
data otherwise ( not calling row_init_span )
(sheet_col_set_width): Re-order, presumably fixing bug,
and as for set_height.
1999-04-06 Miguel de Icaza <miguel@nuclecu.unam.mx> 1999-04-06 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/xml-io.c (createXmlSheet): New function. Used in an initial * src/xml-io.c (createXmlSheet): New function. Used in an initial
......
1999-04-06 Michael Meeks <michael@imaginator.com>
* src/workbook.c (workbook_new): More sensible default
size.
* src/sheet.c (sheet_row_set_height): use sheet_row_new()
instead of sheet_duplicate_colrow(), as we get duff span
data otherwise ( not calling row_init_span )
(sheet_col_set_width): Re-order, presumably fixing bug,
and as for set_height.
1999-04-06 Miguel de Icaza <miguel@nuclecu.unam.mx> 1999-04-06 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/xml-io.c (createXmlSheet): New function. Used in an initial * src/xml-io.c (createXmlSheet): New function. Used in an initial
......
1999-04-06 Michael Meeks <michael@imaginator.com>
* src/workbook.c (workbook_new): More sensible default
size.
* src/sheet.c (sheet_row_set_height): use sheet_row_new()
instead of sheet_duplicate_colrow(), as we get duff span
data otherwise ( not calling row_init_span )
(sheet_col_set_width): Re-order, presumably fixing bug,
and as for set_height.
1999-04-06 Miguel de Icaza <miguel@nuclecu.unam.mx> 1999-04-06 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/xml-io.c (createXmlSheet): New function. Used in an initial * src/xml-io.c (createXmlSheet): New function. Used in an initial
......
1999-04-06 Michael Meeks <michael@imaginator.com>
* src/workbook.c (workbook_new): More sensible default
size.
* src/sheet.c (sheet_row_set_height): use sheet_row_new()
instead of sheet_duplicate_colrow(), as we get duff span
data otherwise ( not calling row_init_span )
(sheet_col_set_width): Re-order, presumably fixing bug,
and as for set_height.
1999-04-06 Miguel de Icaza <miguel@nuclecu.unam.mx> 1999-04-06 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/xml-io.c (createXmlSheet): New function. Used in an initial * src/xml-io.c (createXmlSheet): New function. Used in an initial
......
1999-04-06 Michael Meeks <michael@imaginator.com>
* ms-formula.h: Add PTG_AREAN, PTG_REFN.
* ms-formula.c: Debug for these cases.
(ms_excel_parse_formula): Added shared row/col.
Updated ms_excel_sheet_shared_formula call.
* ms-excel.c (ms_excel_sheet_shared_formula): Include
new arguments.
(ms_excel_read_cells): Update all parse_formula calls.
(ms_excel_set_cell_xf): Set auto_return argument to 0 for
cell_set_alignment.
move cell_set_colors to last thing.
* ms-excel.h: Update prototype.
1999-04-05 Miguel de Icaza <miguel@nuclecu.unam.mx> 1999-04-05 Miguel de Icaza <miguel@nuclecu.unam.mx>
* ms-ole.c (biff_getdouble): Move biff_getdouble here, and apply * ms-ole.c (biff_getdouble): Move biff_getdouble here, and apply
......
...@@ -854,8 +854,7 @@ ms_excel_set_cell_xf (MS_EXCEL_SHEET * sheet, Cell * cell, guint16 xfidx) ...@@ -854,8 +854,7 @@ ms_excel_set_cell_xf (MS_EXCEL_SHEET * sheet, Cell * cell, guint16 xfidx)
/* /*
* Well set it up then ! FIXME: hack ! * Well set it up then ! FIXME: hack !
*/ */
cell_set_alignment (cell, xf->halign, xf->valign, ORIENT_HORIZ, 1); cell_set_alignment (cell, xf->halign, xf->valign, ORIENT_HORIZ, 0);
ms_excel_set_cell_colors (sheet, cell, xf);
ms_excel_set_cell_font (sheet, cell, xf); ms_excel_set_cell_font (sheet, cell, xf);
if (sheet->wb->palette) if (sheet->wb->palette)
{ {
...@@ -876,6 +875,7 @@ ms_excel_set_cell_xf (MS_EXCEL_SHEET * sheet, Cell * cell, guint16 xfidx) ...@@ -876,6 +875,7 @@ ms_excel_set_cell_xf (MS_EXCEL_SHEET * sheet, Cell * cell, guint16 xfidx)
cell_set_format_from_style (cell, xf->style_format) ; cell_set_format_from_style (cell, xf->style_format) ;
} }
} }
ms_excel_set_cell_colors (sheet, cell, xf);
} }
static StyleBorderType static StyleBorderType
...@@ -1154,15 +1154,18 @@ ms_excel_sheet_new (MS_EXCEL_WORKBOOK * wb, char *name) ...@@ -1154,15 +1154,18 @@ ms_excel_sheet_new (MS_EXCEL_WORKBOOK * wb, char *name)
char * char *
ms_excel_sheet_shared_formula (MS_EXCEL_SHEET *sheet, ms_excel_sheet_shared_formula (MS_EXCEL_SHEET *sheet,
int shr_col, int shr_row,
int col, int row) int col, int row)
{ {
BIFF_SHARED_FORMULA_KEY k ; BIFF_SHARED_FORMULA_KEY k ;
BIFF_SHARED_FORMULA *sf ; BIFF_SHARED_FORMULA *sf ;
k.col = col ; k.col = shr_col ;
k.row = row ; k.row = shr_row ;
sf = g_hash_table_lookup (sheet->shared_formulae, &k) ; sf = g_hash_table_lookup (sheet->shared_formulae, &k) ;
if (sf) if (sf)
return ms_excel_parse_formula (sheet, sf->data, col, row, sf->data_len) ; return ms_excel_parse_formula (sheet, sf->data,
col, row, shr_col, shr_row,
sf->data_len) ;
printf ("Duff shared formula index %d %d\n", col, row) ; printf ("Duff shared formula index %d %d\n", col, row) ;
return strdup ("00") ; return strdup ("00") ;
} }
...@@ -1579,6 +1582,7 @@ ms_excel_read_cell (BIFF_QUERY * q, MS_EXCEL_SHEET * sheet) ...@@ -1579,6 +1582,7 @@ ms_excel_read_cell (BIFF_QUERY * q, MS_EXCEL_SHEET * sheet)
printf ("Shared formula of extent %d %d %d %d\n", printf ("Shared formula of extent %d %d %d %d\n",
array_col_first, array_row_first, array_col_last, array_row_last) ; array_col_first, array_row_first, array_col_last, array_row_last) ;
txt = ms_excel_parse_formula (sheet, data, txt = ms_excel_parse_formula (sheet, data,
array_col_first, array_row_first,
array_col_first, array_row_first, array_col_first, array_row_first,
data_len) ; data_len) ;
/* NB. This keeps the pre-set XF record */ /* NB. This keeps the pre-set XF record */
...@@ -1613,6 +1617,7 @@ ms_excel_read_cell (BIFF_QUERY * q, MS_EXCEL_SHEET * sheet) ...@@ -1613,6 +1617,7 @@ ms_excel_read_cell (BIFF_QUERY * q, MS_EXCEL_SHEET * sheet)
for (ylp=array_row_first;ylp<=array_row_last;ylp++) for (ylp=array_row_first;ylp<=array_row_last;ylp++)
{ {
char *txt = ms_excel_parse_formula (sheet, data, char *txt = ms_excel_parse_formula (sheet, data,
xlp, ylp,
xlp, ylp, data_len) ; xlp, ylp, data_len) ;
/* NB. This keeps the pre-set XF record */ /* NB. This keeps the pre-set XF record */
Cell *cell = sheet_cell_fetch (sheet->gnum_sheet, xlp, ylp); Cell *cell = sheet_cell_fetch (sheet->gnum_sheet, xlp, ylp);
...@@ -1625,6 +1630,7 @@ ms_excel_read_cell (BIFF_QUERY * q, MS_EXCEL_SHEET * sheet) ...@@ -1625,6 +1630,7 @@ ms_excel_read_cell (BIFF_QUERY * q, MS_EXCEL_SHEET * sheet)
case BIFF_FORMULA: /* See: S59D8F.HTM */ case BIFF_FORMULA: /* See: S59D8F.HTM */
{ {
char *txt = ms_excel_parse_formula (sheet, (q->data + 22), char *txt = ms_excel_parse_formula (sheet, (q->data + 22),
EX_GETCOL (q), EX_GETROW (q),
EX_GETCOL (q), EX_GETROW (q), EX_GETCOL (q), EX_GETROW (q),
BIFF_GETWORD(q->data+20)); BIFF_GETWORD(q->data+20));
ms_excel_sheet_insert (sheet, EX_GETXF(q), EX_GETCOL(q), EX_GETROW(q), txt) ; ms_excel_sheet_insert (sheet, EX_GETXF(q), EX_GETCOL(q), EX_GETROW(q), txt) ;
......
...@@ -47,6 +47,7 @@ extern void ms_excel_sheet_insert (MS_EXCEL_SHEET *sheet, ...@@ -47,6 +47,7 @@ extern void ms_excel_sheet_insert (MS_EXCEL_SHEET *sheet,
int xfidx, int col, int xfidx, int col,
int row, char *text) ; int row, char *text) ;
extern char *ms_excel_sheet_shared_formula (MS_EXCEL_SHEET *sheet, extern char *ms_excel_sheet_shared_formula (MS_EXCEL_SHEET *sheet,
int shr_col, int shr_row,
int col, int row) ; int col, int row) ;
typedef struct _MS_EXCEL_PALETTE typedef struct _MS_EXCEL_PALETTE
......
...@@ -854,8 +854,7 @@ ms_excel_set_cell_xf (MS_EXCEL_SHEET * sheet, Cell * cell, guint16 xfidx) ...@@ -854,8 +854,7 @@ ms_excel_set_cell_xf (MS_EXCEL_SHEET * sheet, Cell * cell, guint16 xfidx)
/* /*
* Well set it up then ! FIXME: hack ! * Well set it up then ! FIXME: hack !
*/ */
cell_set_alignment (cell, xf->halign, xf->valign, ORIENT_HORIZ, 1); cell_set_alignment (cell, xf->halign, xf->valign, ORIENT_HORIZ, 0);
ms_excel_set_cell_colors (sheet, cell, xf);
ms_excel_set_cell_font (sheet, cell, xf); ms_excel_set_cell_font (sheet, cell, xf);
if (sheet->wb->palette) if (sheet->wb->palette)
{ {
...@@ -876,6 +875,7 @@ ms_excel_set_cell_xf (MS_EXCEL_SHEET * sheet, Cell * cell, guint16 xfidx) ...@@ -876,6 +875,7 @@ ms_excel_set_cell_xf (MS_EXCEL_SHEET * sheet, Cell * cell, guint16 xfidx)
cell_set_format_from_style (cell, xf->style_format) ; cell_set_format_from_style (cell, xf->style_format) ;
} }
} }
ms_excel_set_cell_colors (sheet, cell, xf);
} }
static StyleBorderType static StyleBorderType
...@@ -1154,15 +1154,18 @@ ms_excel_sheet_new (MS_EXCEL_WORKBOOK * wb, char *name) ...@@ -1154,15 +1154,18 @@ ms_excel_sheet_new (MS_EXCEL_WORKBOOK * wb, char *name)
char * char *
ms_excel_sheet_shared_formula (MS_EXCEL_SHEET *sheet, ms_excel_sheet_shared_formula (MS_EXCEL_SHEET *sheet,
int shr_col, int shr_row,
int col, int row) int col, int row)
{ {
BIFF_SHARED_FORMULA_KEY k ; BIFF_SHARED_FORMULA_KEY k ;
BIFF_SHARED_FORMULA *sf ; BIFF_SHARED_FORMULA *sf ;
k.col = col ; k.col = shr_col ;
k.row = row ; k.row = shr_row ;
sf = g_hash_table_lookup (sheet->shared_formulae, &k) ; sf = g_hash_table_lookup (sheet->shared_formulae, &k) ;
if (sf) if (sf)
return ms_excel_parse_formula (sheet, sf->data, col, row, sf->data_len) ; return ms_excel_parse_formula (sheet, sf->data,
col, row, shr_col, shr_row,
sf->data_len) ;
printf ("Duff shared formula index %d %d\n", col, row) ; printf ("Duff shared formula index %d %d\n", col, row) ;
return strdup ("00") ; return strdup ("00") ;
} }
...@@ -1579,6 +1582,7 @@ ms_excel_read_cell (BIFF_QUERY * q, MS_EXCEL_SHEET * sheet) ...@@ -1579,6 +1582,7 @@ ms_excel_read_cell (BIFF_QUERY * q, MS_EXCEL_SHEET * sheet)
printf ("Shared formula of extent %d %d %d %d\n", printf ("Shared formula of extent %d %d %d %d\n",
array_col_first, array_row_first, array_col_last, array_row_last) ; array_col_first, array_row_first, array_col_last, array_row_last) ;
txt = ms_excel_parse_formula (sheet, data, txt = ms_excel_parse_formula (sheet, data,
array_col_first, array_row_first,
array_col_first, array_row_first, array_col_first, array_row_first,
data_len) ; data_len) ;
/* NB. This keeps the pre-set XF record */ /* NB. This keeps the pre-set XF record */
...@@ -1613,6 +1617,7 @@ ms_excel_read_cell (BIFF_QUERY * q, MS_EXCEL_SHEET * sheet) ...@@ -1613,6 +1617,7 @@ ms_excel_read_cell (BIFF_QUERY * q, MS_EXCEL_SHEET * sheet)
for (ylp=array_row_first;ylp<=array_row_last;ylp++) for (ylp=array_row_first;ylp<=array_row_last;ylp++)
{ {
char *txt = ms_excel_parse_formula (sheet, data, char *txt = ms_excel_parse_formula (sheet, data,
xlp, ylp,
xlp, ylp, data_len) ; xlp, ylp, data_len) ;
/* NB. This keeps the pre-set XF record */ /* NB. This keeps the pre-set XF record */
Cell *cell = sheet_cell_fetch (sheet->gnum_sheet, xlp, ylp); Cell *cell = sheet_cell_fetch (sheet->gnum_sheet, xlp, ylp);
...@@ -1625,6 +1630,7 @@ ms_excel_read_cell (BIFF_QUERY * q, MS_EXCEL_SHEET * sheet) ...@@ -1625,6 +1630,7 @@ ms_excel_read_cell (BIFF_QUERY * q, MS_EXCEL_SHEET * sheet)
case BIFF_FORMULA: /* See: S59D8F.HTM */ case BIFF_FORMULA: /* See: S59D8F.HTM */
{ {
char *txt = ms_excel_parse_formula (sheet, (q->data + 22), char *txt = ms_excel_parse_formula (sheet, (q->data + 22),
EX_GETCOL (q), EX_GETROW (q),
EX_GETCOL (q), EX_GETROW (q), EX_GETCOL (q), EX_GETROW (q),
BIFF_GETWORD(q->data+20)); BIFF_GETWORD(q->data+20));
ms_excel_sheet_insert (sheet, EX_GETXF(q), EX_GETCOL(q), EX_GETROW(q), txt) ; ms_excel_sheet_insert (sheet, EX_GETXF(q), EX_GETCOL(q), EX_GETROW(q), txt) ;
......
...@@ -47,6 +47,7 @@ extern void ms_excel_sheet_insert (MS_EXCEL_SHEET *sheet, ...@@ -47,6 +47,7 @@ extern void ms_excel_sheet_insert (MS_EXCEL_SHEET *sheet,
int xfidx, int col, int xfidx, int col,
int row, char *text) ; int row, char *text) ;
extern char *ms_excel_sheet_shared_formula (MS_EXCEL_SHEET *sheet, extern char *ms_excel_sheet_shared_formula (MS_EXCEL_SHEET *sheet,
int shr_col, int shr_row,
int col, int row) ; int col, int row) ;
typedef struct _MS_EXCEL_PALETTE typedef struct _MS_EXCEL_PALETTE
......
...@@ -439,7 +439,7 @@ getRefV7(MS_EXCEL_SHEET *sheet, BYTE col, WORD gbitrw, int curcol, int currow) ...@@ -439,7 +439,7 @@ getRefV7(MS_EXCEL_SHEET *sheet, BYTE col, WORD gbitrw, int curcol, int currow)
if (cr->col_relative) if (cr->col_relative)
cr->col-= curcol ; cr->col-= curcol ;
cr->sheet = sheet->gnum_sheet ; cr->sheet = sheet->gnum_sheet ;
/* printf ("7Out : %d, %d at %d, %d\n", cr->col, cr->row, curcol, currow) ; */ /* printf ("7Out : %d, %d at %d, %d\n", cr->col, cr->row, curcol, currow) ; */
return cr ; return cr ;
} }
/** /**
...@@ -459,7 +459,7 @@ getRefV8(MS_EXCEL_SHEET *sheet, WORD row, WORD gbitcl, int curcol, int currow) ...@@ -459,7 +459,7 @@ getRefV8(MS_EXCEL_SHEET *sheet, WORD row, WORD gbitcl, int curcol, int currow)
if (cr->col_relative) if (cr->col_relative)
cr->col-= curcol ; cr->col-= curcol ;
cr->sheet = sheet->gnum_sheet ; cr->sheet = sheet->gnum_sheet ;
/* printf ("8Out : %d, %d at %d, %d\n", cr->col, cr->row, curcol, currow) ; */ /* printf ("8Out : %d, %d at %d, %d\n", cr->col, cr->row, curcol, currow) ; */
return cr ; return cr ;
} }
...@@ -696,7 +696,8 @@ make_function (PARSE_LIST *stack, int fn_idx, int numargs) ...@@ -696,7 +696,8 @@ make_function (PARSE_LIST *stack, int fn_idx, int numargs)
* Return a dynamicaly allocated string containing the formula, never NULL * Return a dynamicaly allocated string containing the formula, never NULL
**/ **/
char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem, char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
int fn_col, int fn_row, guint16 length) int fn_col, int fn_row,
int shr_col, int shr_row, guint16 length)
{ {
Cell *cell ; Cell *cell ;
int len_left = length ; int len_left = length ;
...@@ -732,6 +733,10 @@ char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem, ...@@ -732,6 +733,10 @@ char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
printf ("Ptg : 0x%x -> 0x%x\n", ptg, ptgbase) ; printf ("Ptg : 0x%x -> 0x%x\n", ptg, ptgbase) ;
switch (ptgbase) switch (ptgbase)
{ {
case FORMULA_PTG_REFN:
printf ("REFN\n") ;
dump(mem, length) ;
break ;
case FORMULA_PTG_REF: case FORMULA_PTG_REF:
{ {
CellRef *ref ; CellRef *ref ;
...@@ -856,6 +861,10 @@ char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem, ...@@ -856,6 +861,10 @@ char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
g_free (ref) ; g_free (ref) ;
} }
break ; break ;
case FORMULA_PTG_AREAN:
printf ("REFN\n") ;
dump(mem, length) ;
break ;
case FORMULA_PTG_AREA: case FORMULA_PTG_AREA:
{ {
CellRef *first, *last ; CellRef *first, *last ;
...@@ -921,7 +930,8 @@ char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem, ...@@ -921,7 +930,8 @@ char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
int top_left_row = BIFF_GETWORD(cur+0) ; int top_left_row = BIFF_GETWORD(cur+0) ;
char *txt ; char *txt ;
txt = ms_excel_sheet_shared_formula (sheet, top_left_col, txt = ms_excel_sheet_shared_formula (sheet, top_left_col,
top_left_row) ; top_left_row,
fn_col, fn_row) ;
txt[0] = ' ' ; /* Kill '=' */ txt[0] = ' ' ; /* Kill '=' */
parse_list_push_raw (stack, txt, NO_PRECEDENCE) ; parse_list_push_raw (stack, txt, NO_PRECEDENCE) ;
ptg_length = 4 ; ptg_length = 4 ;
...@@ -952,7 +962,8 @@ char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem, ...@@ -952,7 +962,8 @@ char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
} }
if (w) if (w)
txt = ms_excel_parse_formula (sheet, cur+ptg_length, txt = ms_excel_parse_formula (sheet, cur+ptg_length,
fn_col, fn_row, w) ; fn_col, fn_row, shr_col, shr_row,
w) ;
else else
txt = g_strdup(" ") ; txt = g_strdup(" ") ;
txt[0] = ' ' ; /* Kill the = */ txt[0] = ' ' ; /* Kill the = */
......
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
#include "ms-biff.h" #include "ms-biff.h"
char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem, char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
int fn_col, int fn_row, guint16 length) ; int fn_col, int fn_row,
int shr_col, int shr_row, guint16 length) ;
/** /**
* See S59E2B.HTM * See S59E2B.HTM
...@@ -37,6 +38,8 @@ char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem, ...@@ -37,6 +38,8 @@ char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
#define FORMULA_PTG_REF 0x24 #define FORMULA_PTG_REF 0x24
#define FORMULA_PTG_AREA 0x25 #define FORMULA_PTG_AREA 0x25
#define FORMULA_PTG_MEM_AREA 0x26 #define FORMULA_PTG_MEM_AREA 0x26
#define FORMULA_PTG_REFN 0x2c
#define FORMULA_PTG_AREAN 0x2d
#define FORMULA_PTG_NAME_X 0x39 #define FORMULA_PTG_NAME_X 0x39
#define FORMULA_PTG_REF_3D 0x3a #define FORMULA_PTG_REF_3D 0x3a
#define FORMULA_PTG_AREA_3D 0x3b #define FORMULA_PTG_AREA_3D 0x3b
......
...@@ -439,7 +439,7 @@ getRefV7(MS_EXCEL_SHEET *sheet, BYTE col, WORD gbitrw, int curcol, int currow) ...@@ -439,7 +439,7 @@ getRefV7(MS_EXCEL_SHEET *sheet, BYTE col, WORD gbitrw, int curcol, int currow)
if (cr->col_relative) if (cr->col_relative)
cr->col-= curcol ; cr->col-= curcol ;
cr->sheet = sheet->gnum_sheet ; cr->sheet = sheet->gnum_sheet ;
/* printf ("7Out : %d, %d at %d, %d\n", cr->col, cr->row, curcol, currow) ; */ /* printf ("7Out : %d, %d at %d, %d\n", cr->col, cr->row, curcol, currow) ; */
return cr ; return cr ;
} }
/** /**
...@@ -459,7 +459,7 @@ getRefV8(MS_EXCEL_SHEET *sheet, WORD row, WORD gbitcl, int curcol, int currow) ...@@ -459,7 +459,7 @@ getRefV8(MS_EXCEL_SHEET *sheet, WORD row, WORD gbitcl, int curcol, int currow)
if (cr->col_relative) if (cr->col_relative)
cr->col-= curcol ; cr->col-= curcol ;
cr->sheet = sheet->gnum_sheet ; cr->sheet = sheet->gnum_sheet ;
/* printf ("8Out : %d, %d at %d, %d\n", cr->col, cr->row, curcol, currow) ; */ /* printf ("8Out : %d, %d at %d, %d\n", cr->col, cr->row, curcol, currow) ; */
return cr ; return cr ;
} }
...@@ -696,7 +696,8 @@ make_function (PARSE_LIST *stack, int fn_idx, int numargs) ...@@ -696,7 +696,8 @@ make_function (PARSE_LIST *stack, int fn_idx, int numargs)
* Return a dynamicaly allocated string containing the formula, never NULL * Return a dynamicaly allocated string containing the formula, never NULL
**/ **/
char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem, char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
int fn_col, int fn_row, guint16 length) int fn_col, int fn_row,
int shr_col, int shr_row, guint16 length)
{ {
Cell *cell ; Cell *cell ;
int len_left = length ; int len_left = length ;
...@@ -732,6 +733,10 @@ char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem, ...@@ -732,6 +733,10 @@ char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
printf ("Ptg : 0x%x -> 0x%x\n", ptg, ptgbase) ; printf ("Ptg : 0x%x -> 0x%x\n", ptg, ptgbase) ;
switch (ptgbase) switch (ptgbase)
{ {
case FORMULA_PTG_REFN:
printf ("REFN\n") ;
dump(mem, length) ;
break ;
case FORMULA_PTG_REF: case FORMULA_PTG_REF:
{ {
CellRef *ref ; CellRef *ref ;
...@@ -856,6 +861,10 @@ char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem, ...@@ -856,6 +861,10 @@ char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
g_free (ref) ; g_free (ref) ;
} }
break ; break ;
case FORMULA_PTG_AREAN:
printf ("REFN\n") ;
dump(mem, length) ;
break ;
case FORMULA_PTG_AREA: case FORMULA_PTG_AREA:
{ {
CellRef *first, *last ; CellRef *first, *last ;
...@@ -921,7 +930,8 @@ char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem, ...@@ -921,7 +930,8 @@ char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
int top_left_row = BIFF_GETWORD(cur+0) ; int top_left_row = BIFF_GETWORD(cur+0) ;
char *txt ; char *txt ;
txt = ms_excel_sheet_shared_formula (sheet, top_left_col, txt = ms_excel_sheet_shared_formula (sheet, top_left_col,
top_left_row) ; top_left_row,
fn_col, fn_row) ;
txt[0] = ' ' ; /* Kill '=' */ txt[0] = ' ' ; /* Kill '=' */
parse_list_push_raw (stack, txt, NO_PRECEDENCE) ; parse_list_push_raw (stack, txt, NO_PRECEDENCE) ;
ptg_length = 4 ; ptg_length = 4 ;
...@@ -952,7 +962,8 @@ char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem, ...@@ -952,7 +962,8 @@ char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
} }
if (w) if (w)
txt = ms_excel_parse_formula (sheet, cur+ptg_length, txt = ms_excel_parse_formula (sheet, cur+ptg_length,
fn_col, fn_row, w) ; fn_col, fn_row, shr_col, shr_row,
w) ;
else else
txt = g_strdup(" ") ; txt = g_strdup(" ") ;
txt[0] = ' ' ; /* Kill the = */ txt[0] = ' ' ; /* Kill the = */
......
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
#include "ms-biff.h" #include "ms-biff.h"
char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem, char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
int fn_col, int fn_row, guint16 length) ; int fn_col, int fn_row,
int shr_col, int shr_row, guint16 length) ;
/** /**
* See S59E2B.HTM * See S59E2B.HTM
...@@ -37,6 +38,8 @@ char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem, ...@@ -37,6 +38,8 @@ char *ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
#define FORMULA_PTG_REF 0x24 #define FORMULA_PTG_REF 0x24
#define FORMULA_PTG_AREA 0x25 #define FORMULA_PTG_AREA 0x25
#define FORMULA_PTG_MEM_AREA 0x26 #define FORMULA_PTG_MEM_AREA 0x26
#define FORMULA_PTG_REFN 0x2c
#define FORMULA_PTG_AREAN 0x2d
#define FORMULA_PTG_NAME_X 0x39 #define FORMULA_PTG_NAME_X 0x39
#define FORMULA_PTG_REF_3D 0x3a #define FORMULA_PTG_REF_3D 0x3a
#define FORMULA_PTG_AREA_3D 0x3b #define FORMULA_PTG_AREA_3D 0x3b
......
...@@ -453,7 +453,7 @@ sheet_row_set_height (Sheet *sheet, int row, int height, gboolean height_set_by_ ...@@ -453,7 +453,7 @@ sheet_row_set_height (Sheet *sheet, int row, int height, gboolean height_set_by_
ri = sheet_row_get_info (sheet, row); ri = sheet_row_get_info (sheet, row);
if (ri == &sheet->default_row_style){ if (ri == &sheet->default_row_style){
ri = sheet_duplicate_colrow (ri); ri = sheet_row_new (sheet) ;
ri->pos = row; ri->pos = row;
add = 1; add = 1;
} }
...@@ -566,8 +566,8 @@ sheet_col_set_width (Sheet *sheet, int col, int width) ...@@ -566,8 +566,8 @@ sheet_col_set_width (Sheet *sheet, int col, int width)
ci = sheet_col_get_info (sheet, col); ci = sheet_col_get_info (sheet, col);
if (ci == &sheet->default_col_style){ if (ci == &sheet->default_col_style){
ci = sheet_col_new (sheet);
ci->pos = col; ci->pos = col;
ci = sheet_duplicate_colrow (ci);
add = 1; add = 1;
} }
......
...@@ -1312,6 +1312,7 @@ workbook_new (void) ...@@ -1312,6 +1312,7 @@ workbook_new (void)
wb->symbol_names = symbol_table_new (); wb->symbol_names = symbol_table_new ();
gtk_window_set_policy(GTK_WINDOW(wb->toplevel), 1, 1, 0); gtk_window_set_policy(GTK_WINDOW(wb->toplevel), 1, 1, 0);
gtk_window_set_default_size (GTK_WINDOW(wb->toplevel), 600, 400) ;
wb->max_iterations = 1; wb->max_iterations = 1;
......
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