validate cursor relative addressing

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@856 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-05-31 00:47:04 +00:00
parent bbdd9486e4
commit e045d73df1
2 changed files with 15 additions and 1 deletions

View File

@ -175,7 +175,14 @@ verify_cell_interaction_OK(Table *table, const int row, const int col)
/* compute the cell location */
rel_row = table->locators[row][col]->phys_row_offset;
rel_col = table->locators[row][col]->phys_col_offset;
/* verify that cursor offsets are valid. This may occur if
* the app that is using the table has a paritally initialized
* cursor. (probably due to a prograing error, but maybe they
* meant to do this). */
invalid = invalid || (0 > rel_row);
invalid = invalid || (0 > rel_col);
/* check for a cell handler, but only if cell adress is valid */
/* GTK may not need all these checks, but they don't hurt */
if (arr && !invalid) {

View File

@ -172,6 +172,13 @@ cellCB (Widget mw, XtPointer cd, XtPointer cb)
rel_row = table->locators[row][col]->phys_row_offset;
rel_col = table->locators[row][col]->phys_col_offset;
/* verify that cursor offsets are valid. This may occur if
* the app that is using the table has a paritally initialized
* cursor. (probably due to a prograing error, but maybe they
* meant to do this). */
invalid = invalid || (0 > rel_row);
invalid = invalid || (0 > rel_col);
/* check for a cell handler, but only if cell adress is valid */
if (arr && !invalid) {
if (! (arr->cells[rel_row][rel_col])) {