r19847 - gnucash/trunk/src/register/ledger-core - Bug #589954: No blank split after creating a new account "on the fly" while editing a transaction.

John Ralls jralls at code.gnucash.org
Fri Nov 19 17:22:01 EST 2010


Author: jralls
Date: 2010-11-19 17:22:01 -0500 (Fri, 19 Nov 2010)
New Revision: 19847
Trac: http://svn.gnucash.org/trac/changeset/19847

Modified:
   gnucash/trunk/src/register/ledger-core/split-register-control.c
   gnucash/trunk/src/register/ledger-core/split-register-p.h
   gnucash/trunk/src/register/ledger-core/split-register.c
Log:
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!



Modified: gnucash/trunk/src/register/ledger-core/split-register-control.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/split-register-control.c	2010-11-19 22:21:21 UTC (rev 19846)
+++ gnucash/trunk/src/register/ledger-core/split-register-control.c	2010-11-19 22:22:01 UTC (rev 19847)
@@ -265,8 +265,7 @@
     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 @@
 {
     BasicCell *cell;
     const char *name;
-    gboolean dummy;
 
     cell = gnc_table_layout_get_cell (reg->table->layout, cell_name);
     if (!cell)
@@ -1156,7 +1154,7 @@
         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 *

Modified: gnucash/trunk/src/register/ledger-core/split-register-p.h
===================================================================
--- gnucash/trunk/src/register/ledger-core/split-register-p.h	2010-11-19 22:21:21 UTC (rev 19846)
+++ gnucash/trunk/src/register/ledger-core/split-register-p.h	2010-11-19 22:22:01 UTC (rev 19847)
@@ -167,7 +167,7 @@
 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);
 

Modified: gnucash/trunk/src/register/ledger-core/split-register.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/split-register.c	2010-11-19 22:21:21 UTC (rev 19846)
+++ gnucash/trunk/src/register/ledger-core/split-register.c	2010-11-19 22:22:01 UTC (rev 19847)
@@ -1699,7 +1699,7 @@
 
 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 @@
             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 @@
         /* 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 @@
 {
     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 @@
     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



More information about the gnucash-changes mailing list