From 6b925724e73525280c3280f1081844be1212fecf Mon Sep 17 00:00:00 2001 From: Chris Shoemaker Date: Mon, 8 May 2006 03:04:49 +0000 Subject: [PATCH] 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 --- lib/libqof/qof/qofutil.c | 2 +- lib/libqof/qof/qofutil.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libqof/qof/qofutil.c b/lib/libqof/qof/qofutil.c index 87b7995d66..96dc1f35a1 100644 --- a/lib/libqof/qof/qofutil.c +++ b/lib/libqof/qof/qofutil.c @@ -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)) { diff --git a/lib/libqof/qof/qofutil.h b/lib/libqof/qof/qofutil.h index c3a4274dae..f9e612e51a 100644 --- a/lib/libqof/qof/qofutil.h +++ b/lib/libqof/qof/qofutil.h @@ -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); \