mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-02-17 06:54:42 +03:00
Re-express table_find_cell algorithm to avoid relying upon side-effects.
svn path=/trunk/netsurf/; revision=3986
This commit is contained in:
parent
488520f2b2
commit
969acc3d0c
@ -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 &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user