mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[account.cpp] gnc_account_and_descendants_empty: don't copy children
This commit is contained in:
parent
793c8735b8
commit
c3eaff9bb2
@ -4011,15 +4011,14 @@ as well, use gnc_account_and_descendants_empty.");
|
|||||||
gboolean gnc_account_and_descendants_empty (Account *acc)
|
gboolean gnc_account_and_descendants_empty (Account *acc)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (GNC_IS_ACCOUNT (acc), FALSE);
|
g_return_val_if_fail (GNC_IS_ACCOUNT (acc), FALSE);
|
||||||
if (xaccAccountGetSplitList (acc)) return FALSE;
|
auto priv = GET_PRIVATE (acc);
|
||||||
auto empty = TRUE;
|
if (priv->splits != nullptr) return FALSE;
|
||||||
auto *children = gnc_account_get_children (acc);
|
for (auto *n = priv->children; n; n = n->next)
|
||||||
for (auto *n = children; n && empty; n = n->next)
|
|
||||||
{
|
{
|
||||||
empty = gnc_account_and_descendants_empty ((Account*)n->data);
|
if (!gnc_account_and_descendants_empty (static_cast<Account*>(n->data)))
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
g_list_free (children);
|
return TRUE;
|
||||||
return empty;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LotList *
|
LotList *
|
||||||
|
Loading…
Reference in New Issue
Block a user