mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
parent
bbdd9486e4
commit
e045d73df1
@ -176,6 +176,13 @@ verify_cell_interaction_OK(Table *table, const int row, const int col)
|
|||||||
rel_row = table->locators[row][col]->phys_row_offset;
|
rel_row = table->locators[row][col]->phys_row_offset;
|
||||||
rel_col = table->locators[row][col]->phys_col_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 */
|
/* check for a cell handler, but only if cell adress is valid */
|
||||||
/* GTK may not need all these checks, but they don't hurt */
|
/* GTK may not need all these checks, but they don't hurt */
|
||||||
if (arr && !invalid) {
|
if (arr && !invalid) {
|
||||||
|
@ -172,6 +172,13 @@ cellCB (Widget mw, XtPointer cd, XtPointer cb)
|
|||||||
rel_row = table->locators[row][col]->phys_row_offset;
|
rel_row = table->locators[row][col]->phys_row_offset;
|
||||||
rel_col = table->locators[row][col]->phys_col_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 */
|
/* check for a cell handler, but only if cell adress is valid */
|
||||||
if (arr && !invalid) {
|
if (arr && !invalid) {
|
||||||
if (! (arr->cells[rel_row][rel_col])) {
|
if (! (arr->cells[rel_row][rel_col])) {
|
||||||
|
Loading…
Reference in New Issue
Block a user