Bug #589954: No blank split after creating a new account "on the fly" while editing a transaction.

Cause was that gnc_split_register_get_account_by_name() turned of "full_refresh" if the account didn't already exist and turned it back on only if the name of the account actually created in the new account dialog box differed from the one originally entered in the transaction.

Since "full_refresh" isn't manipulated much, that effectively shut down the ledger for further editing. Probably not what the original author intended!



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19847 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
John Ralls 2010-11-19 22:22:01 +00:00
parent 89a3d07b20
commit 88e16264dd
3 changed files with 5 additions and 10 deletions

View File

@ -265,8 +265,7 @@ gnc_split_register_check_account (SplitRegister *reg,
info = gnc_split_register_get_info (reg);
new_acct = gnc_split_register_get_account_by_name (reg,
(BasicCell *) cell,
cell->cell.value,
&info->full_refresh);
cell->cell.value);
if (!new_acct)
return FALSE;
@ -1142,7 +1141,6 @@ gnc_split_register_get_account_always (SplitRegister *reg,
{
BasicCell *cell;
const char *name;
gboolean dummy;
cell = gnc_table_layout_get_cell (reg->table->layout, cell_name);
if (!cell)
@ -1156,7 +1154,7 @@ gnc_split_register_get_account_always (SplitRegister *reg,
return NULL;
}
return gnc_split_register_get_account_by_name (reg, cell, name, &dummy);
return gnc_split_register_get_account_by_name (reg, cell, name);
}
static const char *

View File

@ -167,7 +167,7 @@ CellBlock * gnc_split_register_get_active_cursor (SplitRegister *reg);
void gnc_split_register_set_last_num (SplitRegister *reg, const char *num);
Account * gnc_split_register_get_account_by_name(
SplitRegister *reg, BasicCell * cell, const char *name, gboolean *new);
SplitRegister *reg, BasicCell * cell, const char *name);
Account * gnc_split_register_get_account (SplitRegister *reg,
const char *cell_name);

View File

@ -1699,7 +1699,7 @@ gnc_split_register_save (SplitRegister *reg, gboolean do_commit)
Account *
gnc_split_register_get_account_by_name (SplitRegister *reg, BasicCell * bcell,
const char *name, gboolean *refresh)
const char *name)
{
const char *placeholder = _("The account %s does not allow transactions.");
const char *missing = _("The account %s does not exist. "
@ -1724,7 +1724,6 @@ gnc_split_register_get_account_by_name (SplitRegister *reg, BasicCell * bcell,
return NULL;
/* User said yes, they want to create a new account. */
*refresh = FALSE;
account = gnc_ui_new_accounts_from_name_window (name);
if (!account)
return NULL;
@ -1737,7 +1736,6 @@ gnc_split_register_get_account_by_name (SplitRegister *reg, BasicCell * bcell,
/* The name has changed. Update the cell. */
gnc_combo_cell_set_value (cell, account_name);
gnc_basic_cell_set_changed (&cell->cell, TRUE);
*refresh = TRUE;
}
g_free (account_name);
@ -1757,7 +1755,6 @@ gnc_split_register_get_account (SplitRegister *reg, const char * cell_name)
{
BasicCell *cell;
const char *name;
gboolean dummy;
if (!gnc_table_layout_get_cell_changed (reg->table->layout, cell_name, TRUE))
return NULL;
@ -1766,7 +1763,7 @@ gnc_split_register_get_account (SplitRegister *reg, const char * cell_name)
if (!cell)
return NULL;
name = gnc_basic_cell_get_value (cell);
return gnc_split_register_get_account_by_name (reg, cell, name, &dummy);
return gnc_split_register_get_account_by_name (reg, cell, name);
}
static gboolean