diff --git a/ChangeLog b/ChangeLog index d44b2a10ef..91f6c6fe0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2001-07-22 Dave Peticolas + + * src/test/gnc-test-stuff.[ch] (get_random_price): new func. + + * src/register/splitreg.[ch]: remove null cell + + * src/engine/Transaction.h: update docs + 2001-07-21 Dave Peticolas * src/register/cell-factory.[ch]: a new object for creation of diff --git a/src/engine/Transaction.h b/src/engine/Transaction.h index bbfb871133..0af01fca52 100644 --- a/src/engine/Transaction.h +++ b/src/engine/Transaction.h @@ -224,31 +224,9 @@ Timespec xaccTransRetDatePostedTS (Transaction *trans); int xaccTransCountSplits (Transaction *trans); /* --------------------------------------------------------------- */ -/* Commmodities. Most of the commodity routines below are/will - * be obsolescent. They will all be replaced by two routines: - * xaccTransSet/GetCurrency(). - * - * Semantics: Each transaction's 'currency' is by definition the - * balancing common currency for the splits in that transaction. - * - * The xaccTransGetCurrency() routine will give the same result - * as xaccTransFindCommonCurrency(), except that 'finding' won't - * be necessary: the common currency will be stored with the - * transaction. This will guarentee that a common currency is - * always avaiable, thus eliminating the need for many of the other - * checks and comparisons. - * - * Note side effect: the Account structure will no longer store a - * 'currency' and a 'security'. Instead it will store only one - * commodity (i.e. currency), that is the one formerly known as - * 'security'. Meanwhile, we'll be in a transition period, where we - * store the currency both in the account and the transaction. Warning - * messages will print to the screen if things don't go well. If - * there are no warnings after a few months, then we'll make the - * transition permanent. Meanwhile, the xaccTransSetCurrency() will - * attempt to do 'the right thing'. +/* Commmodity routines. Each transaction's 'currency' is by definition + * the balancing common currency for the splits in that transaction. * */ - gnc_commodity * xaccTransGetCurrency (Transaction *trans); void xaccTransSetCurrency (Transaction *trans, gnc_commodity *curr); diff --git a/src/register/splitreg.c b/src/register/splitreg.c index 5714d55fcf..a46df647fe 100644 --- a/src/register/splitreg.c +++ b/src/register/splitreg.c @@ -415,37 +415,6 @@ static void configLayout (SplitRegister *reg) { CellBlock *curs; - int i; - - /* fill things up with null cells */ - for (i = 0; i < reg->cursor_header->num_cols; i++) - { - CellBlockCell *cb_cell; - - cb_cell = gnc_cellblock_get_cell (reg->cursor_header, 0, i); - cb_cell->cell = reg->nullCell; - - cb_cell = gnc_cellblock_get_cell (reg->cursor_ledger_single, 0, i); - cb_cell->cell = reg->nullCell; - - cb_cell = gnc_cellblock_get_cell (reg->cursor_ledger_double, 0, i); - cb_cell->cell = reg->nullCell; - - cb_cell = gnc_cellblock_get_cell (reg->cursor_ledger_double, 1, i); - cb_cell->cell = reg->nullCell; - - cb_cell = gnc_cellblock_get_cell (reg->cursor_journal_single, 0, i); - cb_cell->cell = reg->nullCell; - - cb_cell = gnc_cellblock_get_cell (reg->cursor_journal_double, 0, i); - cb_cell->cell = reg->nullCell; - - cb_cell = gnc_cellblock_get_cell (reg->cursor_journal_double, 1, i); - cb_cell->cell = reg->nullCell; - - cb_cell = gnc_cellblock_get_cell (reg->cursor_split, 0, i); - cb_cell->cell = reg->nullCell; - } switch (reg->type) { @@ -779,8 +748,6 @@ xaccInitSplitRegister (SplitRegister *reg, /* --------------------------- */ /* malloc the workhorse cells */ - reg->nullCell = gnc_register_make_cell (BASIC_CELL_TYPE_NAME); - gnc_register_add_cell (reg, DATE_CELL, DATE_CELL_TYPE_NAME); gnc_register_add_cell (reg, NUM_CELL, NUM_CELL_TYPE_NAME); gnc_register_add_cell (reg, DESC_CELL, QUICKFILL_CELL_TYPE_NAME); @@ -807,13 +774,6 @@ xaccInitSplitRegister (SplitRegister *reg, /* config the layout of the cells in the cursors */ configLayout (reg); - /* The Null Cell is used to make sure that "empty" cells stay empty. - * This solves the problem of having the table be reformatted, the - * result of which is that an empty cell has landed on a cell that - * was previously non-empty. We want to make sure that we erase - * those cell contents. The null cells handles this for us. */ - xaccSetBasicCellValue (reg->nullCell, ""); - /* The num cell is the transaction number */ xaccSetBasicCellBlankHelp (gnc_register_get_cell (reg, NUM_CELL), _("Enter the transaction number, such as the " @@ -997,9 +957,6 @@ xaccDestroySplitRegister (SplitRegister *reg) reg->cursor_journal_double = NULL; reg->cursor_split = NULL; - gnc_basic_cell_destroy (reg->nullCell); - reg->nullCell = NULL; - for (node = reg->cells; node; node = node->next) { CellNode *cn = node->data; diff --git a/src/register/splitreg.h b/src/register/splitreg.h index 6fb8b445d3..be32fa4a14 100644 --- a/src/register/splitreg.h +++ b/src/register/splitreg.h @@ -157,8 +157,6 @@ struct _SplitRegister CellBlock * cursor_journal_double; CellBlock * cursor_split; - BasicCell * nullCell; - SplitRegisterType type; SplitRegisterStyle style; gboolean use_double_line;