[Gnucash-changes] r14468 - gnucash/trunk - When creating accounts from the register, fix the name parsing logic

David Hampton hampton at cvs.gnucash.org
Thu Jul 6 01:18:38 EDT 2006


Author: hampton
Date: 2006-07-06 01:18:36 -0400 (Thu, 06 Jul 2006)
New Revision: 14468
Trac: http://svn.gnucash.org/trac/changeset/14468

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/gnome-utils/dialog-account.c
Log:
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.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-07-05 20:42:00 UTC (rev 14467)
+++ gnucash/trunk/ChangeLog	2006-07-06 05:18:36 UTC (rev 14468)
@@ -1,3 +1,10 @@
+2006-07-06  David Hampton  <hampton at 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 at ihtfp.com>
 
 	* src/core-utils/gnc-glib-utils.h

Modified: gnucash/trunk/src/gnome-utils/dialog-account.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-account.c	2006-07-05 20:42:00 UTC (rev 14467)
+++ gnucash/trunk/src/gnome-utils/dialog-account.c	2006-07-06 05:18:36 UTC (rev 14468)
@@ -1555,10 +1555,14 @@
   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 @@
       break;
 
     group = xaccAccountGetChildren (account);
-    if (group == NULL)
-      break;
-    list = xaccGroupGetAccountList (group);
   }
 
   out_names = g_strdupv(ptr);



More information about the gnucash-changes mailing list