mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[Account.hpp] xaccAccountGetSplits returns a reference to vector
This commit is contained in:
parent
6cabb5d884
commit
c02152b34a
@ -3881,10 +3881,11 @@ xaccAccountGetNoclosingBalanceChangeInCurrencyForPeriod (Account *acc, time64 t1
|
||||
/********************************************************************\
|
||||
\********************************************************************/
|
||||
|
||||
const SplitsVec
|
||||
const SplitsVec&
|
||||
xaccAccountGetSplits (const Account *account)
|
||||
{
|
||||
g_return_val_if_fail (GNC_IS_ACCOUNT(account), SplitsVec{});
|
||||
static const SplitsVec empty;
|
||||
g_return_val_if_fail (GNC_IS_ACCOUNT(account), empty);
|
||||
return GET_PRIVATE(account)->splits;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
||||
using SplitsVec = std::vector<Split*>;
|
||||
using AccountVec = std::vector<Account*>;
|
||||
|
||||
const SplitsVec xaccAccountGetSplits (const Account*);
|
||||
const SplitsVec& xaccAccountGetSplits (const Account*);
|
||||
|
||||
void gnc_account_foreach_descendant (const Account *, std::function<void(Account*)> func);
|
||||
|
||||
|
@ -76,13 +76,14 @@ xaccAccountGetSplitList (const Account *account)
|
||||
return mockaccount ? mockaccount->xaccAccountGetSplitList() : nullptr;
|
||||
}
|
||||
|
||||
const std::vector<Split*>
|
||||
const std::vector<Split*>&
|
||||
xaccAccountGetSplits (const Account *account)
|
||||
{
|
||||
SCOPED_TRACE("");
|
||||
auto mockaccount = gnc_mockaccount(account);
|
||||
static const SplitsVec empty;
|
||||
if (!mockaccount)
|
||||
return {};
|
||||
return empty;
|
||||
return mockaccount->xaccAccountGetSplits();
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
MOCK_CONST_METHOD0(get_commodity, gnc_commodity*());
|
||||
MOCK_CONST_METHOD2(for_each_transaction, gint(TransactionCallback, void*));
|
||||
MOCK_CONST_METHOD0(xaccAccountGetSplitList, SplitList*());
|
||||
MOCK_CONST_METHOD0(xaccAccountGetSplits, std::vector<Split*>());
|
||||
MOCK_CONST_METHOD0(xaccAccountGetSplits, std::vector<Split*>&());
|
||||
MOCK_METHOD2(find_account, Account *(const char*, const char*));
|
||||
MOCK_METHOD3(add_account, void(const char*, const char*, Account*));
|
||||
MOCK_METHOD1(find_account_bayes, Account *(std::vector<const char*>&));
|
||||
|
Loading…
Reference in New Issue
Block a user