r20658 - gnucash/trunk/src/business/business-gnome - Fix crash when editing existing owners from the new owner tree overview pages

Geert Janssens gjanssens at code.gnucash.org
Wed May 18 16:15:22 EDT 2011


Author: gjanssens
Date: 2011-05-18 16:15:22 -0400 (Wed, 18 May 2011)
New Revision: 20658
Trac: http://svn.gnucash.org/trac/changeset/20658

Modified:
   gnucash/trunk/src/business/business-gnome/dialog-customer.c
   gnucash/trunk/src/business/business-gnome/dialog-employee.c
   gnucash/trunk/src/business/business-gnome/dialog-vendor.c
Log:
Fix crash when editing existing owners from the new owner tree overview pages

Modified: gnucash/trunk/src/business/business-gnome/dialog-customer.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/dialog-customer.c	2011-05-18 18:52:32 UTC (rev 20657)
+++ gnucash/trunk/src/business/business-gnome/dialog-customer.c	2011-05-18 20:15:22 UTC (rev 20658)
@@ -207,7 +207,8 @@
 
     gncCustomerBeginEdit (cust);
 
-    qof_event_gen(QOF_INSTANCE(cust), QOF_EVENT_ADD, NULL);
+    if (cw->dialog_type == NEW_CUSTOMER)
+        qof_event_gen(QOF_INSTANCE(cust), QOF_EVENT_ADD, NULL);
 
     gncCustomerSetID (cust, gtk_editable_get_chars
                       (GTK_EDITABLE (cw->id_entry), 0, -1));

Modified: gnucash/trunk/src/business/business-gnome/dialog-employee.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/dialog-employee.c	2011-05-18 18:52:32 UTC (rev 20657)
+++ gnucash/trunk/src/business/business-gnome/dialog-employee.c	2011-05-18 20:15:22 UTC (rev 20658)
@@ -125,7 +125,8 @@
 
     gncEmployeeBeginEdit (employee);
 
-    qof_event_gen(QOF_INSTANCE(employee), QOF_EVENT_ADD, NULL);
+    if (ew->dialog_type == NEW_EMPLOYEE)
+        qof_event_gen(QOF_INSTANCE(employee), QOF_EVENT_ADD, NULL);
 
     gncEmployeeSetID (employee, gtk_editable_get_chars
                       (GTK_EDITABLE (ew->id_entry), 0, -1));

Modified: gnucash/trunk/src/business/business-gnome/dialog-vendor.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/dialog-vendor.c	2011-05-18 18:52:32 UTC (rev 20657)
+++ gnucash/trunk/src/business/business-gnome/dialog-vendor.c	2011-05-18 20:15:22 UTC (rev 20658)
@@ -140,7 +140,8 @@
     gnc_suspend_gui_refresh ();
     gncVendorBeginEdit (vendor);
 
-    qof_event_gen(QOF_INSTANCE(vendor), QOF_EVENT_ADD, NULL);
+    if (vw->dialog_type == NEW_VENDOR)
+        qof_event_gen(QOF_INSTANCE(vendor), QOF_EVENT_ADD, NULL);
 
     gncVendorSetID (vendor, gtk_editable_get_chars
                     (GTK_EDITABLE (vw->id_entry), 0, -1));



More information about the gnucash-changes mailing list