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:
Linas Vepstas 1998-02-01 22:10:05 +00:00
parent 48264db7a3
commit f86a6520b4
5 changed files with 19 additions and 27 deletions

View File

@ -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;
}
/********************************************************************\
\********************************************************************/

View File

@ -78,6 +78,7 @@
\********************************************************************/
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include "config.h"

View File

@ -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",

View File

@ -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 */

View File

@ -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 */