|
|
|
|
@ -749,13 +749,12 @@ xaccSplitDestroy (Split *split)
|
|
|
|
|
trans = split->parent;
|
|
|
|
|
assert (trans);
|
|
|
|
|
assert (trans->splits);
|
|
|
|
|
CHECK_OPEN (trans);
|
|
|
|
|
// temp hack alert -- get rid of annoying error messages
|
|
|
|
|
// CHECK_OPEN (trans);
|
|
|
|
|
|
|
|
|
|
numsplits = 0;
|
|
|
|
|
s = trans->splits[0];
|
|
|
|
|
while (s) {
|
|
|
|
|
/* xxxxxxx */
|
|
|
|
|
printf ("SplitDestroy(): trans=%p, %d'th split=%p\n", trans, numsplits, s);
|
|
|
|
|
MARK_SPLIT(s);
|
|
|
|
|
if (s == split) ismember = 1;
|
|
|
|
|
numsplits ++;
|
|
|
|
|
@ -763,10 +762,17 @@ printf ("SplitDestroy(): trans=%p, %d'th split=%p\n", trans, numsplits, s);
|
|
|
|
|
}
|
|
|
|
|
assert (ismember);
|
|
|
|
|
|
|
|
|
|
/* if the account has three or more splits,
|
|
|
|
|
/* If the account has three or more splits,
|
|
|
|
|
* merely unlink & free the split.
|
|
|
|
|
*
|
|
|
|
|
* Or if the account has only two splits, and the
|
|
|
|
|
* split to be destroyed is a price split (i.e.
|
|
|
|
|
* has a damount value of zero), then
|
|
|
|
|
* merely unlink & free the split.
|
|
|
|
|
*/
|
|
|
|
|
if (2 < numsplits) {
|
|
|
|
|
if ((2 < numsplits) ||
|
|
|
|
|
((2 == numsplits) && (DEQ(0.0, split->damount))))
|
|
|
|
|
{
|
|
|
|
|
MARK_SPLIT (split);
|
|
|
|
|
xaccTransRemoveSplit (trans, split);
|
|
|
|
|
acc = split->acc;
|
|
|
|
|
|