mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
minor bug fixes
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@414 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
349b53757f
commit
79e3f02d5b
@ -141,10 +141,12 @@ cellCB (Widget mw, XtPointer cd, XtPointer cb)
|
|||||||
int invalid = 0;
|
int invalid = 0;
|
||||||
|
|
||||||
table = (Table *) cd;
|
table = (Table *) cd;
|
||||||
|
arr = table->cursor;
|
||||||
cbs = (XbaeMatrixDefaultActionCallbackStruct *) cb;
|
cbs = (XbaeMatrixDefaultActionCallbackStruct *) cb;
|
||||||
|
|
||||||
row = cbs->row;
|
row = cbs->row;
|
||||||
col = cbs->column;
|
col = cbs->column;
|
||||||
|
printf ("cell cb %d %d %d \n", row, col, cbs->reason);
|
||||||
|
|
||||||
/* can't edit outside of the physical space */
|
/* can't edit outside of the physical space */
|
||||||
invalid = (0 > row) || (0 > col) ;
|
invalid = (0 > row) || (0 > col) ;
|
||||||
@ -161,9 +163,8 @@ cellCB (Widget mw, XtPointer cd, XtPointer cb)
|
|||||||
/* remove offset for the header rows */
|
/* remove offset for the header rows */
|
||||||
rel_row -= table->num_header_rows;
|
rel_row -= table->num_header_rows;
|
||||||
|
|
||||||
/* prepare to call the cell callback */
|
/* check for a cell handler, but only if cell adress is valid */
|
||||||
arr = table->cursor;
|
if (arr && !invalid) {
|
||||||
if (arr) {
|
|
||||||
rel_row %= (arr->numRows);
|
rel_row %= (arr->numRows);
|
||||||
rel_col %= (arr->numCols);
|
rel_col %= (arr->numCols);
|
||||||
if (! (arr->cells[rel_row][rel_col])) invalid = TRUE;
|
if (! (arr->cells[rel_row][rel_col])) invalid = TRUE;
|
||||||
@ -191,14 +192,13 @@ cellCB (Widget mw, XtPointer cd, XtPointer cb)
|
|||||||
case XbaeTraverseCellReason: {
|
case XbaeTraverseCellReason: {
|
||||||
XbaeMatrixTraverseCellCallbackStruct *tcbs;
|
XbaeMatrixTraverseCellCallbackStruct *tcbs;
|
||||||
tcbs = (XbaeMatrixTraverseCellCallbackStruct *) cbs;
|
tcbs = (XbaeMatrixTraverseCellCallbackStruct *) cbs;
|
||||||
tcbs->next_row = 0;
|
|
||||||
tcbs->next_column = 0;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case XbaeLeaveCellReason: {
|
case XbaeLeaveCellReason: {
|
||||||
XbaeMatrixLeaveCellCallbackStruct *lcbs;
|
XbaeMatrixLeaveCellCallbackStruct *lcbs;
|
||||||
lcbs = (XbaeMatrixLeaveCellCallbackStruct *) cbs;
|
lcbs = (XbaeMatrixLeaveCellCallbackStruct *) cbs;
|
||||||
lcbs->doit = False;
|
/* must set doit to true in order to be able to leave the cell */
|
||||||
|
lcbs->doit = True;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user