mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-09-03 20:53:02 -05:00
When creating accounts from the register, fix the name parsing logic
to correctly handle the case where the first new account will be the first child of its parent. Fixes #345771. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14468 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2006-07-06 David Hampton <hampton@employees.org>
|
||||
|
||||
* src/gnome-utils/dialog-account.c: When creating accounts from
|
||||
the register, fix the name parsing logic to correctly handle the
|
||||
case where the first new account will be the first child of its
|
||||
parent. Fixes #345771.
|
||||
|
||||
2006-07-04 Derek Atkins <derek@ihtfp.com>
|
||||
|
||||
* src/core-utils/gnc-glib-utils.h
|
||||
|
||||
@@ -1555,10 +1555,14 @@ gnc_split_account_name (const char *in_name, Account **base_account)
|
||||
GList *list, *node;
|
||||
|
||||
group = gnc_get_current_group ();
|
||||
list = xaccGroupGetAccountList (group);
|
||||
names = g_strsplit(in_name, gnc_get_account_separator_string(), -1);
|
||||
|
||||
for (ptr = names; *ptr; ptr++) {
|
||||
/* Stop if there are no children at the current level. */
|
||||
if (group == NULL)
|
||||
break;
|
||||
list = xaccGroupGetAccountList (group);
|
||||
|
||||
/* Look for the first name in the children. */
|
||||
for (node = list; node; node = g_list_next(node)) {
|
||||
account = node->data;
|
||||
@@ -1575,9 +1579,6 @@ gnc_split_account_name (const char *in_name, Account **base_account)
|
||||
break;
|
||||
|
||||
group = xaccAccountGetChildren (account);
|
||||
if (group == NULL)
|
||||
break;
|
||||
list = xaccGroupGetAccountList (group);
|
||||
}
|
||||
|
||||
out_names = g_strdupv(ptr);
|
||||
|
||||
Reference in New Issue
Block a user