Fix register bug.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2429 57a11ea4-9604-0410-9ed3-97b8803252fd
zzzoldreleases/1.4
Dave Peticolas 26 years ago
parent 852b4f0ef8
commit 004a533bbd

@ -1,5 +1,9 @@
2000-06-06 Dave Peticolas <dave@krondo.com>
* src/SplitLedger.c (LedgerTraverse): use correct argument for
exact_cell to gnc_table_find_valid_cell_horiz.
(LedgerMoveCursor): ditto.
* src/register/splitreg.c (xaccInitSplitRegister): Don't blank
zeros in the price cell.

@ -142,6 +142,10 @@ struct _SRInfo
/* If the hints were set by the traverse callback */
gncBoolean hint_set_by_traverse;
/* A flag indicating if the last traversal was 'exact'.
* See table-allgui.[ch] for details. */
gncBoolean exact_traversal;
/* The default account where new splits are added */
Account *default_source_account;
@ -737,8 +741,8 @@ LedgerMoveCursor (Table *table,
else if (new_phys_col >= table->num_phys_cols)
new_phys_col = table->num_phys_cols - 1;
gnc_table_find_valid_cell_horiz(table, &new_phys_row,
&new_phys_col, GNC_F);
gnc_table_find_valid_cell_horiz(table, &new_phys_row, &new_phys_col,
info->exact_traversal);
*p_new_phys_row = new_phys_row;
*p_new_phys_col = new_phys_col;
@ -1067,6 +1071,8 @@ LedgerTraverse (Table *table,
GNCVerifyResult result;
Split *split;
info->exact_traversal = (dir == GNC_TABLE_TRAVERSE_POINTER);
split = xaccSRGetCurrentSplit(reg);
trans = xaccSRGetCurrentTrans(reg);
if (trans == NULL)
@ -1084,7 +1090,8 @@ LedgerTraverse (Table *table,
if (phys_row >= table->num_phys_rows)
phys_row = table->num_phys_rows - 1;
gnc_table_find_valid_cell_horiz(table, &phys_row, &phys_col, GNC_F);
gnc_table_find_valid_cell_horiz(table, &phys_row, &phys_col,
info->exact_traversal);
*p_new_phys_row = phys_row;
*p_new_phys_col = phys_col;
@ -1129,12 +1136,14 @@ LedgerTraverse (Table *table,
if (phys_row < reg->num_header_rows)
{
phys_row = reg->num_header_rows;
gnc_table_find_valid_cell_horiz(table, &phys_row, &phys_col, GNC_F);
gnc_table_find_valid_cell_horiz(table, &phys_row, &phys_col,
info->exact_traversal);
}
if (phys_row >= table->num_phys_rows)
{
phys_row = table->num_phys_rows - 1;
gnc_table_find_valid_cell_horiz(table, &phys_row, &phys_col, GNC_F);
gnc_table_find_valid_cell_horiz(table, &phys_row, &phys_col,
info->exact_traversal);
}
/* Same transaction, no problem */
@ -2098,8 +2107,8 @@ xaccSRCancelCursorSplitChanges (SplitRegister *reg)
if (!changed)
return;
/* We're just cancelling the current split here, not the transaction */
/* When cancelling edits, reload the cursor from the transaction */
/* We're just cancelling the current split here, not the transaction.
* When cancelling edits, reload the cursor from the transaction. */
split = xaccSRGetCurrentSplit(reg);
xaccSRLoadRegEntry(reg, split);
xaccSplitRegisterClearChangeFlag(reg);
@ -3597,6 +3606,7 @@ xaccSRLoadRegister (SplitRegister *reg, Split **slist,
info->cursor_hint_trans_split = xaccSRGetCurrentTransSplit (reg);
info->cursor_hint_phys_col = -1;
info->hint_set_by_traverse = GNC_F;
info->exact_traversal = GNC_F;
xaccRefreshTableGUI (table);

@ -420,7 +420,9 @@ gnc_table_traverse_update(Table *table,
int *dest_row,
int *dest_col);
/* Find the closest valid horizontal cell */
/* Find the closest valid horizontal cell. If exact_cell is true,
* cells that must be explicitly selected by the user (as opposed
* to just tabbing into), are considered valid cells. */
gncBoolean
gnc_table_find_valid_cell_horiz(Table *table, int *row, int *col,
gncBoolean exact_cell);

Loading…
Cancel
Save