bugfix test for subsplits

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9387 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 2003-09-21 04:48:10 +00:00
parent 2b6830e50d
commit ebec50d7c4

View File

@ -52,23 +52,20 @@ static short module = MOD_LOT;
/* ================================================================= */ /* ================================================================= */
static KvpFrame * static inline gboolean
is_subsplit (Split *split) is_subsplit (Split *split)
{ {
KvpValue *kval; KvpValue *kval;
KvpFrame *ksub;
if (!split) return NULL; /* generic stop-progress conditions */
g_return_val_if_fail (split->parent, NULL); if (!split) return FALSE;
g_return_val_if_fail (split->parent, FALSE);
/* If there are no sub-splits, then there's nothing to do. */ /* If there are no sub-splits, then there's nothing to do. */
kval = kvp_frame_get_slot (split->kvp_data, "lot-split"); kval = kvp_frame_get_slot (split->kvp_data, "lot-split");
if (!kval) return NULL; if (!kval) return FALSE;
ksub = kvp_value_get_frame (kval); return TRUE;
g_return_val_if_fail (ksub, NULL);
return ksub;
} }
/* ================================================================= */ /* ================================================================= */
@ -79,7 +76,7 @@ xaccScrubSubSplitPrice (Split *split)
gnc_numeric src_amt, src_val; gnc_numeric src_amt, src_val;
SplitList *node; SplitList *node;
if (NULL == is_subsplit (split)) return; if (FALSE == is_subsplit (split)) return;
ENTER (" "); ENTER (" ");
/* Get 'price' of the indicated split */ /* Get 'price' of the indicated split */
@ -204,12 +201,10 @@ xaccScrubMergeSubSplits (Split *split)
{ {
gboolean rc = FALSE; gboolean rc = FALSE;
Transaction *txn; Transaction *txn;
KvpFrame *sf;
SplitList *node; SplitList *node;
GNCLot *lot; GNCLot *lot;
sf = is_subsplit (split); if (FALSE == is_subsplit (split)) return FALSE;
if (!sf) return FALSE;
txn = split->parent; txn = split->parent;
lot = xaccSplitGetLot (split); lot = xaccSplitGetLot (split);