Commit 76720896 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Fix crash. This is not the real cause but it is the symptom.

A typo in sheet_get_extent must be fixed to truely solve the problem.

2000-06-19  Jody Goldberg <jgoldberg@home.com>

	* ms-excel-write.c (excel_cell_get) : Add some invariants as
	  protection.
	(pre_cell) : Be more careful about handling cells that are potentially
	  out of bounds.
parent c2928e92
2000-06-19 Jody Goldberg <jgoldberg@home.com>
* ms-excel-write.c (excel_cell_get) : Add some invariants as
protection.
(pre_cell) : Be more careful about handling cells that are potentially
out of bounds.
2000-06-18 Jody Goldberg <jgoldberg@home.com>
* Release 0.55
......
......@@ -1415,6 +1415,8 @@ put_mstyle (ExcelWorkbook *wb, MStyle *st)
inline static ExcelCell *
excel_cell_get (ExcelSheet *sheet, int col, int row)
{
g_return_val_if_fail (col < sheet->maxx, NULL);
g_return_val_if_fail (row < sheet->maxy, NULL);
return *(sheet->cells + row) + col;
}
......@@ -1438,6 +1440,13 @@ pre_cell (gconstpointer dummy, Cell *cell, ExcelSheet *sheet)
printf ("Pre cell %s\n", cell_coord_name (col, row));
}
#endif
if (col >= sheet->maxx || row >= sheet->maxy) {
/* sheet_get_extent clipped blank cells, this had better be blank. */
g_return_if_fail (cell_is_blank (cell));
return;
}
cell_mark_used (sheet, col, row);
if (cell_has_expr (cell))
ms_formula_build_pre_data (sheet, cell->u.expression);
......
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