mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
get/set the guid
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6880 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -64,6 +64,7 @@ struct gnc_lot_struct
|
||||
gboolean is_closed;
|
||||
};
|
||||
|
||||
void gnc_lot_set_guid(GNCLot *lot, GUID guid);
|
||||
|
||||
#endif /* GNC_LOT_P_H */
|
||||
|
||||
|
||||
@@ -98,6 +98,28 @@ gnc_lot_destroy (GNCLot *lot)
|
||||
g_free (lot);
|
||||
}
|
||||
|
||||
/* ============================================================= */
|
||||
|
||||
const GUID *
|
||||
gnc_lot_get_guid (GNCLot *lot)
|
||||
{
|
||||
if (!lot) return NULL;
|
||||
return &lot->guid;
|
||||
}
|
||||
|
||||
void
|
||||
gnc_lot_set_guid (GNCLot *lot, GUID uid)
|
||||
{
|
||||
if (!lot) return;
|
||||
|
||||
if (guid_equal (&lot->guid, &uid)) return;
|
||||
|
||||
xaccRemoveEntity(lot->book->entity_table, &lot->guid);
|
||||
lot->guid = uid;
|
||||
xaccStoreEntity(lot->book->entity_table, lot, &lot->guid, GNC_ID_LOT);
|
||||
}
|
||||
|
||||
|
||||
/* ============================================================= */
|
||||
|
||||
gboolean
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
GNCLot * gnc_lot_new (GNCBook *);
|
||||
void gnc_lot_destroy (GNCLot *);
|
||||
|
||||
const GUID * gnc_lot_get_guid (GNCLot *p);
|
||||
|
||||
void gnc_lot_add_split (GNCLot *, Split *);
|
||||
void gnc_lot_remove_split (GNCLot *, Split *);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user