Re-express table_find_cell algorithm to avoid relying upon side-effects.

svn path=/trunk/netsurf/; revision=3986
This commit is contained in:
John Mark Bell 2008-03-19 17:47:26 +00:00
parent 488520f2b2
commit 969acc3d0c

View File

@ -372,11 +372,19 @@ struct box *table_find_cell(struct box *table, unsigned int x,
if (table->columns <= x || table->rows <= y)
return 0;
for (row_group = table->children, row = row_group->children;
row_num != y;
(row = row->next) || (row_group = row_group->next,
row = row_group->children), row_num++)
;
row_group = table->children;
row = row_group->children;
while (row_num != y) {
if (row->next) {
row = row->next;
} else {
row_group = row_group->next;
row = row_group->children;
}
row_num++;
}
for (cell = row->children; cell; cell = cell->next)
if (cell->start_column <= x &&