Remove check_open() calls from Transaction setters.

These calls were probably a copied idiom from the Split setters in this
   same file, but Split and Transaction use completely different mechanisms
   for managing dirty state.  Transactions inherit from QofInstance and so
   use the .dirty field.  Splits inherit from QofEntity, so their
   check_open(split->parent) calls are their way of letting someone know
   they've changed.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13128 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Chris Shoemaker 2006-02-06 04:50:02 +00:00
parent e9e033f60e
commit 69dc61aac4

View File

@ -1626,7 +1626,6 @@ xaccTransSetCurrency (Transaction *trans, gnc_commodity *curr)
gint fraction, old_fraction;
if (!trans || !curr || trans->common_currency == curr) return;
check_open (trans);
old_fraction = gnc_commodity_get_fraction (trans->common_currency);
trans->common_currency = curr;
@ -1673,7 +1672,6 @@ void
xaccTransDestroy (Transaction *trans)
{
if (!trans) return;
check_open (trans);
if (xaccTransGetReadOnly (trans) &&
!qof_book_shutting_down(trans->inst.book)) return;
@ -2141,8 +2139,6 @@ xaccSplitDestroy (Split *split)
if (acc && !acc->inst.do_free && xaccTransGetReadOnly (trans))
return FALSE;
check_open (trans);
mark_split (split);
if (trans)
@ -2181,7 +2177,6 @@ xaccTransAppendSplit (Transaction *trans, Split *split)
{
if (!trans || !split) return;
g_return_if_fail (trans->inst.book == split->book);
check_open (trans);
/* First, make sure that the split isn't already inserted
* elsewhere. If so, then remove it. */
@ -2498,8 +2493,6 @@ xaccSplitCompareOtherAccountCodes(const Split *sa, const Split *sb)
static inline void
xaccTransSetDateInternal(Transaction *trans, Timespec *dadate, Timespec val)
{
check_open(trans);
PINFO ("addr=%p set date to %llu.%09ld %s",
trans, val.tv_sec, val.tv_nsec,
ctime (({time_t secs = (time_t) val.tv_sec; &secs;})));
@ -2640,7 +2633,6 @@ xaccTransSetNum (Transaction *trans, const char *xnum)
{
char * tmp;
if (!trans || !xnum) return;
check_open (trans);
tmp = gnc_string_cache_insert((gpointer) xnum);
gnc_string_cache_remove(trans->num);
@ -2660,7 +2652,6 @@ xaccTransSetDescription (Transaction *trans, const char *desc)
{
char * tmp;
if (!trans || !desc) return;
check_open (trans);
tmp = gnc_string_cache_insert((gpointer) desc);
gnc_string_cache_remove(trans->description);
@ -2679,7 +2670,6 @@ void
xaccTransSetNotes (Transaction *trans, const char *notes)
{
if (!trans || !notes) return;
check_open (trans);
kvp_frame_set_str (trans->inst.kvp_data, trans_notes_str, notes);
}