mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
remove usage of depricated routines.
In fact, this patch should be a no-op, since the 'depricated' routines merely have a new name. Everything works exactly as before. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4355 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
05eb266172
commit
3cbe9d91de
@ -604,7 +604,7 @@ gnc_split_get_quantity_denom (Split *split)
|
||||
{
|
||||
int denom;
|
||||
|
||||
denom = xaccAccountGetSecuritySCU (xaccSplitGetAccount (split));
|
||||
denom = xaccAccountGetCommoditySCU (xaccSplitGetAccount (split));
|
||||
if (denom == 0)
|
||||
{
|
||||
gnc_commodity *commodity = gnc_locale_default_currency ();
|
||||
@ -629,7 +629,7 @@ sr_set_cell_fractions (SplitRegister *reg, Split *split)
|
||||
if (account)
|
||||
{
|
||||
xaccSetPriceCellFraction (reg->sharesCell,
|
||||
xaccAccountGetSecuritySCU (account));
|
||||
xaccAccountGetCommoditySCU (account));
|
||||
xaccSetPriceCellFraction (reg->debitCell,
|
||||
xaccAccountGetCurrencySCU (account));
|
||||
xaccSetPriceCellFraction (reg->creditCell,
|
||||
@ -3520,7 +3520,7 @@ get_trans_total_shares (SplitRegister *reg, Transaction *trans)
|
||||
if (!account)
|
||||
return total;
|
||||
|
||||
total = gnc_numeric_convert (total, xaccAccountGetSecuritySCU (account),
|
||||
total = gnc_numeric_convert (total, xaccAccountGetCommoditySCU (account),
|
||||
GNC_RND_ROUND);
|
||||
|
||||
for (node = xaccTransGetSplitList (trans); node; node = node->next)
|
||||
|
@ -654,7 +654,7 @@ xaccAccountInsertSplit (Account *acc, Split *split)
|
||||
/* if the denominator can't be exactly converted, it's an error */
|
||||
/* FIXME : need to enforce ordering of insertion/value */
|
||||
split->damount = gnc_numeric_convert(split->damount,
|
||||
xaccAccountGetSecuritySCU(acc),
|
||||
xaccAccountGetCommoditySCU(acc),
|
||||
GNC_RND_ROUND);
|
||||
|
||||
split->value = gnc_numeric_convert(split->value,
|
||||
@ -1159,7 +1159,7 @@ update_split_currency(Account * acc)
|
||||
xaccAccountGetCurrencySCU(acc),
|
||||
GNC_RND_ROUND);
|
||||
s->damount = gnc_numeric_convert(s->damount,
|
||||
xaccAccountGetSecuritySCU(acc),
|
||||
xaccAccountGetCommoditySCU(acc),
|
||||
GNC_RND_ROUND);
|
||||
}
|
||||
xaccAccountCommitEdit(acc);
|
||||
@ -1260,7 +1260,7 @@ xaccAccountSetCurrencySCU (Account * acc, int scu) {
|
||||
}
|
||||
|
||||
void
|
||||
xaccAccountSetSecuritySCU (Account *acc, int scu) {
|
||||
xaccAccountSetCommoditySCU (Account *acc, int scu) {
|
||||
|
||||
if (!acc) return;
|
||||
|
||||
@ -1280,7 +1280,7 @@ xaccAccountGetCurrencySCU (Account * acc) {
|
||||
}
|
||||
|
||||
int
|
||||
xaccAccountGetSecuritySCU (Account * acc) {
|
||||
xaccAccountGetCommoditySCU (Account * acc) {
|
||||
if (!acc) return 0;
|
||||
|
||||
if (acc->security == NULL)
|
||||
@ -1419,7 +1419,7 @@ xaccAccountGetCurrency (Account *acc)
|
||||
}
|
||||
|
||||
gnc_commodity *
|
||||
xaccAccountGetEffectiveSecurity (Account *acc)
|
||||
xaccAccountGetCommodity (Account *acc)
|
||||
{
|
||||
if (!acc) return NULL;
|
||||
|
||||
|
@ -213,8 +213,10 @@ const char * xaccAccountGetNotes (Account *account);
|
||||
* split is a translation of the Split's 'damount' (which is the
|
||||
* amount of the Account's commodity involved) into the Transaction's
|
||||
* balancing currency. */
|
||||
#define xaccAccountGetCommodity xaccAccountGetEffectiveSecurity
|
||||
void xaccAccountSetCommodity (Account *account, gnc_commodity *comm);
|
||||
gnc_commodity * xaccAccountGetCommodity (Account *account);
|
||||
int xaccAccountGetCommoditySCU (Account *account);
|
||||
void xaccAccountSetCommoditySCU (Account *account, int frac);
|
||||
|
||||
/* Soon-to-be-deprecated currency/security access routines.
|
||||
* The future API will associate only one thing with an account:
|
||||
@ -223,14 +225,10 @@ void xaccAccountSetCommodity (Account *account, gnc_commodity *comm);
|
||||
/* these two funcs take control of their gnc_commodity args. Don't free */
|
||||
void xaccAccountSetCurrency (Account *account, gnc_commodity *currency);
|
||||
void xaccAccountSetSecurity (Account *account, gnc_commodity *security);
|
||||
void xaccAccountSetCurrencySCU (Account *account, int frac);
|
||||
void xaccAccountSetSecuritySCU (Account *account, int frac);
|
||||
int xaccAccountGetCurrencySCU (Account *account);
|
||||
int xaccAccountGetSecuritySCU (Account *account);
|
||||
|
||||
gnc_commodity * xaccAccountGetCurrency (Account *account);
|
||||
gnc_commodity * xaccAccountGetSecurity (Account *account);
|
||||
gnc_commodity * xaccAccountGetEffectiveSecurity (Account *account);
|
||||
void xaccAccountSetCurrencySCU (Account *account, int frac);
|
||||
int xaccAccountGetCurrencySCU (Account *account);
|
||||
|
||||
AccountGroup * xaccAccountGetChildren (Account *account);
|
||||
AccountGroup * xaccAccountGetParent (Account *account);
|
||||
|
@ -212,11 +212,11 @@ xaccSplitScrub (Split *split)
|
||||
}
|
||||
|
||||
if (!gnc_commodity_equiv (xaccAccountGetCurrency (account),
|
||||
xaccAccountGetEffectiveSecurity (account)))
|
||||
xaccAccountGetCommodity (account)))
|
||||
return;
|
||||
|
||||
scu = MIN (xaccAccountGetCurrencySCU (account),
|
||||
xaccAccountGetSecuritySCU (account));
|
||||
xaccAccountGetCommoditySCU (account));
|
||||
|
||||
value = xaccSplitGetValue (split);
|
||||
|
||||
|
@ -442,7 +442,7 @@ get_currency_denom(Split * s)
|
||||
static int
|
||||
get_security_denom(Split * s)
|
||||
{
|
||||
return get_denom_internal(s, xaccAccountGetSecuritySCU);
|
||||
return get_denom_internal(s, xaccAccountGetCommoditySCU);
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
@ -944,10 +944,10 @@ xaccSplitSetBaseValue (Split *s, gnc_numeric value,
|
||||
}
|
||||
|
||||
currency = xaccAccountGetCurrency (xaccSplitGetAccount(s));
|
||||
security = xaccAccountGetEffectiveSecurity (xaccSplitGetAccount(s));
|
||||
security = xaccAccountGetCommodity (xaccSplitGetAccount(s));
|
||||
|
||||
/* if the base_currency is the account currency, set the
|
||||
* value. If it's the account security, set the damount.
|
||||
* value. If it's the account commodity, set the damount.
|
||||
* If both, set both. */
|
||||
if (gnc_commodity_equiv(currency, base_currency)) {
|
||||
if(gnc_commodity_equiv(security, base_currency)) {
|
||||
|
@ -101,7 +101,7 @@ gnc_account_dom_tree_create(Account *act)
|
||||
xmlAddChild(ret, commodity_ref_to_dom_tree(act_security_string,
|
||||
xaccAccountGetSecurity(act)));
|
||||
xmlAddChild(ret, int_to_dom_tree(act_security_scu_string,
|
||||
xaccAccountGetSecuritySCU(act)));
|
||||
xaccAccountGetCommoditySCU(act)));
|
||||
}
|
||||
|
||||
if(xaccAccountGetSlots(act))
|
||||
@ -205,7 +205,7 @@ account_security_scu_handler (xmlNodePtr node, gpointer act)
|
||||
{
|
||||
gint64 val;
|
||||
dom_tree_to_integer(node, &val);
|
||||
xaccAccountSetSecuritySCU((Account*)act, val);
|
||||
xaccAccountSetCommoditySCU((Account*)act, val);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "Account.h"
|
||||
#include "EuroUtils.h"
|
||||
#include "FileDialog.h"
|
||||
#include "Group.h"
|
||||
@ -888,8 +889,8 @@ GNCPrintAmountInfo
|
||||
gnc_account_quantity_print_info (Account *account, gboolean use_symbol)
|
||||
{
|
||||
return gnc_account_print_info_helper(account, use_symbol,
|
||||
xaccAccountGetEffectiveSecurity,
|
||||
xaccAccountGetSecuritySCU);
|
||||
xaccAccountGetCommodity,
|
||||
xaccAccountGetCommoditySCU);
|
||||
}
|
||||
|
||||
GNCPrintAmountInfo
|
||||
|
@ -183,7 +183,7 @@ refresh_details_page (StockSplitInfo *info)
|
||||
gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (info->distribution_edit),
|
||||
print_info);
|
||||
gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (info->distribution_edit),
|
||||
xaccAccountGetSecuritySCU (account));
|
||||
xaccAccountGetCommoditySCU (account));
|
||||
|
||||
gnc_currency_edit_set_currency
|
||||
(GNC_CURRENCY_EDIT (info->price_currency_edit),
|
||||
|
@ -454,7 +454,7 @@ startRecnWindow(GtkWidget *parent, Account *account,
|
||||
if ((account_type == STOCK) || (account_type == MUTUAL) ||
|
||||
(account_type == CURRENCY))
|
||||
gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (end_value),
|
||||
xaccAccountGetSecuritySCU (account));
|
||||
xaccAccountGetCommoditySCU (account));
|
||||
else
|
||||
gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (end_value),
|
||||
xaccAccountGetCurrencySCU (account));
|
||||
|
Loading…
Reference in New Issue
Block a user