Skip to content

Commit

Permalink
When setting the amount of a split, don't call gnc_numeric_convert on
Browse files Browse the repository at this point in the history
it if the split isn't assigned to an account. This reduces the time
spent loading a data file.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@12255 57a11ea4-9604-0410-9ed3-97b8803252fd
  • Loading branch information
David Hampton committed Jan 4, 2006
1 parent eb17dde commit 9568565
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
2006-01-03 David Hampton <hampton@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.

Expand Down
7 changes: 5 additions & 2 deletions src/engine/Transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,8 +756,11 @@ xaccSplitSetAmount (Split *s, gnc_numeric amt)
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);
Expand Down

0 comments on commit 9568565

Please sign in to comment.