2001-07-22 Dave Peticolas <dave@krondo.com>

* src/test/gnc-test-stuff.[ch] (get_random_price): new func.

	* src/register/splitreg.[ch]: remove null cell

	* src/engine/Transaction.h: update docs


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4974 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-07-22 08:54:55 +00:00
parent 7c11369570
commit fe3350dbc2
4 changed files with 10 additions and 69 deletions

View File

@ -1,3 +1,11 @@
2001-07-22 Dave Peticolas <dave@krondo.com>
* 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 <dave@krondo.com> 2001-07-21 Dave Peticolas <dave@krondo.com>
* src/register/cell-factory.[ch]: a new object for creation of * src/register/cell-factory.[ch]: a new object for creation of

View File

@ -224,31 +224,9 @@ Timespec xaccTransRetDatePostedTS (Transaction *trans);
int xaccTransCountSplits (Transaction *trans); int xaccTransCountSplits (Transaction *trans);
/* --------------------------------------------------------------- */ /* --------------------------------------------------------------- */
/* Commmodities. Most of the commodity routines below are/will /* Commmodity routines. Each transaction's 'currency' is by definition
* be obsolescent. They will all be replaced by two routines: * the balancing common currency for the splits in that transaction.
* 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'.
* */ * */
gnc_commodity * xaccTransGetCurrency (Transaction *trans); gnc_commodity * xaccTransGetCurrency (Transaction *trans);
void xaccTransSetCurrency (Transaction *trans, gnc_commodity *curr); void xaccTransSetCurrency (Transaction *trans, gnc_commodity *curr);

View File

@ -415,37 +415,6 @@ static void
configLayout (SplitRegister *reg) configLayout (SplitRegister *reg)
{ {
CellBlock *curs; 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) switch (reg->type)
{ {
@ -779,8 +748,6 @@ xaccInitSplitRegister (SplitRegister *reg,
/* --------------------------- */ /* --------------------------- */
/* malloc the workhorse cells */ /* 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, DATE_CELL, DATE_CELL_TYPE_NAME);
gnc_register_add_cell (reg, NUM_CELL, NUM_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); 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 */ /* config the layout of the cells in the cursors */
configLayout (reg); 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 */ /* The num cell is the transaction number */
xaccSetBasicCellBlankHelp (gnc_register_get_cell (reg, NUM_CELL), xaccSetBasicCellBlankHelp (gnc_register_get_cell (reg, NUM_CELL),
_("Enter the transaction number, such as the " _("Enter the transaction number, such as the "
@ -997,9 +957,6 @@ xaccDestroySplitRegister (SplitRegister *reg)
reg->cursor_journal_double = NULL; reg->cursor_journal_double = NULL;
reg->cursor_split = NULL; reg->cursor_split = NULL;
gnc_basic_cell_destroy (reg->nullCell);
reg->nullCell = NULL;
for (node = reg->cells; node; node = node->next) for (node = reg->cells; node; node = node->next)
{ {
CellNode *cn = node->data; CellNode *cn = node->data;

View File

@ -157,8 +157,6 @@ struct _SplitRegister
CellBlock * cursor_journal_double; CellBlock * cursor_journal_double;
CellBlock * cursor_split; CellBlock * cursor_split;
BasicCell * nullCell;
SplitRegisterType type; SplitRegisterType type;
SplitRegisterStyle style; SplitRegisterStyle style;
gboolean use_double_line; gboolean use_double_line;