mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
split name change
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@373 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
cb21407d6e
commit
3b6c2588a3
@ -118,7 +118,7 @@ freeAccount( Account *acc )
|
||||
s = acc->splits[0];
|
||||
while (s) {
|
||||
struct _account * _acc = (struct _account *) acc;
|
||||
if (_acc == s->debit) s->debit = NULL;
|
||||
if (_acc == s->acc) s->acc = NULL;
|
||||
i++;
|
||||
s = acc->splits[i];
|
||||
}
|
||||
@ -395,7 +395,7 @@ xaccInsertSplit ( Account *acc, Split *split )
|
||||
/* mark the data file as needing to be saved: */
|
||||
if( acc->parent != NULL ) acc->parent->saved = False;
|
||||
|
||||
split->debit = (struct _account *) acc;
|
||||
split->acc = (struct _account *) acc;
|
||||
|
||||
oldsplits = acc->splits;
|
||||
acc->numSplits ++;
|
||||
|
@ -488,7 +488,7 @@ readTransaction( int fd, Account *acc, int token )
|
||||
|
||||
/* create a transaction structure with at least one split */
|
||||
trans = mallocTransaction();
|
||||
split = mallocSplit();
|
||||
split = xaccMallocSplit();
|
||||
xaccAppendSplit (trans, split);
|
||||
|
||||
ENTER ("readTransaction");
|
||||
@ -650,7 +650,7 @@ readTransaction( int fd, Account *acc, int token )
|
||||
XACC_FLIP_INT (acc_id);
|
||||
INFO_2 ("readTransaction(): debit %d\n", acc_id);
|
||||
peer_acc = locateAccount (acc_id);
|
||||
split -> debit = (struct _account *) peer_acc;
|
||||
split -> acc = (struct _account *) peer_acc;
|
||||
|
||||
/* insert the transaction into both the debit and
|
||||
* the credit accounts; next, the debit ... */
|
||||
|
@ -715,9 +715,9 @@ char * xaccReadQIFTransaction (int fd, Account *acc)
|
||||
split -> damount = 0.0; /* amount is double */
|
||||
split -> share_price= 1.0; /* share_price is double */
|
||||
split -> reconciled = NREC; /* reconciled is byte */
|
||||
split -> debit = (struct _account *) xaccGetXferQIFAccount (acc, qifline);
|
||||
split -> acc = (struct _account *) xaccGetXferQIFAccount (acc, qifline);
|
||||
|
||||
xaccInsertSplit (trans, split);
|
||||
xaccAppendSplit (trans, split);
|
||||
|
||||
/* hack alert -- we should insert this split into
|
||||
* the split account, and remove the L field */
|
||||
|
@ -46,7 +46,7 @@ xaccInitSplit( Split * split )
|
||||
{
|
||||
|
||||
/* fill in some sane defaults */
|
||||
split->debit = NULL;
|
||||
split->acc = NULL;
|
||||
split->parent = NULL;
|
||||
|
||||
split->memo = XtNewString("");
|
||||
@ -77,7 +77,7 @@ xaccFreeSplit( Split *split )
|
||||
|
||||
/* free a split only if it is not claimed
|
||||
* by any accounts. */
|
||||
if (split->debit) return;
|
||||
if (split->acc) return;
|
||||
|
||||
xaccRemoveSplit (split);
|
||||
|
||||
@ -131,8 +131,10 @@ initTransaction( Transaction * trans )
|
||||
trans->memo = XtNewString("");
|
||||
trans->action = XtNewString("");
|
||||
|
||||
trans->splits = (Split **) _malloc (sizeof (Split *));
|
||||
trans->splits[0] = NULL;
|
||||
trans->debit_splits = (Split **) _malloc (sizeof (Split *));
|
||||
trans->debit_splits[0] = NULL;
|
||||
|
||||
xaccInitSplit ( &(trans->credit_split));
|
||||
|
||||
trans->reconciled = NREC;
|
||||
trans->damount = 0.0;
|
||||
@ -175,10 +177,10 @@ freeTransaction( Transaction *trans )
|
||||
/*
|
||||
hack alert -- don't do this until splits are fully
|
||||
implemented and tested.
|
||||
if (NULL != trans->splits[0]) return;
|
||||
if (NULL != trans->debit_splits[0]) return;
|
||||
*/
|
||||
|
||||
_free (trans->splits);
|
||||
_free (trans->debit_splits);
|
||||
XtFree(trans->num);
|
||||
XtFree(trans->description);
|
||||
XtFree(trans->memo);
|
||||
@ -218,15 +220,15 @@ xaccAppendSplit (Transaction *trans, Split *split)
|
||||
if (!split) return;
|
||||
|
||||
split->parent = (struct _transaction *) trans;
|
||||
num = xaccCountSplits (trans->splits);
|
||||
num = xaccCountSplits (trans->debit_splits);
|
||||
|
||||
oldarray = trans->splits;
|
||||
trans->splits = (Split **) _malloc ((num+2)*sizeof(Split *));
|
||||
oldarray = trans->debit_splits;
|
||||
trans->debit_splits = (Split **) _malloc ((num+2)*sizeof(Split *));
|
||||
for (i=0; i<num; i++) {
|
||||
(trans->splits)[i] = oldarray[i];
|
||||
(trans->debit_splits)[i] = oldarray[i];
|
||||
}
|
||||
trans->splits[num] = split;
|
||||
trans->splits[num+1] = NULL;
|
||||
trans->debit_splits[num] = split;
|
||||
trans->debit_splits[num+1] = NULL;
|
||||
|
||||
if (oldarray) _free (oldarray);
|
||||
}
|
||||
@ -247,15 +249,15 @@ xaccRemoveSplit (Split *split)
|
||||
|
||||
if (!trans) return;
|
||||
|
||||
s = trans->splits[0];
|
||||
s = trans->debit_splits[0];
|
||||
while (s) {
|
||||
trans->splits[i] = trans->splits[n];
|
||||
trans->debit_splits[i] = trans->debit_splits[n];
|
||||
if (split == s) { i--; }
|
||||
i++;
|
||||
n++;
|
||||
s = trans->splits[n];
|
||||
s = trans->debit_splits[n];
|
||||
}
|
||||
trans->splits[i] = NULL;
|
||||
trans->debit_splits[i] = NULL;
|
||||
|
||||
/* hack alert -- we should also remove it from the account */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user