Fix a rebalancing bug.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2690 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas
2000-08-22 08:26:32 +00:00
parent 1b33c45794
commit 34746c6ebf
2 changed files with 8 additions and 5 deletions

View File

@@ -1,5 +1,8 @@
2000-08-22 Dave Peticolas <dave@krondo.com>
* src/engine/Transaction.c (xaccSplitSetBaseValue): check to
make sure the security is not "" before allowing price changes.
* src/gnome/window-register.c (gnc_register_check_close): use
xaccSRCancelCursorTransChanges to cancel any pending changes.

View File

@@ -674,12 +674,12 @@ xaccSplitSetBaseValue (Split *s, double value, const char * base_currency)
}
}
if(s->acc &&
s->acc->security &&
safe_strcmp(s->acc->security, s->acc->currency) &&
!DEQEPS(s->damount, 0.0, ZERO_THRESH_VALUE)) {
if (s->acc &&
s->acc->security &&
*s->acc->security &&
safe_strcmp(s->acc->security, s->acc->currency) &&
!DEQEPS(s->damount, 0.0, ZERO_THRESH_VALUE))
adjust_price = 1;
}
/* The value of a split depends on the currency we express the
* value in. This may or may not require a divide.