Commit be1d650d authored by Michael Meeks's avatar Michael Meeks

fix sheet_get_extent.

parent 77b90313
1999-12-16 Michael Meeks <mmeeks@gnu.org>
* src/sheet.c (sheet_get_extent_cb): Fix biggest leak ever seen,
use cell_is_blank.
1999-12-14 Cort Dougan <cort@ppc.kernel.org>
* src/corba-sheet.c (Sheet_range_set_font, Sheet_range_set_foreground),
......
1999-12-16 Michael Meeks <mmeeks@gnu.org>
* src/sheet.c (sheet_get_extent_cb): Fix biggest leak ever seen,
use cell_is_blank.
1999-12-14 Cort Dougan <cort@ppc.kernel.org>
* src/corba-sheet.c (Sheet_range_set_font, Sheet_range_set_foreground),
......
......@@ -560,26 +560,24 @@ sheet_cell_fetch (Sheet *sheet, int col, int row)
* checks the cell to see if should be used to calculate sheet extent
**/
static void
sheet_get_extent_cb (gpointer key, gpointer value, gpointer data) {
sheet_get_extent_cb (gpointer key, gpointer value, gpointer data)
{
Cell *cell = (Cell *) value;
if ( cell ) {
gchar *text = cell_get_text( cell );
if ( strcmp( text, "") ) {
Range *range = (Range *)data;
if ( cell->row->pos < range->start.row) {
range->start.row = cell->row->pos;
}
if ( cell->row->pos > range->end.row) {
range->end.row = cell->row->pos;
}
if ( cell->col->pos < range->start.col) {
range->start.col = cell->col->pos;
}
if ( cell->col->pos > range->end.col) {
range->end.col = cell->col->pos;
}
}
if ( cell && !cell_is_blank (cell)) {
Range *range = (Range *)data;
if ( cell->row->pos < range->start.row)
range->start.row = cell->row->pos;
if ( cell->row->pos > range->end.row)
range->end.row = cell->row->pos;
if ( cell->col->pos < range->start.col)
range->start.col = cell->col->pos;
if ( cell->col->pos > range->end.col)
range->end.col = cell->col->pos;
}
}
......
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