From fc493927d40a5ad3205e2f08829ffe3f8bb60f7e Mon Sep 17 00:00:00 2001 From: James Bursa Date: Tue, 8 Jul 2003 18:49:14 +0000 Subject: [project @ 2003-07-08 18:49:14 by bursa] Table span fixes. svn path=/import/netsurf/; revision=211 --- render/box.c | 10 ++++++---- render/layout.c | 5 ++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/render/box.c b/render/box.c index 13480ad2a..dca53b4e9 100644 --- a/render/box.c +++ b/render/box.c @@ -1170,10 +1170,8 @@ void box_normalise_table_row(struct box *row, } /* skip columns with cells spanning from above */ - while ((*row_span)[columns] != 0) { - (*row_span)[columns]--; + while ((*row_span)[columns] != 0) columns++; - } cell->start_column = columns; if (*table_columns < columns + cell->columns) { *table_columns = columns + cell->columns; @@ -1183,10 +1181,14 @@ void box_normalise_table_row(struct box *row, (*row_span)[*table_columns] = 0; /* sentinel */ } for (i = 0; i != cell->columns; i++) - (*row_span)[columns + i] = cell->rows - 1; + (*row_span)[columns + i] = cell->rows; columns += cell->columns; } + for (i = 0; i != *table_columns; i++) + if ((*row_span)[i] != 0) + (*row_span)[i]--; + /* if all columns have a rowspan, shrink it to the lowest equivalent */ min = (*row_span)[0]; for (i = 1; i != *table_columns; i++) diff --git a/render/layout.c b/render/layout.c index 7e1349c69..db26dadbf 100644 --- a/render/layout.c +++ b/render/layout.c @@ -704,7 +704,10 @@ void layout_table(struct box * table, unsigned long width, struct box * cont, c->height = 0; } for (i = 0; i != columns; i++) - row_span[i]--; + if (row_span[i] != 0) + row_span[i]--; + else + row_span_cell[i] = 0; /* if all columns have a row span, shrink it to the lowest equivalent */ min = row_span[0]; for (i = 1; i != columns; i++) -- cgit v1.2.3