[Gnucash-changes] r13956 - gnucash/trunk/lib/libqof/qof - Fix off-by-one error when checking editlevel in qof_commit_edit() (and

Chris Shoemaker chris at cvs.gnucash.org
Sun May 7 23:04:49 EDT 2006


Author: chris
Date: 2006-05-07 23:04:49 -0400 (Sun, 07 May 2006)
New Revision: 13956
Trac: http://svn.gnucash.org/trac/changeset/13956

Modified:
   gnucash/trunk/lib/libqof/qof/qofutil.c
   gnucash/trunk/lib/libqof/qof/qofutil.h
Log:
   Fix off-by-one error when checking editlevel in qof_commit_edit() (and
   macro version), in case we ever want qof_commit_edit() to actually do 
   something with a backend.


Modified: gnucash/trunk/lib/libqof/qof/qofutil.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofutil.c	2006-05-08 03:02:15 UTC (rev 13955)
+++ gnucash/trunk/lib/libqof/qof/qofutil.c	2006-05-08 03:04:49 UTC (rev 13956)
@@ -254,7 +254,7 @@
   inst->editlevel--;
   if (0 < inst->editlevel) return FALSE;
 
-  if ((-1 == inst->editlevel) && inst->dirty)
+  if ((0 == inst->editlevel) && inst->dirty)
   {
     be = qof_book_get_backend (inst->book);
     if (be && qof_backend_commit_exists(be)) {

Modified: gnucash/trunk/lib/libqof/qof/qofutil.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofutil.h	2006-05-08 03:02:15 UTC (rev 13955)
+++ gnucash/trunk/lib/libqof/qof/qofutil.h	2006-05-08 03:04:49 UTC (rev 13956)
@@ -354,7 +354,7 @@
   /* The pricedb suffers from delayed update...     */          \
   /* This may be setting a bad precedent for other types, I fear. */ \
   /* Other types probably really should handle begin like this. */ \
-  if ((-1 == (inst)->editlevel) && (inst)->dirty)                   \
+  if ((0 == (inst)->editlevel) && (inst)->dirty)                   \
   {                                                              \
     QofBackend * be;                                             \
     be = qof_book_get_backend ((inst)->book);                    \



More information about the gnucash-changes mailing list