Skip to content

Commit

Permalink
Bug 789730 Bis: Sometimes we get lists of Account*
Browse files Browse the repository at this point in the history
And sometimes a list of Guid strings. Handle either.
  • Loading branch information
jralls committed Jan 21, 2023
1 parent d981679 commit 09751e2
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions bindings/guile/gnc-optiondb.i
Expand Up @@ -472,10 +472,26 @@ scm_to_value<GncOptionAccountList>(SCM new_value)
auto next{new_value};
while (!scm_is_null(next) && scm_car(next))
{
auto guid_str{scm_to_utf8_string(scm_car(next))};
GncGUID guid;
string_to_guid(guid_str, &guid);
retval.push_back(guid);
/* If the incoming scheme is from a report then it will contain an Account*, if
* it's from restoring a saved report config it will be a guid.
*/
if (scm_is_string(scm_car(next)))
{
auto guid_str{scm_to_utf8_string(scm_car(next))};
GncGUID guid;
string_to_guid(guid_str, &guid);
retval.push_back(guid);
}
else
{
void *account{};
SWIG_ConvertPtr(scm_car(next), &account, SWIGTYPE_p_Account, 0);
if (account)
{
auto guid{qof_entity_get_guid(static_cast<Account *>(account))};
retval.push_back(*guid);
}
}
next = scm_cdr(next);
}
return retval;
Expand Down

0 comments on commit 09751e2

Please sign in to comment.