[Gnucash-changes] r12255 - gnucash/trunk - When setting the amount of a split, don't call gnc_numeric_convert on

David Hampton hampton at cvs.gnucash.org
Tue Jan 3 22:58:51 EST 2006


Author: hampton
Date: 2006-01-03 22:58:49 -0500 (Tue, 03 Jan 2006)
New Revision: 12255
Trac: http://svn.gnucash.org/trac/changeset/12255

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/engine/Transaction.c
Log:
When setting the amount of a split, don't call gnc_numeric_convert on
it if the split isn't assigned to an account. This reduces the time
spent loading a data file.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-01-04 03:13:29 UTC (rev 12254)
+++ gnucash/trunk/ChangeLog	2006-01-04 03:58:49 UTC (rev 12255)
@@ -1,5 +1,9 @@
 2006-01-03  David Hampton  <hampton at employees.org>
 
+	* src/engine/Transaction.c: When setting the amount of a split,
+	don't call gnc_numeric_convert on it if the split isn't assigned
+	to an account. This reduces the time spent loading a data file.
+
 	* src/business/business-gnome/glade/invoice.glade: Couple the
 	radio buttons in the unpost dialog.
 

Modified: gnucash/trunk/src/engine/Transaction.c
===================================================================
--- gnucash/trunk/src/engine/Transaction.c	2006-01-04 03:13:29 UTC (rev 12254)
+++ gnucash/trunk/src/engine/Transaction.c	2006-01-04 03:58:49 UTC (rev 12255)
@@ -756,8 +756,11 @@
 	 s->amount.num, s->amount.denom, amt.num, amt.denom);
 
   check_open (s->parent);
-  s->amount = gnc_numeric_convert(amt, get_commodity_denom(s), 
-                                  GNC_HOW_RND_ROUND);
+  if (s->acc)
+    s->amount = gnc_numeric_convert(amt, get_commodity_denom(s), 
+				    GNC_HOW_RND_ROUND);
+  else
+    s->amount = amt;
 
   SET_GAINS_ADIRTY(s);
   mark_split (s);



More information about the gnucash-changes mailing list