mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Add convenience function to set name of an owner regardless of its type
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20619 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -419,6 +419,31 @@ const GncGUID * gncOwnerGetGUID (const GncOwner *owner)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gncOwnerSetName (const GncOwner *owner, const gchar *name)
|
||||
{
|
||||
if (!owner) return;
|
||||
switch (owner->type)
|
||||
{
|
||||
case GNC_OWNER_CUSTOMER:
|
||||
gncCustomerSetName (owner->owner.customer, name);
|
||||
break;
|
||||
case GNC_OWNER_VENDOR:
|
||||
gncVendorSetName (owner->owner.vendor, name);
|
||||
break;
|
||||
case GNC_OWNER_EMPLOYEE:
|
||||
gncAddressSetName (gncEmployeeGetAddr (owner->owner.employee), name);
|
||||
break;
|
||||
case GNC_OWNER_JOB:
|
||||
gncJobSetName (owner->owner.job, name);
|
||||
break;
|
||||
case GNC_OWNER_NONE:
|
||||
case GNC_OWNER_UNDEFINED:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gncOwnerSetActive (const GncOwner *owner, gboolean active)
|
||||
{
|
||||
|
||||
@@ -125,6 +125,7 @@ gnc_commodity * gncOwnerGetCurrency (const GncOwner *owner);
|
||||
/** \name Set routines.
|
||||
@{
|
||||
*/
|
||||
void gncOwnerSetName (const GncOwner *owner, const gchar *new_name);
|
||||
void gncOwnerSetActive (const GncOwner *owner, gboolean active);
|
||||
/** @} */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user