[Gnucash-changes] r13134 - gnucash/trunk/src/engine - Fix two places where we were letting the split values become incoherent

Chris Shoemaker chris at cvs.gnucash.org
Mon Feb 6 15:41:40 EST 2006


Author: chris
Date: 2006-02-06 15:41:40 -0500 (Mon, 06 Feb 2006)
New Revision: 13134
Trac: http://svn.gnucash.org/trac/changeset/13134

Modified:
   gnucash/trunk/src/engine/Transaction.c
Log:
   Fix two places where we were letting the split values become incoherent
   with account balances.
   Comment two possible bugs related to capgains and dirtying (or not) Splits.


Modified: gnucash/trunk/src/engine/Transaction.c
===================================================================
--- gnucash/trunk/src/engine/Transaction.c	2006-02-06 18:31:49 UTC (rev 13133)
+++ gnucash/trunk/src/engine/Transaction.c	2006-02-06 20:41:40 UTC (rev 13134)
@@ -503,6 +503,8 @@
  * to send out a change event.
  */
 
+/* CHECKME: This function modifies the Split without dirtying or
+   checking its parent.  Is that correct? */
 void
 xaccSplitDetermineGainStatus (Split *split)
 {
@@ -1632,7 +1634,7 @@
   }
 
   qof_instance_set_dirty(QOF_INSTANCE(trans));
-  mark_trans (trans);
+  mark_trans(trans);  /* Dirty balance of every account in trans */
   qof_commit_edit(QOF_INSTANCE(trans));
 }
 
@@ -2090,7 +2092,7 @@
   return trans ? (0 < trans->inst.editlevel) : FALSE;
 }
 
-/* Only used by postgres backend. Not sure if they should dirty the trans. */
+/* Only used by postgres backend. Not sure if it should dirty the trans. */
 void
 xaccTransSetVersion (Transaction *trans, gint32 vers)
 {
@@ -2202,7 +2204,8 @@
 
      if (gnc_numeric_check (new_value) == GNC_ERROR_OK)
        split->value = new_value;
-       SET_GAINS_VDIRTY(split);
+     SET_GAINS_VDIRTY(split);  /* Is this right? Dirty gains even if error? */
+     mark_split(split);
    }
    qof_commit_edit(QOF_INSTANCE(trans));
 }
@@ -3387,6 +3390,7 @@
     SET_GAINS_A_VDIRTY(split);
     split->reconciled = NREC;
     xaccSplitSetDateReconciledSecs (split, 0);
+    mark_split(split);
   }
 
   if (trans->splits)



More information about the gnucash-changes mailing list