mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
@@ -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)) {
|
||||
|
||||
@@ -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); \
|
||||
|
||||
Reference in New Issue
Block a user