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.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13956 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Chris Shoemaker
2006-05-08 03:04:49 +00:00
parent 57636f50e4
commit 6b925724e7
2 changed files with 2 additions and 2 deletions

View File

@@ -254,7 +254,7 @@ gboolean qof_commit_edit(QofInstance *inst)
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)) {

View File

@@ -354,7 +354,7 @@ gboolean qof_begin_edit(QofInstance *inst);
/* 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); \