[Gnucash-changes] r14431 - gnucash/branches/register-rewrite/src/backend/file - Remove more unnecessary fixups for impossible gnc_commodity conditions.
Chris Shoemaker
chris at cvs.gnucash.org
Sat Jun 24 17:07:17 EDT 2006
Author: chris
Date: 2006-06-24 17:07:16 -0400 (Sat, 24 Jun 2006)
New Revision: 14431
Trac: http://svn.gnucash.org/trac/changeset/14431
Modified:
gnucash/branches/register-rewrite/src/backend/file/io-gncxml-v2.c
Log:
Remove more unnecessary fixups for impossible gnc_commodity conditions.
Modified: gnucash/branches/register-rewrite/src/backend/file/io-gncxml-v2.c
===================================================================
--- gnucash/branches/register-rewrite/src/backend/file/io-gncxml-v2.c 2006-06-24 21:01:29 UTC (rev 14430)
+++ gnucash/branches/register-rewrite/src/backend/file/io-gncxml-v2.c 2006-06-24 21:07:16 UTC (rev 14431)
@@ -77,49 +77,6 @@
}
}
-static void
-clear_up_account_commodity(
- gnc_commodity_table *tbl, Account *act,
- gnc_commodity * (*getter) (const Account *account),
- void (*setter) (Account *account, gnc_commodity *comm),
- int (*scu_getter) (const Account *account),
- void (*scu_setter) (Account *account, int scu))
-{
- gnc_commodity *gcom;
- gnc_commodity *com = getter(act);
- int old_scu;
-
- if (scu_getter)
- old_scu = scu_getter(act);
- else
- old_scu = 0;
-
- if(!com)
- {
- return;
- }
-
- gcom = gnc_commodity_table_lookup(tbl, gnc_commodity_get_namespace(com),
- gnc_commodity_get_mnemonic(com));
-
- if (gcom == com)
- {
- return;
- }
- else if(!gcom)
- {
- PWARN("unable to find global commodity for %s adding new",
- gnc_commodity_get_unique_name(com));
- }
- else
- {
- setter(act, gcom);
- if (old_scu != 0 && scu_setter)
- scu_setter(act, old_scu);
- gnc_commodity_destroy(com);
- }
-}
-
static gboolean
add_account_local(sixtp_gdv2 *data, Account *act)
{
@@ -127,17 +84,6 @@
table = gnc_book_get_commodity_table (data->book);
- clear_up_account_commodity(table, act,
- DxaccAccountGetCurrency,
- DxaccAccountSetCurrency,
- NULL, NULL);
-
- clear_up_account_commodity(table, act,
- xaccAccountGetCommodity,
- xaccAccountSetCommodity,
- xaccAccountGetCommoditySCUi,
- xaccAccountSetCommoditySCU);
-
xaccAccountScrubCommodity (act);
xaccAccountScrubKvp (act);
More information about the gnucash-changes
mailing list