*** empty log message ***

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2190 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2000-04-16 20:37:38 +00:00
parent dcb49a0b47
commit 50646f04a9
6 changed files with 43 additions and 21 deletions

View File

@ -560,6 +560,7 @@ Dave Freese <DFreese@osc.uscg.mil> for leap-year fix
Bill Gribble <grib@billgribble.com> qif importation code
Otto Hammersmith <otto@bug.redhat.com> for RedHat RPM version
Alexandru Harsanyi <haral@codec.ro> for core dumps, lockups, gtk work
John Hasler <john@dhh.gt.org> engine patch
Jon K}re Hellan <jk@isdn-a33.itea.ntnu.no> misc core dump fixes
Prakash Kailasa <PrakashK@bigfoot.com> for gnome build fixes
Ben Kelly <ben.kelly@ieee.org> for motif menu bug fix, core dump fixes

View File

@ -322,6 +322,10 @@
<dd>for fixing miscellaneous core dumps and lockups.</dd>
<dt> <a href="mailto:john@dhh.gt.org"> John Hasler</a></dt>
<dd>engine patch</dd>
<dt> <a href="mailto:jk@isdn-a33.itea.ntnu.no"> Jon K}re
Hellan</a></dt>

View File

@ -1386,8 +1386,8 @@ xaccSRSaveRegEntry (SplitRegister *reg, Transaction *new_trans)
if ((new_acc != NULL) && (old_acc != new_acc))
{
char *currency = NULL;
char *security = NULL;
const char *currency = NULL;
const char *security = NULL;
currency = xaccAccountGetCurrency(new_acc);
currency = xaccTransIsCommonCurrency(trans, currency);
@ -1461,8 +1461,8 @@ xaccSRSaveRegEntry (SplitRegister *reg, Transaction *new_trans)
if ((new_acc != NULL) && (old_acc != new_acc))
{
char *currency = NULL;
char *security = NULL;
const char *currency = NULL;
const char *security = NULL;
currency = xaccAccountGetCurrency(new_acc);
currency = xaccTransIsCommonCurrency(trans, currency);

View File

@ -673,8 +673,10 @@ static int revorder[NUM_ACCOUNT_TYPES] = {
int
xaccAccountOrder (Account **aa, Account **ab)
{
char *da, *db;
char *da, *db;
char *endptr = NULL;
int ta, tb;
long la, lb;
if ( (*aa) && !(*ab) ) return -1;
if ( !(*aa) && (*ab) ) return +1;
@ -683,6 +685,18 @@ xaccAccountOrder (Account **aa, Account **ab)
/* sort on accountCode strings */
da = (*aa)->accountCode;
db = (*ab)->accountCode;
/* If accountCodes are both base 36 integers do an integer sort */
la = strtoul (da, &endptr, 36);
if((*da != '\0') && (*endptr == '\0')) {
lb = strtoul (db, &endptr, 36);
if((*db != '\0') && (*endptr == '\0')) {
if (la < lb) return -1;
if (la > lb) return +1;
}
}
/* Otherwise do a string sort */
SAFE_STRCMP (da, db);
/* if acccount-type-order array not initialized, initialize it */

View File

@ -520,7 +520,7 @@ xaccTransLookup (GUID *guid)
\********************************************************************/
void
xaccSplitSetBaseValue (Split *s, double value, char * base_currency)
xaccSplitSetBaseValue (Split *s, double value, const char * base_currency)
{
if (!s) return;
@ -606,7 +606,7 @@ xaccSplitGetBaseValue (Split *s, char * base_currency)
\********************************************************************/
static double
ComputeValue (Split **sarray, Split * skip_me, char * base_currency)
ComputeValue (Split **sarray, Split * skip_me, const char * base_currency)
{
Split *s;
int i=0;
@ -656,15 +656,16 @@ ComputeValue (Split **sarray, Split * skip_me, char * base_currency)
double
xaccTransGetImbalance (Transaction * trans)
{
char * currency = xaccTransFindCommonCurrency (trans);
const char * currency = xaccTransFindCommonCurrency (trans);
double imbal = ComputeValue (trans->splits, NULL, currency);
return imbal;
}
/********************************************************************\
\********************************************************************/
gncBoolean xaccIsCommonCurrency(char *currency_1, char *security_1,
char *currency_2, char *security_2)
gncBoolean
xaccIsCommonCurrency(const char *currency_1, const char *security_1,
const char *currency_2, const char *security_2)
{
int c1c2, c1s2, s1c2, s1s2;
@ -694,8 +695,8 @@ gncBoolean xaccIsCommonCurrency(char *currency_1, char *security_1,
return (c1c2 == 0) || (c1s2 == 0) || (s1c2 == 0) || (s1s2 == 0);
}
static char *
FindCommonCurrency (Split **slist, char * ra, char * rb)
static const char *
FindCommonCurrency (Split **slist, const char * ra, const char * rb)
{
Split *s;
int i = 0;
@ -756,7 +757,7 @@ FindCommonCurrency (Split **slist, char * ra, char * rb)
}
char *
const char *
xaccTransFindCommonCurrency (Transaction *trans)
{
char *ra, *rb;
@ -771,8 +772,8 @@ xaccTransFindCommonCurrency (Transaction *trans)
return FindCommonCurrency (trans->splits, ra, rb);
}
char *
xaccTransIsCommonCurrency (Transaction *trans, char * ra)
const char *
xaccTransIsCommonCurrency (Transaction *trans, const char * ra)
{
return FindCommonCurrency (trans->splits, ra, NULL);
}
@ -799,7 +800,7 @@ xaccSplitRebalance (Split *split)
Split *s;
int i = 0;
double value = 0.0;
char *base_currency=0x0;
const char *base_currency = NULL;
trans = split->parent;

View File

@ -262,8 +262,8 @@ int xaccTransCountSplits (Transaction *trans);
* xaccTransFindCommonCurrency. This method is useful for determining
* whether two accounts can have transactions in common.
*/
gncBoolean xaccIsCommonCurrency(char *currency_1, char *security_1,
char *currency_2, char *security_2);
gncBoolean xaccIsCommonCurrency(const char *currency_1, const char *security_1,
const char *currency_2, const char *security_2);
/* The xaccTransFindCommonCurrency () method returns a string value
* indicating a currency denomination that all of the splits in this
@ -276,7 +276,7 @@ gncBoolean xaccIsCommonCurrency(char *currency_1, char *security_1,
* If all of the splits share both a common security and a common currency,
* then the string name for the currency is returned.
*/
char * xaccTransFindCommonCurrency (Transaction *trans);
const char * xaccTransFindCommonCurrency (Transaction *trans);
/* The xaccTransIsCommonCurrency () method compares the input string
* to the currency/security denominations of all splits in the
@ -294,7 +294,8 @@ char * xaccTransFindCommonCurrency (Transaction *trans);
* transaction have in common. This routine is useful in dealing
* securities of differing types are moved across accounts.
*/
char * xaccTransIsCommonCurrency (Transaction *trans, char * currency);
const char * xaccTransIsCommonCurrency (Transaction *trans,
const char * currency);
/* The xaccTransGetImbalance() method returns the total value of the
* transaction. In a pure double-entry system, this imbalance
@ -373,7 +374,8 @@ void xaccSplitSetSharePriceAndAmount (Split *, double price,
void xaccSplitSetShareAmount (Split *, double);
void xaccSplitSetSharePrice (Split *, double);
void xaccSplitSetValue (Split *, double);
void xaccSplitSetBaseValue (Split *s, double value, char * base_currency);
void xaccSplitSetBaseValue (Split *s, double value,
const char * base_currency);
/* The following four subroutines return the running balance up