r14613 - gnucash/trunk/src/register/ledger-core - Minor renaming and reordering for clarity in gnc_split_register_load().

Chris Shoemaker chris at cvs.gnucash.org
Tue Aug 8 18:52:39 EDT 2006


Author: chris
Date: 2006-08-08 18:52:37 -0400 (Tue, 08 Aug 2006)
New Revision: 14613
Trac: http://svn.gnucash.org/trac/changeset/14613

Modified:
   gnucash/trunk/src/register/ledger-core/split-register-load.c
Log:
   Minor renaming and reordering for clarity in gnc_split_register_load().


Modified: gnucash/trunk/src/register/ledger-core/split-register-load.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/split-register-load.c	2006-08-08 22:12:07 UTC (rev 14612)
+++ gnucash/trunk/src/register/ledger-core/split-register-load.c	2006-08-08 22:52:37 UTC (rev 14613)
@@ -270,7 +270,7 @@
   /* figure out where we are going to. */
   if (info->traverse_to_new)
   {
-    find_trans = xaccSplitGetParent (blank_split);
+    find_trans = blank_trans;
     find_split = NULL;
     find_trans_split = blank_split;
   }
@@ -355,9 +355,6 @@
 
   table->model->dividing_row = -1;
 
-  if (multi_line)
-    trans_table = g_hash_table_new (g_direct_hash, g_direct_equal);
-
   // Ensure that the transaction and splits being edited are in the split
   // list we're about to load.
   if (pending_trans != NULL)
@@ -382,6 +379,9 @@
     }
   }
 
+  if (multi_line)
+    trans_table = g_hash_table_new (g_direct_hash, g_direct_equal);
+
   /* populate the table */
   for (node = slist; node; node = node->next) 
   {
@@ -443,17 +443,28 @@
     g_hash_table_destroy (trans_table);
 
   /* add the blank split at the end. */
-  split = blank_split;
-  trans = xaccSplitGetParent (split);
-  if (pending_trans == trans)
+  if (pending_trans == blank_trans)
     found_pending = TRUE;
 
-  if (trans == find_trans)
+  if (blank_trans == find_trans)
     new_trans_row = vcell_loc.virt_row;
 
-  if (split == find_trans_split)
+  if (blank_split == find_trans_split)
     new_trans_split_row = vcell_loc.virt_row;
 
+  /* If we didn't find the pending transaction, it was removed
+   * from the account. */
+  if (!found_pending)
+  {
+      info->pending_trans_guid = *guid_null ();
+      if (xaccTransIsOpen (pending_trans))
+          xaccTransCommitEdit (pending_trans);
+      else if (pending_trans) 
+          g_assert_not_reached();
+
+      pending_trans = NULL;
+  }
+
   /* go to blank on first pass */
   if (info->first_pass)
   {
@@ -466,7 +477,7 @@
     save_loc.phys_col_offset = 0;
   }
 
-  gnc_split_register_add_transaction (reg, trans, split,
+  gnc_split_register_add_transaction (reg, blank_trans, blank_split,
                                       lead_cursor, split_cursor,
                                       multi_line, start_primary_color,
                                       info->blank_split_edited, find_trans,
@@ -524,19 +535,6 @@
     cursor_buffer = NULL;
   }
 
-  /* If we didn't find the pending transaction, it was removed
-   * from the account. */
-  if (!found_pending)
-  {
-      info->pending_trans_guid = *guid_null ();
-      if (xaccTransIsOpen (pending_trans))
-          xaccTransCommitEdit (pending_trans);
-      else if (pending_trans) 
-          g_assert_not_reached();
-
-      pending_trans = NULL;
-  }
-
   /* Set up the hint transaction, split, transaction split, and column. */
   info->cursor_hint_trans = gnc_split_register_get_current_trans (reg);
   info->cursor_hint_split = gnc_split_register_get_current_split (reg);



More information about the gnucash-changes mailing list