mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
misc core dumps fixed
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@483 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
48264db7a3
commit
f86a6520b4
23
src/Data.c
23
src/Data.c
@ -206,6 +206,8 @@ xaccGetAccountRoot (Account * acc)
|
||||
AccountGroup * grp;
|
||||
AccountGroup * root = NULL;
|
||||
|
||||
if (!acc) return NULL;
|
||||
|
||||
/* find the root of the account group structure */
|
||||
grp = (AccountGroup *) acc->parent;
|
||||
while (grp) {
|
||||
@ -481,27 +483,6 @@ xaccRecomputeGroupBalance (AccountGroup *grp)
|
||||
}
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
\********************************************************************/
|
||||
AccountGroup *
|
||||
xaccGetRootGroupOfAcct (Account *acc)
|
||||
{
|
||||
AccountGroup *grp;
|
||||
|
||||
if (!acc) return NULL;
|
||||
|
||||
/* recursively walk up the tree of parents */
|
||||
grp = acc->parent;
|
||||
if (!grp) return NULL;
|
||||
acc = grp->parent;
|
||||
while (acc) {
|
||||
grp = acc->parent;
|
||||
acc = grp->parent;
|
||||
}
|
||||
|
||||
return grp;
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
\********************************************************************/
|
||||
|
||||
|
@ -78,6 +78,7 @@
|
||||
\********************************************************************/
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "config.h"
|
||||
|
@ -119,6 +119,8 @@ xaccMainArrow (Widget acctrix, Account *acc )
|
||||
|
||||
FETCH_FROM_LIST (MainArrow, arrowList, acc, account, arrowData);
|
||||
|
||||
arrowData->expand = 0;
|
||||
|
||||
/* adjust arrow size for font size */
|
||||
height = XbaeMatrixGetRowPixelHeight (acctrix);
|
||||
arrowData->arrowb = XtVaCreateManagedWidget ("accarrow",
|
||||
|
@ -511,7 +511,7 @@ xaccGetXferQIFAccount (Account *acc, char *qifline)
|
||||
if(tmp) *tmp = 0x0;
|
||||
|
||||
/* see if the account exists */
|
||||
rootgrp = xaccGetRootGroupOfAcct (acc);
|
||||
rootgrp = xaccGetAccountRoot (acc);
|
||||
xfer_acc = xaccGetAccountFromName (rootgrp, qifline);
|
||||
|
||||
/* if not, create it */
|
||||
@ -552,7 +552,7 @@ xaccGetSecurityQIFAccount (Account *acc, char *qifline)
|
||||
if(tmp) *tmp = 0x0;
|
||||
|
||||
/* see if the account exists */
|
||||
rootgrp = xaccGetRootGroupOfAcct (acc);
|
||||
rootgrp = xaccGetAccountRoot (acc);
|
||||
xfer_acc = xaccGetAccountFromName (rootgrp, qifline);
|
||||
|
||||
/* if not, create it */
|
||||
|
@ -176,6 +176,8 @@ ledgerIsMember (RegWindow *reg, Account * acc)
|
||||
|
||||
if (acc == reg->leader) return 1;
|
||||
|
||||
if (! (reg->blackacc)) return 0;
|
||||
|
||||
n = 0;
|
||||
while (reg->blackacc[n]) {
|
||||
if (acc == reg->blackacc[n]) return 1;
|
||||
@ -495,8 +497,12 @@ regWindowLedger( Widget parent, Account *lead_acc, Account **acclist, int ledger
|
||||
regData->reg = reg;
|
||||
|
||||
/* complete GUI initialization */
|
||||
/* hack alert ------- wrong list of accounts */
|
||||
xaccLoadXferCell (regData->ledger->xfrmCell, regData->blackacc[0]->parent);
|
||||
{
|
||||
AccountGroup *grp;
|
||||
grp = xaccGetAccountRoot (regData->leader);
|
||||
if (!grp) grp = xaccGetAccountRoot (regData->blackacc[0]);
|
||||
xaccLoadXferCell (regData->ledger->xfrmCell, grp);
|
||||
}
|
||||
|
||||
XtManageChild (reg);
|
||||
XtManageChild (frame);
|
||||
@ -626,8 +632,8 @@ regWindowLedger( Widget parent, Account *lead_acc, Account **acclist, int ledger
|
||||
/******************************************************************/
|
||||
XtManageChild(pane);
|
||||
|
||||
/* hack alert -- this is wrong */
|
||||
regRefresh (regData->blackacc[0]);
|
||||
/* hack alert -- if no leader, should be refreshing from list */
|
||||
regRefresh (regData->leader);
|
||||
|
||||
XtPopup( regData->dialog, XtGrabNone );
|
||||
|
||||
@ -645,6 +651,8 @@ void regRefresh (Account *acc)
|
||||
RegWindow *regData;
|
||||
int n;
|
||||
|
||||
if (!acc) return;
|
||||
|
||||
xaccRecomputeBalance (acc);
|
||||
|
||||
/* find all registers whch contain this account */
|
||||
|
Loading…
Reference in New Issue
Block a user