Audit all .scm files for cases where null objects were assumed to be #f.

In most of these cases, I know the value is always returned from C, so we
can use "null?".  In cases where I wasn't sure, I make it check for either
#f or null?.  Hopefully, I got 'em all.  But, really, what are the chances?



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15060 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Chris Shoemaker 2006-10-29 03:12:49 +00:00
parent 9618429b17
commit e4ebb3eb1b
23 changed files with 69 additions and 66 deletions

View File

@ -637,7 +637,8 @@
(gnc:make-option (gnc:make-option
section name sort-tag 'account-list documentation-string getter section name sort-tag 'account-list documentation-string getter
(lambda (account-list) (lambda (account-list)
(if (not account-list) (set! account-list (default-getter))) (if (or (not account-list) (null? account-list))
(set! account-list (default-getter)))
(set! account-list (set! account-list
(filter (lambda (x) (if (string? x) (filter (lambda (x) (if (string? x)
(xaccAccountLookup (xaccAccountLookup
@ -760,7 +761,7 @@
(gnc:make-option (gnc:make-option
section name sort-tag 'account-sel documentation-string getter section name sort-tag 'account-sel documentation-string getter
(lambda (account) (lambda (account)
(if (not account) (set! account (get-default))) (if (or (not account) (null? account)) (set! account (get-default)))
(set! account (convert-to-account account)) (set! account (convert-to-account account))
(let* ((result (validator account)) (let* ((result (validator account))
(valid (car result)) (valid (car result))

View File

@ -91,20 +91,20 @@
(let* ((trans (xaccSplitGetParent split)) (let* ((trans (xaccSplitGetParent split))
(invoice (gncInvoiceGetInvoiceFromTxn trans)) (invoice (gncInvoiceGetInvoiceFromTxn trans))
(temp-owner (gncOwnerCreate)) (temp-owner (gncOwnerCreate))
(owner #f)) (owner '()))
(if invoice (if (not (null? invoice))
(set! owner (gncInvoiceGetOwner invoice)) (set! owner (gncInvoiceGetOwner invoice))
(let ((split-list (xaccTransGetSplitList trans))) (let ((split-list (xaccTransGetSplitList trans)))
(define (check-splits splits) (define (check-splits splits)
(if (and splits (not (null? splits))) (if (and splits (not (null? splits)))
(let* ((split (car splits)) (let* ((split (car splits))
(lot (xaccSplitGetLot split))) (lot (xaccSplitGetLot split)))
(if lot (if (not (null? lot))
(let* ((invoice (gncInvoiceGetInvoiceFromLot lot)) (let* ((invoice (gncInvoiceGetInvoiceFromLot lot))
(owner? (gnc:owner-get-owner-from-lot (owner? (gnc:owner-get-owner-from-lot
lot temp-owner))) lot temp-owner)))
(if invoice (if (not (null? invoice))
(set! owner (gncInvoiceGetOwner invoice)) (set! owner (gncInvoiceGetOwner invoice))
(if owner? (if owner?
(set! owner temp-owner) (set! owner temp-owner)
@ -112,14 +112,14 @@
(check-splits (cdr splits)))))) (check-splits (cdr splits))))))
(check-splits split-list))) (check-splits split-list)))
(if owner (if (not (null? owner))
(begin (begin
(gncOwnerCopy (gncOwnerGetEndOwner owner) result-owner) (gncOwnerCopy (gncOwnerGetEndOwner owner) result-owner)
(gncOwnerDestroy temp-owner) (gncOwnerDestroy temp-owner)
result-owner) result-owner)
(begin (begin
(gncOwnerDestroy temp-owner) (gncOwnerDestroy temp-owner)
#f)))) ;; FIXME! '()))))
(export gnc:owner-get-address) (export gnc:owner-get-address)

View File

@ -543,7 +543,7 @@ totals to report currency")
;; set default title ;; set default title
(gnc:html-document-set-title! document report-title) (gnc:html-document-set-title! document report-title)
;; maybe redefine better... ;; maybe redefine better...
(if account (if (not (null? account))
(begin (begin
(gnc:html-document-set-title! (gnc:html-document-set-title!
document (string-append report-title ": " (xaccAccountGetName account))) document (string-append report-title ": " (xaccAccountGetName account)))
@ -558,7 +558,7 @@ totals to report currency")
(gnc:html-table-set-col-headers! table heading-list) (gnc:html-table-set-col-headers! table heading-list)
(if account (if (not (null? account))
(begin (begin
(setup-query query account report-date) (setup-query query account report-date)
;; get the appropriate splits ;; get the appropriate splits

View File

@ -90,7 +90,7 @@
(if ref (if ref
(begin (begin
(set! ref (string-append ref (gncOwnerReturnGUID end-owner))) (set! ref (string-append ref (gncOwnerReturnGUID end-owner)))
(if acc (if (not (null? acc))
(set! ref (string-append ref "&acct=" (set! ref (string-append ref "&acct="
(gncAccountGetGUID acc)))) (gncAccountGetGUID acc))))
(gnc-build-url URL-TYPE-OWNERREPORT ref "")) (gnc-build-url URL-TYPE-OWNERREPORT ref ""))

View File

@ -473,7 +473,7 @@
(add-subtotal-row table used-columns tax-collector (add-subtotal-row table used-columns tax-collector
"grand-total" (_ "Tax"))) "grand-total" (_ "Tax")))
(if (and show-payments lot) (if (and show-payments (not (null? lot)))
(let ((splits (sort-list! (let ((splits (sort-list!
(gnc-lot-get-split-list lot) (gnc-lot-get-split-list lot)
(lambda (s1 s2) (lambda (s1 s2)
@ -524,7 +524,7 @@
(gnc:gnc-monetary-amount (cdr entry-values))) (gnc:gnc-monetary-amount (cdr entry-values)))
(let ((order (gncEntryGetOrder current))) (let ((order (gncEntryGetOrder current)))
(if order (add-order order))) (if (not (null? order)) (add-order order)))
(do-rows-with-subtotals rest (do-rows-with-subtotals rest
table table
@ -683,7 +683,7 @@
(if (and references? (not (member o orders))) (if (and references? (not (member o orders)))
(addto! orders o))) (addto! orders o)))
(if invoice (if (not (null? invoice))
(begin (begin
(set! owner (gncInvoiceGetOwner invoice)) (set! owner (gncInvoiceGetOwner invoice))
(let ((type (gncOwnerGetType (let ((type (gncOwnerGetType
@ -707,7 +707,7 @@
(add-html! document "<tr><td align='left'>") (add-html! document "<tr><td align='left'>")
(if invoice (if (not (null? invoice))
(begin (begin
; invoice number and ID String table ; invoice number and ID String table
(add-html! document "<table width='100%'><tr>") (add-html! document "<table width='100%'><tr>")

View File

@ -500,7 +500,7 @@
(add-subtotal-row table used-columns tax-collector (add-subtotal-row table used-columns tax-collector
"grand-total" (_ "Tax"))) "grand-total" (_ "Tax")))
(if (and show-payments lot) (if (and show-payments (not (null? lot)))
(let ((splits (sort-list! (let ((splits (sort-list!
(gnc-lot-get-split-list lot) (gnc-lot-get-split-list lot)
(lambda (s1 s2) (lambda (s1 s2)
@ -552,7 +552,7 @@
(gnc:gnc-monetary-amount (cdr entry-values))) (gnc:gnc-monetary-amount (cdr entry-values)))
(let ((order (gncEntryGetOrder current))) (let ((order (gncEntryGetOrder current)))
(if order (add-order order))) (if (not (null? order)) (add-order order)))
(set! entries-added (+ entries-added 1)) (set! entries-added (+ entries-added 1))
@ -766,7 +766,7 @@
(if (and references? (not (member o orders))) (if (and references? (not (member o orders)))
(addto! orders o))) (addto! orders o)))
(if invoice (if (not (null? invoice))
(begin (begin
(set! owner (gncInvoiceGetOwner invoice)) (set! owner (gncInvoiceGetOwner invoice))
(let ((type (gncOwnerGetType (let ((type (gncOwnerGetType
@ -784,7 +784,7 @@
;; invoice number moved below ;; invoice number moved below
;;(gnc:html-document-set-title! document title) ;;(gnc:html-document-set-title! document title)
(if invoice (if (not (null? invoice))
(let* ((book (gncInvoiceGetBook invoice)) (let* ((book (gncInvoiceGetBook invoice))
(slots (gnc-book-get-slots book)) (slots (gnc-book-get-slots book))
(date-object #f) (date-object #f)

View File

@ -636,7 +636,7 @@
(if (and references? (not (member o orders))) (if (and references? (not (member o orders)))
(addto! orders o))) (addto! orders o)))
(if invoice (if (not (null? invoice))
(begin (begin
(set! owner (gncInvoiceGetOwner invoice)) (set! owner (gncInvoiceGetOwner invoice))
(let ((type (gncOwnerGetType (let ((type (gncOwnerGetType
@ -653,7 +653,7 @@
(gnc:html-document-set-title! document title) (gnc:html-document-set-title! document title)
(if invoice (if (not (null? invoice))
(let ((book (gncInvoiceGetBook invoice))) (let ((book (gncInvoiceGetBook invoice)))
(set! table (make-entry-table invoice (set! table (make-entry-table invoice
(gnc:report-options report-obj) (gnc:report-options report-obj)

View File

@ -163,7 +163,7 @@
(begin (begin
(if reverse? (if reverse?
(set! bal (gnc-numeric-neg bal))) (set! bal (gnc-numeric-neg bal)))
(if invoice (if (not (null? invoice))
(begin (begin
(apply-invoice post-date bal)) (apply-invoice post-date bal))
(apply-payment bal)))))) (apply-payment bal))))))
@ -202,7 +202,7 @@
(type-str (type-str
(cond (cond
((equal? type gnc:transaction-type-invoice) ((equal? type gnc:transaction-type-invoice)
(if invoice (if (not (null? invoice))
(gnc:make-html-text (gnc:make-html-text
(gnc:html-markup-anchor (gnc:html-markup-anchor
(gnc:invoice-anchor-text invoice) (gnc:invoice-anchor-text invoice)
@ -255,7 +255,7 @@
))) )))
; Now print out the invoice row ; Now print out the invoice row
(if invoice (if (not (null? invoice))
(set! due-date (gncInvoiceGetDateDue invoice))) (set! due-date (gncInvoiceGetDateDue invoice)))
(let ((row (make-row date due-date (xaccTransGetNum txn) (let ((row (make-row date due-date (xaccTransGetNum txn)
@ -575,7 +575,7 @@
(gnc:owner-anchor-text owner) (gnc:owner-anchor-text owner)
(gncOwnerGetName owner)))) (gncOwnerGetName owner))))
(if account (if (not (null? account))
(begin (begin
(set! table (make-txn-table (gnc:report-options report-obj) (set! table (make-txn-table (gnc:report-options report-obj)
query account start-date end-date)) query account start-date end-date))
@ -709,7 +709,7 @@
(define (gnc:owner-report-create owner account) (define (gnc:owner-report-create owner account)
; Figure out an account to use if nothing exists here. ; Figure out an account to use if nothing exists here.
(if (not account) (if (null? account)
(set! account (find-first-account-for-owner owner))) (set! account (find-first-account-for-owner owner)))
(owner-report-create owner account)) (owner-report-create owner account))
@ -722,7 +722,7 @@
(owner (gnc:owner-from-split split temp-owner)) (owner (gnc:owner-from-split split temp-owner))
(res #f)) (res #f))
(if owner (if (not (null? owner))
(set! res (gnc:owner-report-create owner account))) (set! res (gnc:owner-report-create owner account)))
(gncOwnerDestroy temp-owner) (gncOwnerDestroy temp-owner)

View File

@ -61,7 +61,7 @@
(gnc:make-option (gnc:make-option
section name sort-tag 'invoice documentation-string getter section name sort-tag 'invoice documentation-string getter
(lambda (invoice) ;; setter (lambda (invoice) ;; setter
(if (not invoice) (set! invoice (default-getter))) (if (null? invoice) (set! invoice (default-getter)))
(set! invoice (convert-to-invoice invoice)) (set! invoice (convert-to-invoice invoice))
(let* ((result (validator invoice)) (let* ((result (validator invoice))
(valid (car result)) (valid (car result))
@ -122,7 +122,7 @@
(gnc:make-option (gnc:make-option
section name sort-tag 'customer documentation-string getter section name sort-tag 'customer documentation-string getter
(lambda (customer) (lambda (customer)
(if (not customer) (set! customer (default-getter))) (if (null? customer) (set! customer (default-getter)))
(set! customer (convert-to-customer customer)) (set! customer (convert-to-customer customer))
(let* ((result (validator customer)) (let* ((result (validator customer))
(valid (car result)) (valid (car result))
@ -183,7 +183,7 @@
(gnc:make-option (gnc:make-option
section name sort-tag 'vendor documentation-string getter section name sort-tag 'vendor documentation-string getter
(lambda (vendor) (lambda (vendor)
(if (not vendor) (set! vendor (default-getter))) (if (null? vendor) (set! vendor (default-getter)))
(set! vendor (convert-to-vendor vendor)) (set! vendor (convert-to-vendor vendor))
(let* ((result (validator vendor)) (let* ((result (validator vendor))
(valid (car result)) (valid (car result))
@ -244,7 +244,7 @@
(gnc:make-option (gnc:make-option
section name sort-tag 'employee documentation-string getter section name sort-tag 'employee documentation-string getter
(lambda (employee) (lambda (employee)
(if (not employee) (set! employee (default-getter))) (if (null? employee) (set! employee (default-getter)))
(set! employee (convert-to-employee employee)) (set! employee (convert-to-employee employee))
(let* ((result (validator employee)) (let* ((result (validator employee))
(valid (car result)) (valid (car result))
@ -343,7 +343,7 @@
(gnc:make-option (gnc:make-option
section name sort-tag 'owner documentation-string getter section name sort-tag 'owner documentation-string getter
(lambda (owner) (lambda (owner)
(if (not owner) (set! owner (default-getter))) (if (null? owner) (set! owner (default-getter)))
(set! owner (convert-to-owner owner)) (set! owner (convert-to-owner owner))
(let* ((result (validator owner)) (let* ((result (validator owner))
(valid (car result)) (valid (car result))
@ -410,7 +410,7 @@
(gnc:make-option (gnc:make-option
section name sort-tag 'taxtable documentation-string getter section name sort-tag 'taxtable documentation-string getter
(lambda (taxtable) (lambda (taxtable)
(if (not taxtable) (set! taxtable (default-getter))) (if (null? taxtable) (set! taxtable (default-getter)))
(set! taxtable (convert-to-taxtable taxtable)) (set! taxtable (convert-to-taxtable taxtable))
(let* ((result (validator taxtable)) (let* ((result (validator taxtable))
(valid (car result)) (valid (car result))

View File

@ -111,7 +111,7 @@
;; status and date are not copied. The C split's guid is, ;; status and date are not copied. The C split's guid is,
;; of course, unchanged. ;; of course, unchanged.
(define (gnc:split-scm-onto-split split-scm split book) (define (gnc:split-scm-onto-split split-scm split book)
(if (not split) (if (null? split)
#f #f
(begin (begin
(let ((memo (gnc:split-scm-get-memo split-scm)) (let ((memo (gnc:split-scm-get-memo split-scm))
@ -125,7 +125,7 @@
(let ((account (xaccAccountLookup (let ((account (xaccAccountLookup
(gnc:split-scm-get-account-guid split-scm) (gnc:split-scm-get-account-guid split-scm)
book))) book)))
(if account (if (not (null? account))
(begin (begin
(xaccAccountBeginEdit account) (xaccAccountBeginEdit account)
(xaccSplitSetAccount split account) (xaccSplitSetAccount split account)

View File

@ -26,7 +26,7 @@
(define (qif-import:load-map-prefs) (define (qif-import:load-map-prefs)
(define (extract-all-account-info agroup root-name) (define (extract-all-account-info agroup root-name)
(if (not agroup) (if (null? agroup)
'() '()
(let ((children-list (xaccGroupGetAccountListSorted agroup)) (let ((children-list (xaccGroupGetAccountListSorted agroup))
(names '())) (names '()))

View File

@ -53,7 +53,7 @@
(lambda (xtn) (lambda (xtn)
(let ((query (qof-query-create-for-splits))) (let ((query (qof-query-create-for-splits)))
(set! work-done (+ 1 work-done)) (set! work-done (+ 1 work-done))
(if progress-dialog (if (not (null? progress-dialog))
(begin (begin
(gnc-progress-dialog-set-value (gnc-progress-dialog-set-value
progress-dialog (/ work-done work-to-do)) progress-dialog (/ work-done work-to-do))
@ -132,7 +132,7 @@
new-xtns) new-xtns)
;; get rid of the progress dialog ;; get rid of the progress dialog
(if progress-dialog (if (not (null? progress-dialog))
(gnc-progress-dialog-destroy progress-dialog)) (gnc-progress-dialog-destroy progress-dialog))
;; return the matches ;; return the matches

View File

@ -38,13 +38,13 @@
#t)))) #t))))
(define (make-unique-name-variant long-name short-name) (define (make-unique-name-variant long-name short-name)
(if (xaccGetAccountFromFullName old-group long-name) (if (not (null? (xaccGetAccountFromFullName old-group long-name)))
(let loop ((count 2)) (let loop ((count 2))
(let* ((test-name (let* ((test-name
(string-append long-name (sprintf #f " %a" count))) (string-append long-name (sprintf #f " %a" count)))
(test-acct (test-acct
(xaccGetAccountFromFullName old-group test-name))) (xaccGetAccountFromFullName old-group test-name)))
(if (and test-acct (not (compatible? test-acct))) (if (and (not (null? test-acct)) (not (compatible? test-acct)))
(loop (+ 1 count)) (loop (+ 1 count))
(string-append short-name (sprintf #f " %a" count))))) (string-append short-name (sprintf #f " %a" count)))))
short-name)) short-name))
@ -53,7 +53,7 @@
;; if the name is in use but the commodity, or type are ;; if the name is in use but the commodity, or type are
;; incompatible, we need to create a new account with a modified ;; incompatible, we need to create a new account with a modified
;; name. ;; name.
(if same-gnc-account (if (and same-gnc-account (not (null? same-gnc-account)))
(if (compatible? same-gnc-account) (if (compatible? same-gnc-account)
(begin (begin
;; everything is ok, so we can just use the same ;; everything is ok, so we can just use the same
@ -77,7 +77,8 @@
;; here, existing-account means a previously *created* account ;; here, existing-account means a previously *created* account
;; (possibly a new account, possibly a copy of an existing gnucash ;; (possibly a new account, possibly a copy of an existing gnucash
;; acct) ;; acct)
(if (and existing-account (compatible? existing-account)) (if (and (and existing-account (not (null? existing-account)))
(compatible? existing-account))
existing-account existing-account
(let ((new-acct (xaccMallocAccount (gnc-get-current-book))) (let ((new-acct (xaccMallocAccount (gnc-get-current-book)))
(parent-acct #f) (parent-acct #f)
@ -91,7 +92,7 @@
;; if this is a copy of an existing gnc account, copy the ;; if this is a copy of an existing gnc account, copy the
;; account properties. For incompatible existing accts, ;; account properties. For incompatible existing accts,
;; we'll do something different later. ;; we'll do something different later.
(if same-gnc-account (if (and same-gnc-account (not (null? same-gnc-account)))
(begin (begin
(xaccAccountSetName (xaccAccountSetName
new-acct (xaccAccountGetName same-gnc-account)) new-acct (xaccAccountGetName same-gnc-account))
@ -156,7 +157,7 @@
(set! parent-acct (qif-import:find-or-make-acct (set! parent-acct (qif-import:find-or-make-acct
pinfo #t default-currency #f default-currency pinfo #t default-currency #f default-currency
gnc-acct-hash old-group new-group)))) gnc-acct-hash old-group new-group))))
(if parent-acct (if (and parent-acct (not (null? parent-acct)))
(xaccAccountInsertSubAccount parent-acct new-acct) (xaccAccountInsertSubAccount parent-acct new-acct)
(xaccGroupInsertAccount new-group new-acct)) (xaccGroupInsertAccount new-group new-acct))
@ -308,7 +309,7 @@
(let xloop ((xtn (car markable-xtns)) (let xloop ((xtn (car markable-xtns))
(rest (cdr markable-xtns))) (rest (cdr markable-xtns)))
(set! work-done (+ 1 work-done)) (set! work-done (+ 1 work-done))
(if progress-dialog (if (not (null? progress-dialog))
(begin (begin
(gnc-progress-dialog-set-value (gnc-progress-dialog-set-value
progress-dialog (/ work-done work-to-do)) progress-dialog (/ work-done work-to-do))
@ -325,7 +326,7 @@
(for-each (for-each
(lambda (xtn) (lambda (xtn)
(set! work-done (+ 1 work-done)) (set! work-done (+ 1 work-done))
(if progress-dialog (if (not (null? progress-dialog))
(begin (begin
(gnc-progress-dialog-set-value (gnc-progress-dialog-set-value
progress-dialog (/ work-done work-to-do)) progress-dialog (/ work-done work-to-do))
@ -352,7 +353,7 @@
sorted-qif-files-list) sorted-qif-files-list)
;; get rid of the progress dialog ;; get rid of the progress dialog
(if progress-dialog (if (not (null? progress-dialog))
(gnc-progress-dialog-destroy progress-dialog)) (gnc-progress-dialog-destroy progress-dialog))
new-group)))) new-group))))

View File

@ -59,7 +59,7 @@
(type (qif-io:account-type qif-acct)) (type (qif-io:account-type qif-acct))
(desc (qif-io:account-description qif-acct)) (desc (qif-io:account-description qif-acct))
(gnc-acct (hash-ref qif-acct-table name))) (gnc-acct (hash-ref qif-acct-table name)))
(if gnc-acct (if (and gnc-acct (not (null? gnc-acct)))
(let ((gnc-type (qif-io:parse-acct-type type))) (let ((gnc-type (qif-io:parse-acct-type type)))
(xaccAccountBeginEdit gnc-acct) (xaccAccountBeginEdit gnc-acct)
(if gnc-type (if gnc-type
@ -73,7 +73,7 @@
(hash-fold (hash-fold
(lambda (name acct p) (lambda (name acct p)
(let ((cmdty (xaccAccountGetCommodity acct))) (let ((cmdty (xaccAccountGetCommodity acct)))
(if (not cmdty) (if (null? cmdty)
(begin (begin
(xaccAccountBeginEdit acct) (xaccAccountBeginEdit acct)
(xaccAccountSetCommodity acct commodity) (xaccAccountSetCommodity acct commodity)
@ -94,7 +94,7 @@
(income? (qif-io:category-income-cat qif-cat)) (income? (qif-io:category-income-cat qif-cat))
(desc (qif-io:category-description qif-cat)) (desc (qif-io:category-description qif-cat))
(gnc-acct (hash-ref qif-cat-table name))) (gnc-acct (hash-ref qif-cat-table name)))
(if gnc-acct (if (and gnc-acct (not (null? gnc-acct)))
(begin (begin
(xaccAccountBeginEdit gnc-acct) (xaccAccountBeginEdit gnc-acct)
(cond (income? (cond (income?

View File

@ -660,7 +660,7 @@
(to-special #f) ; clear special-splits-period (to-special #f) ; clear special-splits-period
(from-special #f) (from-special #f)
(childrens-output (childrens-output
(if (not children) (if (null? children)
(let* ((splits-period (txf-special-splits-period (let* ((splits-period (txf-special-splits-period
account from-value to-value))) account from-value to-value)))
(if splits-period (if splits-period
@ -736,7 +736,7 @@
(if tax-mode? (if tax-mode?
(list level-x-output (list level-x-output
childrens-output) childrens-output)
(if (not children) ; swap for txf special splt (if (null? children) ; swap for txf special splt
(list childrens-output level-x-output) (list childrens-output level-x-output)
(list level-x-output childrens-output))))))) (list level-x-output childrens-output)))))))
;; Ignore ;; Ignore

View File

@ -637,7 +637,7 @@
(to-special #f) ; clear special-splits-period (to-special #f) ; clear special-splits-period
(from-special #f) (from-special #f)
(childrens-output (childrens-output
(if (not children) (if (null? children)
(let* ((splits-period (txf-special-splits-period (let* ((splits-period (txf-special-splits-period
account from-value to-value))) account from-value to-value)))
(if splits-period (if splits-period
@ -713,7 +713,7 @@
(if tax-mode? (if tax-mode?
(list level-x-output (list level-x-output
childrens-output) childrens-output)
(if (not children) ; swap for txf special splt (if (null? children) ; swap for txf special splt
(list childrens-output level-x-output) (list childrens-output level-x-output)
(list level-x-output childrens-output))))))) (list level-x-output childrens-output)))))))
;; Ignore ;; Ignore

View File

@ -34,7 +34,7 @@
;; instead, this function's side-effect is to set the report's editor widget. ;; instead, this function's side-effect is to set the report's editor widget.
(define (gnc:report-edit-options report) (define (gnc:report-edit-options report)
(let* ((editor-widg (gnc:report-editor-widget report))) (let* ((editor-widg (gnc:report-editor-widget report)))
(if editor-widg (if (and editor-widg (not (null? editor-widg)))
(gnc-report-raise-editor report) (gnc-report-raise-editor report)
(begin (begin
(if (gnc:report-options report) (if (gnc:report-options report)

View File

@ -38,6 +38,7 @@ gboolean gnc_run_report_id_string (const char * id_string, char **data);
**/ **/
gchar* gnc_report_name( SCM report ); gchar* gnc_report_name( SCM report );
/* returns #f if the report id cannot be found */
SCM gnc_report_find(gint id); SCM gnc_report_find(gint id);
void gnc_report_remove_by_id(gint id); void gnc_report_remove_by_id(gint id);
gint gnc_report_add(SCM report); gint gnc_report_add(SCM report);

View File

@ -78,14 +78,14 @@
;; returns the account name as html-text and anchor to the register. ;; returns the account name as html-text and anchor to the register.
(define (gnc:html-account-anchor acct) (define (gnc:html-account-anchor acct)
(gnc:make-html-text (if acct (gnc:make-html-text (if (and acct (not (null? acct)))
(gnc:html-markup-anchor (gnc:html-markup-anchor
(gnc:account-anchor-text acct) (gnc:account-anchor-text acct)
(xaccAccountGetName acct)) (xaccAccountGetName acct))
""))) "")))
(define (gnc:html-split-anchor split text) (define (gnc:html-split-anchor split text)
(gnc:make-html-text (if (xaccSplitGetAccount split) (gnc:make-html-text (if (not (null? (xaccSplitGetAccount split)))
(gnc:html-markup-anchor (gnc:html-markup-anchor
(gnc:split-anchor-text split) (gnc:split-anchor-text split)
text) text)

View File

@ -185,7 +185,7 @@
(define (account-get-depth account) (define (account-get-depth account)
(define (account-get-depth-internal account-internal depth) (define (account-get-depth-internal account-internal depth)
(let ((parent (xaccAccountGetParentAccount account-internal))) (let ((parent (xaccAccountGetParentAccount account-internal)))
(if parent (if (not (null? parent))
(account-get-depth-internal parent (+ depth 1)) (account-get-depth-internal parent (+ depth 1))
depth))) depth)))
(account-get-depth-internal account 1)) (account-get-depth-internal account 1))

View File

@ -116,7 +116,7 @@
(define (gnc:split-get-balance-display split) (define (gnc:split-get-balance-display split)
(let ((account (xaccSplitGetAccount split)) (let ((account (xaccSplitGetAccount split))
(balance (xaccSplitGetBalance split))) (balance (xaccSplitGetBalance split)))
(if (and account (gnc-reverse-balance account)) (if (and (not (null? account)) (gnc-reverse-balance account))
(gnc-numeric-neg balance) (gnc-numeric-neg balance)
balance))) balance)))
@ -125,7 +125,7 @@
(let* ((row-contents '()) (let* ((row-contents '())
(parent (xaccSplitGetParent split)) (parent (xaccSplitGetParent split))
(account (xaccSplitGetAccount split)) (account (xaccSplitGetAccount split))
(currency (if account (currency (if (not (null? account))
(xaccAccountGetCommodity account) (xaccAccountGetCommodity account)
(gnc-default-currency))) (gnc-default-currency)))
(damount (xaccSplitGetAmount split)) (damount (xaccSplitGetAmount split))
@ -157,7 +157,7 @@
(if transaction-info? (if transaction-info?
(let ((other-split (let ((other-split
(xaccSplitGetOtherSplit split))) (xaccSplitGetOtherSplit split)))
(if other-split (if (not (null? other-split))
(gnc-account-get-full-name (gnc-account-get-full-name
(xaccSplitGetAccount other-split)) (xaccSplitGetAccount other-split))
(_ "-- Split Transaction --"))) (_ "-- Split Transaction --")))
@ -343,7 +343,7 @@
(define (display-subtotal monetary) (define (display-subtotal monetary)
(if (amount-single-col used-columns) (if (amount-single-col used-columns)
(if (and leader (gnc-reverse-balance leader)) (if (and (not (null? leader)) (gnc-reverse-balance leader))
(gnc:monetary-neg monetary) (gnc:monetary-neg monetary)
monetary) monetary)
(if (gnc-numeric-negative-p (gnc:gnc-monetary-amount monetary)) (if (gnc-numeric-negative-p (gnc:gnc-monetary-amount monetary))
@ -453,11 +453,11 @@
(define (splits-leader splits) (define (splits-leader splits)
(let ((accounts (map xaccSplitGetAccount splits))) (let ((accounts (map xaccSplitGetAccount splits)))
(if (null? accounts) #f (if (null? accounts) '()
(begin (begin
(set! accounts (cons (car accounts) (set! accounts (cons (car accounts)
(delete (car accounts) (cdr accounts)))) (delete (car accounts) (cdr accounts))))
(if (not (null? (cdr accounts))) #f (if (not (null? (cdr accounts))) '()
(car accounts)))))) (car accounts))))))
(let* ((table (gnc:make-html-table)) (let* ((table (gnc:make-html-table))

View File

@ -61,7 +61,7 @@
(gnc:debug "hash: " gnc:*register-report-hash*) (gnc:debug "hash: " gnc:*register-report-hash*)
(gnc:debug "split: " split) (gnc:debug "split: " split)
(if type-info (if type-info
(if split (if (not (null? split))
(begin (gnc:debug "get-split...") (get-split type-info)) (begin (gnc:debug "get-split...") (get-split type-info))
(begin (gnc:debug "get-non-split...") (get-non-split type-info))) (begin (gnc:debug "get-non-split...") (get-non-split type-info)))
#f))) #f)))

View File

@ -108,7 +108,7 @@
(payee-stub-text "") (payee-stub-text "")
(memo-stub-text "")) (memo-stub-text ""))
(if ps (if (not (null? ps))
(begin (begin
(if (not (eq? (print-check-format:format format-info) 'custom)) (if (not (eq? (print-check-format:format format-info) 'custom))
(begin (begin