diff --git a/libgnucash/engine/Account.cpp b/libgnucash/engine/Account.cpp index 0604c0f234e..62ae238910b 100644 --- a/libgnucash/engine/Account.cpp +++ b/libgnucash/engine/Account.cpp @@ -2495,12 +2495,23 @@ get_kvp_gnc_numeric_path (const Account *acc, const Path& path) return qof_instance_get_path_kvp (QOF_INSTANCE(acc), path); } +static const char* +get_kvp_string_path (const Account *acc, const Path& path) +{ + g_return_val_if_fail (GNC_IS_ACCOUNT(acc), nullptr); + auto rv{qof_instance_get_path_kvp (QOF_INSTANCE(acc), path)}; + return rv ? *rv : nullptr; +} + static void set_kvp_string_path (Account *acc, std::vector const & path, const char *value) { g_return_if_fail(GNC_IS_ACCOUNT(acc)); + if (!g_strcmp0 (get_kvp_string_path (acc, path), value) + return; + std::optional val; if (value && *value) val = g_strdup(value); @@ -2510,14 +2521,6 @@ set_kvp_string_path (Account *acc, std::vector const & path, xaccAccountCommitEdit(acc); } -static const char* -get_kvp_string_path (const Account *acc, const Path& path) -{ - g_return_val_if_fail (GNC_IS_ACCOUNT(acc), nullptr); - auto rv{qof_instance_get_path_kvp (QOF_INSTANCE(acc), path)}; - return rv ? *rv : nullptr; -} - static void set_kvp_account_path (Account* acc, const Path& path, const Account* kvp_account) {