Use xaccGroupGetAccountList instead of old api.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3364 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2000-12-28 22:41:04 +00:00
parent 47a0ffaca7
commit d8dca024bf

View File

@ -718,13 +718,14 @@ xml_add_account_restorer(xmlNodePtr p, Account* a) {
{ {
AccountGroup *g = xaccAccountGetChildren(a); AccountGroup *g = xaccAccountGetChildren(a);
if(g) { if(g) {
guint32 num_accounts = xaccGroupGetNumAccounts(g); GList *list = xaccGroupGetAccountList (g);
guint32 i = 0; GList *node;
while(i < num_accounts) {
Account *current_acc = xaccGroupGetAccount(g, i);
if(!xml_add_account_restorer(p, current_acc)) return(FALSE); for (node = list; node; node = node->next) {
i++; Account *current_acc = node->data;
if(!xml_add_account_restorer(p, current_acc))
return(FALSE);
} }
} }
} }
@ -733,17 +734,17 @@ xml_add_account_restorer(xmlNodePtr p, Account* a) {
static gboolean static gboolean
xml_add_account_restorers(xmlNodePtr p, AccountGroup *g) { xml_add_account_restorers(xmlNodePtr p, AccountGroup *g) {
guint32 i = 0; GList *list;
guint32 num_accounts; GList *node;
if(!p) return(FALSE); if(!p) return(FALSE);
if(!g) return(FALSE); if(!g) return(FALSE);
num_accounts = xaccGroupGetNumAccounts(g); list = xaccGroupGetAccountList (g);
while(i < num_accounts) {
Account *current_acc = xaccGroupGetAccount(g, i); for (node = list; node; node = node->next) {
Account *current_acc = node->data;
xml_add_account_restorer(p, current_acc); xml_add_account_restorer(p, current_acc);
i++;
} }
return(TRUE); return(TRUE);
} }