From 5849851a19380dbb62a47d9c4d868a81e42fa79b Mon Sep 17 00:00:00 2001 From: forsyth Date: Sat, 21 Aug 2010 18:01:11 +0100 Subject: 20100821-1800 --- libtk/grids.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) (limited to 'libtk/grids.c') diff --git a/libtk/grids.c b/libtk/grids.c index 4403fba2..e1ba5dd9 100644 --- a/libtk/grids.c +++ b/libtk/grids.c @@ -143,7 +143,7 @@ ensuregridsize(TkGrid *grid, Point dim) for(i = olddim.y; i < dim.y; i++){ cells[i] = malloc(sizeof(TkGridcell)*dim.x); if(cells[i] == nil){ - for(i--; i >= olddim.y; i--) + while(--i >= olddim.y) free(cells[i]); return TkNomem; } @@ -721,32 +721,6 @@ gridfindloc(TkGridbeam *beam, int blen, int f) return -1; } -/* - * optimised way to find a given slave, but somewhat more fragile - * as it assumes the slave has already been placed on the grid. - * not tested. - */ -static int -findslave(TkGrid *grid, Tk *tk, Point *pt) -{ - Point loc, dim, p; - TkGridcell **cells; - dim = grid->dim; - cells = grid->cells; - loc.x = gridfindloc(grid->cols, grid->dim.x, tk->act.x); - if(loc.x == -1) - loc.x = 0; - loc.y = gridfindloc(grid->rows, grid->dim.y, tk->act.y); - if(loc.y == -1) - loc.y = 0; - for(p.y = loc.y; p.y < dim.y; p.y++) - for(p.x = loc.x; p.x < dim.x; p.x++) - if(cells[p.y][p.x].tk == tk){ - *pt = p; - return 1; - } - return 0; -} static char* tkgridcellinfo(TkTop *t, char *arg, char **val, char *buf, char *ebuf) { -- cgit v1.2.3