Skip to content

Commit

Permalink
Correctly select UI types for GUID output.
Browse files Browse the repository at this point in the history
  • Loading branch information
jralls committed Aug 1, 2021
1 parent c751e56 commit 245a8fc
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion libgnucash/app-utils/gnc-optiondb.cpp
Expand Up @@ -568,6 +568,28 @@ GncOptionDB::load_from_key_value(std::istream& iss)
return iss;
}

bool
is_qofinstance_ui_type(GncOptionUIType type)
{
switch (type)
{
case CURRENCY:
case COMMODITY:
case ACCOUNT_SEL:
case BUDGET:
case OWNER:
case CUSTOMER:
case VENDOR:
case EMPLOYEE:
case INVOICE:
case TAX_TABLE:
case QUERY:
return true;
default:
return false;
}
}

void
GncOptionDB::save_to_kvp(QofBook* book, bool clear_options) const noexcept
{
Expand All @@ -593,7 +615,7 @@ GncOptionDB::save_to_kvp(QofBook* book, bool clear_options) const noexcept
g_strdup("f"))};
qof_book_set_option(book, kvp, &list_head);
}
else if (type > GncOptionUIType::DATE_FORMAT)
else if (is_qofinstance_ui_type(type))
{
const QofInstance* inst{QOF_INSTANCE(option.template get_value<const QofInstance*>())};
auto guid = guid_copy(qof_instance_get_guid(inst));
Expand Down

0 comments on commit 245a8fc

Please sign in to comment.