gnucash master: Multiple changes pushed
Mike Alexander
mta at code.gnucash.org
Sat Jul 5 01:14:35 EDT 2014
Updated via https://github.com/Gnucash/gnucash/commit/8b76ff21 (commit)
via https://github.com/Gnucash/gnucash/commit/bacc0b2a (commit)
from https://github.com/Gnucash/gnucash/commit/147a5f5d (commit)
commit 8b76ff21a2de711f038784c52aded2f4ed9d0c29
Author: Mike Alexander <mta at umich.edu>
Date: Sat Jul 5 01:06:40 2014 -0400
Use symbols to access lot owner type and owner GUID properties.
diff --git a/src/engine/gncOwner.c b/src/engine/gncOwner.c
index ba81060..543c85f 100644
--- a/src/engine/gncOwner.c
+++ b/src/engine/gncOwner.c
@@ -602,8 +602,8 @@ void gncOwnerAttachToLot (const GncOwner *owner, GNCLot *lot)
gnc_lot_begin_edit (lot);
qof_instance_set (QOF_INSTANCE (lot),
- "owner-type", (gint64)gncOwnerGetType (owner),
- "owner-guid", gncOwnerGetGUID (owner),
+ GNC_OWNER_TYPE, (gint64)gncOwnerGetType (owner),
+ GNC_OWNER_GUID, gncOwnerGetGUID (owner),
NULL);
gnc_lot_commit_edit (lot);
}
@@ -619,8 +619,8 @@ gboolean gncOwnerGetOwnerFromLot (GNCLot *lot, GncOwner *owner)
book = gnc_lot_get_book (lot);
qof_instance_get (QOF_INSTANCE (lot),
- "owner-type", &type64,
- "owner-guid", &guid,
+ GNC_OWNER_TYPE, &type64,
+ GNC_OWNER_GUID, &guid,
NULL);
type = (GncOwnerType) type64;
switch (type)
diff --git a/src/engine/test/test-engine-kvp-properties.c b/src/engine/test/test-engine-kvp-properties.c
index 97b0efe..8dea04f 100644
--- a/src/engine/test/test-engine-kvp-properties.c
+++ b/src/engine/test/test-engine-kvp-properties.c
@@ -292,8 +292,8 @@ test_lot_kvp_properties (Fixture *fixture, gconstpointer pData)
qof_begin_edit (QOF_INSTANCE (fixture->lot));
qof_instance_set (QOF_INSTANCE (fixture->lot),
"invoice", invoice,
- "owner-type", owner_type,
- "owner-guid", owner,
+ GNC_OWNER_TYPE, owner_type,
+ GNC_OWNER_GUID, owner,
NULL);
g_assert (qof_instance_is_dirty (QOF_INSTANCE (fixture->lot)));
@@ -301,8 +301,8 @@ test_lot_kvp_properties (Fixture *fixture, gconstpointer pData)
qof_instance_get (QOF_INSTANCE (fixture->lot),
"invoice", &invoice_r,
- "owner-type", &owner_type_r,
- "owner-guid", &owner_r,
+ GNC_OWNER_TYPE, &owner_type_r,
+ GNC_OWNER_GUID, &owner_r,
NULL);
g_assert (guid_equal (invoice, invoice_r));
g_assert_cmpint (owner_type, ==, owner_type_r);
commit bacc0b2a6554fc087c439a924dafe71cf3faa081
Author: Mike Alexander <mta at umich.edu>
Date: Sat Jul 5 00:44:01 2014 -0400
Fix crash in gncOwnerGetOwnerFromLot due to clobbered stack variable.
The "owner-type" lot property is 64 bits, don't store it in a 32 bit variable.
diff --git a/src/engine/gncOwner.c b/src/engine/gncOwner.c
index 6fa69d4..ba81060 100644
--- a/src/engine/gncOwner.c
+++ b/src/engine/gncOwner.c
@@ -613,14 +613,16 @@ gboolean gncOwnerGetOwnerFromLot (GNCLot *lot, GncOwner *owner)
GncGUID *guid = NULL;
QofBook *book;
GncOwnerType type = GNC_OWNER_NONE;
+ guint64 type64 = 0;
if (!lot || !owner) return FALSE;
book = gnc_lot_get_book (lot);
qof_instance_get (QOF_INSTANCE (lot),
- "owner-type", &type,
+ "owner-type", &type64,
"owner-guid", &guid,
NULL);
+ type = (GncOwnerType) type64;
switch (type)
{
case GNC_OWNER_CUSTOMER:
Summary of changes:
src/engine/gncOwner.c | 10 ++++++----
src/engine/test/test-engine-kvp-properties.c | 8 ++++----
2 files changed, 10 insertions(+), 8 deletions(-)
More information about the gnucash-changes
mailing list