diff --git a/libgnucash/engine/Account.cpp b/libgnucash/engine/Account.cpp index b456da05639..052bc7e2415 100644 --- a/libgnucash/engine/Account.cpp +++ b/libgnucash/engine/Account.cpp @@ -4048,6 +4048,11 @@ xaccAccountGetSplitList (const Account *acc) return GET_PRIVATE(acc)->splits; } +size_t +xaccAccountGetSplitsSize (const Account *account) +{ + return GNC_IS_ACCOUNT(account) ? g_list_length (GET_PRIVATE(account)->splits) : 0; +} gboolean gnc_account_and_descendants_empty (Account *acc) { diff --git a/libgnucash/engine/Account.h b/libgnucash/engine/Account.h index daac6b52aff..83fa8d39017 100644 --- a/libgnucash/engine/Account.h +++ b/libgnucash/engine/Account.h @@ -1060,6 +1060,8 @@ typedef enum */ SplitList* xaccAccountGetSplitList (const Account *account); + size_t xaccAccountGetSplitsSize (const Account *account); + /** The xaccAccountMoveAllSplits() routine reassigns each of the splits * in accfrom to accto. */ void xaccAccountMoveAllSplits (Account *accfrom, Account *accto);