* fix some compiler warnings in dialog-customer and dialog-vendor

* add a new function: gncOwnerIsValid() which is really a
	  scheme-helper to detect whether an owner is holding a NULL value
	  (i.e. a real container with no value in the container).
	* fix part of bug #96032 -- use (gnc:owner-is-valid) to detect owner
	  existence.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7331 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Derek Atkins 2002-10-17 15:17:47 +00:00
parent ca94a5b41f
commit bd4c60d1c2
7 changed files with 28 additions and 3 deletions

View File

@ -4,6 +4,13 @@
* remove (old, unused) dialog-job-select.[ch] files from CVS.
* fix bug #96035 -- do not limit searches to the last-chosen object.
* fix some compiler warnings in dialog-customer and dialog-vendor
* add a new function: gncOwnerIsValid() which is really a
scheme-helper to detect whether an owner is holding a NULL value
(i.e. a real container with no value in the container).
* fix part of bug #96032 -- use (gnc:owner-is-valid) to detect owner
existence.
2002-10-16 Joshua Sled <jsled@asynchronous.org>

View File

@ -277,6 +277,12 @@ gboolean gncOwnerGetOwnerFromLot (GNCLot *lot, GncOwner *owner)
return (owner->owner.undefined != NULL);
}
gboolean gncOwnerIsValid (GncOwner *owner)
{
if (!owner) return FALSE;
return (owner->owner.undefined != NULL);
}
/* XXX: Yea, this is broken, but it should work fine for Queries.
* We're single-threaded, right?
*/

View File

@ -56,6 +56,8 @@ gnc_commodity * gncOwnerGetCommodity (GncOwner *owner);
const GUID * gncOwnerGetGUID (GncOwner *owner);
GUID gncOwnerRetGUID (GncOwner *owner);
gboolean gncOwnerIsValid (GncOwner *owner);
/*
* Get the "parent" Owner or GUID thereof. The "parent" owner
* is the Customer or Vendor, or the Owner of a Job

View File

@ -973,6 +973,14 @@
'((<gnc:GncOwner*> src-owner) (<gnc:GncOwner*> dest-owner))
"Copy the src-owner to the dest-owner")
(gw:wrap-function
ws
'gnc:owner-is-valid?
'<gw:bool>
"gncOwnerIsValid"
'((<gnc:GncOwner*> owner))
"Is this a real owner? Return TRUE IFF there is an actual owner.")
;;
;; gncVendor.h
;;

View File

@ -602,7 +602,7 @@ gnc_customer_new_window (GNCBook *bookp, GncCustomer *cust)
gnc_ui_taxtables_optionmenu (cw->taxtable_menu, bookp, TRUE, &cw->taxtable);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cw->taxtable_check),
gncCustomerGetTaxTableOverride (cust));
gnc_customer_taxtable_check_cb (cw->taxtable_check, cw);
gnc_customer_taxtable_check_cb (GTK_TOGGLE_BUTTON (cw->taxtable_check), cw);
/* Set the Discount, and Credit amounts */
gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (cw->discount_amount),
@ -777,6 +777,7 @@ gnc_customer_search (GncCustomer *start, GNCBook *book)
{ N_("Process Payment"), payment_customer_cb},
{ NULL },
};
(void)order_customer_cb;
g_return_val_if_fail (book, NULL);

View File

@ -468,7 +468,7 @@ gnc_vendor_new_window (GNCBook *bookp, GncVendor *vendor)
gnc_ui_taxtables_optionmenu (vw->taxtable_menu, bookp, TRUE, &vw->taxtable);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (vw->taxtable_check),
gncVendorGetTaxTableOverride (vendor));
gnc_vendor_taxtable_check_cb (vw->taxtable_check, vw);
gnc_vendor_taxtable_check_cb (GTK_TOGGLE_BUTTON (vw->taxtable_check), vw);
gnc_gui_component_watch_entity_type (vw->component_id,
GNC_VENDOR_MODULE_NAME,
@ -635,6 +635,7 @@ gnc_vendor_search (GncVendor *start, GNCBook *book)
{ N_("Pay Bill"), payment_vendor_cb},
{ NULL },
};
(void)order_vendor_cb;
g_return_val_if_fail (book, NULL);

View File

@ -479,7 +479,7 @@
(if (not (null? account-list))
(set! account (car account-list)))
(if owner
(if (gnc:owner-is-valid? owner)
(begin
(setup-query query owner account)