fix serious and old core dup bug ... curious that

we haven't seen this before ... hmmm ...


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@857 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-05-31 02:24:22 +00:00
parent e045d73df1
commit e934fc2810
3 changed files with 24 additions and 4 deletions

View File

@ -542,7 +542,10 @@ xaccRefreshHeader (Table *table)
/* ==================================================== */
/* verifyCursorPosition checks the location of the cursor
* with respect to a row/column position, and repositions
* the cursor if necessary.
* the cursor if necessary. This includes saving any uncomited
* data in the old cursor, and then oving the cursor and it's
* GUI.
*
*/
void

View File

@ -172,6 +172,14 @@ verify_cell_interaction_OK(Table *table, const int row, const int col)
int rel_row, rel_col;
int invalid = 0;
/* make sure that we've repositioned the cursor to this location,
* and that we've dragged along any subsidiary GUI's with us.
* Do this *before* we use the value of the "current cursor"
*/
xaccVerifyCursorPosition (table, row, col);
arr = table->current_cursor;
/* compute the cell location */
rel_row = table->locators[row][col]->phys_row_offset;
rel_col = table->locators[row][col]->phys_col_offset;

View File

@ -153,12 +153,20 @@ cellCB (Widget mw, XtPointer cd, XtPointer cb)
int invalid = 0;
table = (Table *) cd;
arr = table->current_cursor;
cbs = (XbaeMatrixDefaultActionCallbackStruct *) cb;
row = cbs->row;
col = cbs->column;
/* if we are entering this cell, make sure that we've
* moved the cursor, and that any subsidiary GUI elements
* properly positioned. Do this *before* we examine the
* value of the "cuirrent cursor".
*/
if (XbaeEnterCellReason == cbs->reason) {
xaccVerifyCursorPosition (table, row, col);
}
/* can't edit outside of the physical space */
invalid = (0 > row) || (0 > col) ;
invalid = invalid || (row >= table->num_phys_rows);
@ -180,6 +188,7 @@ cellCB (Widget mw, XtPointer cd, XtPointer cb)
invalid = invalid || (0 > rel_col);
/* check for a cell handler, but only if cell adress is valid */
arr = table->current_cursor;
if (arr && !invalid) {
if (! (arr->cells[rel_row][rel_col])) {
invalid = TRUE;
@ -229,7 +238,6 @@ cellCB (Widget mw, XtPointer cd, XtPointer cb)
* this cell. Dispatch for processing. */
switch (cbs->reason) {
case XbaeEnterCellReason: {
xaccVerifyCursorPosition (table, row, col);
enterCB (mw, cd, cb);
break;
}
@ -270,7 +278,8 @@ enterCB (Widget mw, XtPointer cd, XtPointer cb)
rel_row = table->locators[row][col]->phys_row_offset;
rel_col = table->locators[row][col]->phys_col_offset;
printf ("enter %d %d \n", row, col);
printf ("enter %d %d (rel=%d %d %p) %p\n", row, col, rel_row, rel_col,
arr->cells[rel_row][rel_col], arr );
/* since we are here, there must be a cell handler.
* therefore, we accept entry into the cell by default,