[csv-export-helpers] move account_get_fullname_str to support file

This commit is contained in:
Christopher Lam 2023-04-07 20:27:29 +08:00
parent e5349a8b36
commit 229efb52ed
4 changed files with 12 additions and 18 deletions

View File

@ -82,3 +82,12 @@ gnc_csv_add_line (std::ostream& ss, const StringVec& str_vec,
return !ss.fail(); return !ss.fail();
} }
std::string
account_get_fullname_str (Account *account)
{
auto name{gnc_account_get_full_name (account)};
auto rv{std::string(name)};
g_free (name);
return rv;
}

View File

@ -35,5 +35,7 @@ using StringVec = std::vector<std::string>;
bool gnc_csv_add_line (std::ostream& ss, const StringVec& charsvec, bool gnc_csv_add_line (std::ostream& ss, const StringVec& charsvec,
bool use_quotes, const char* sep); bool use_quotes, const char* sep);
std::string account_get_fullname_str (Account*);
#endif #endif

View File

@ -83,15 +83,7 @@ static std::string
get_account_name (Split *split, bool full) get_account_name (Split *split, bool full)
{ {
auto account{xaccSplitGetAccount (split)}; auto account{xaccSplitGetAccount (split)};
if (full) return full ? account_get_fullname_str (account) : xaccAccountGetName (account);
{
auto name{gnc_account_get_full_name (account)};
auto rv{std::string(name)};
g_free (name);
return rv;
}
else
return xaccAccountGetName (account);
} }
// Number // Number

View File

@ -40,15 +40,6 @@
/* This static indicates the debugging module that this .o belongs to. */ /* This static indicates the debugging module that this .o belongs to. */
static QofLogModule log_module = GNC_MOD_ASSISTANT; static QofLogModule log_module = GNC_MOD_ASSISTANT;
static std::string
account_get_fullname_str (Account *account)
{
auto name{gnc_account_get_full_name (account)};
auto rv{std::string(name)};
g_free (name);
return rv;
}
/******************************************************* /*******************************************************
* csv_tree_export * csv_tree_export
* *