From e4ebb3eb1b7cbed08f3c3808bc847d62ce750f41 Mon Sep 17 00:00:00 2001 From: Chris Shoemaker Date: Sun, 29 Oct 2006 03:12:49 +0000 Subject: [PATCH] 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 --- src/app-utils/options.scm | 5 +++-- src/business/business-core/business-core.scm | 12 ++++++------ src/business/business-reports/aging.scm | 4 ++-- .../business-reports/business-reports.scm | 2 +- .../business-reports/easy-invoice.scm | 8 ++++---- .../business-reports/fancy-invoice.scm | 8 ++++---- src/business/business-reports/invoice.scm | 4 ++-- .../business-reports/owner-report.scm | 12 ++++++------ .../business-utils/business-options.scm | 12 ++++++------ src/engine/engine-interface.scm | 4 ++-- .../qif-import/qif-guess-map.scm | 2 +- .../qif-import/qif-merge-groups.scm | 4 ++-- src/import-export/qif-import/qif-to-gnc.scm | 19 ++++++++++--------- .../qif-io-core/qif-acct-table.scm | 6 +++--- .../locale-specific/us/taxtxf-de_DE.scm | 4 ++-- src/report/locale-specific/us/taxtxf.scm | 4 ++-- src/report/report-gnome/report-gnome.scm | 2 +- src/report/report-system/gnc-report.h | 1 + src/report/report-system/html-utilities.scm | 4 ++-- src/report/standard-reports/cash-flow.scm | 2 +- src/report/standard-reports/register.scm | 12 ++++++------ .../standard-reports/standard-reports.scm | 2 +- src/scm/printing/print-check.scm | 2 +- 23 files changed, 69 insertions(+), 66 deletions(-) diff --git a/src/app-utils/options.scm b/src/app-utils/options.scm index 79a6b231fe..6336d77e27 100644 --- a/src/app-utils/options.scm +++ b/src/app-utils/options.scm @@ -637,7 +637,8 @@ (gnc:make-option section name sort-tag 'account-list documentation-string getter (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 (filter (lambda (x) (if (string? x) (xaccAccountLookup @@ -760,7 +761,7 @@ (gnc:make-option section name sort-tag 'account-sel documentation-string getter (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)) (let* ((result (validator account)) (valid (car result)) diff --git a/src/business/business-core/business-core.scm b/src/business/business-core/business-core.scm index 25bb734c00..c1d860b27d 100644 --- a/src/business/business-core/business-core.scm +++ b/src/business/business-core/business-core.scm @@ -91,20 +91,20 @@ (let* ((trans (xaccSplitGetParent split)) (invoice (gncInvoiceGetInvoiceFromTxn trans)) (temp-owner (gncOwnerCreate)) - (owner #f)) + (owner '())) - (if invoice + (if (not (null? invoice)) (set! owner (gncInvoiceGetOwner invoice)) (let ((split-list (xaccTransGetSplitList trans))) (define (check-splits splits) (if (and splits (not (null? splits))) (let* ((split (car splits)) (lot (xaccSplitGetLot split))) - (if lot + (if (not (null? lot)) (let* ((invoice (gncInvoiceGetInvoiceFromLot lot)) (owner? (gnc:owner-get-owner-from-lot lot temp-owner))) - (if invoice + (if (not (null? invoice)) (set! owner (gncInvoiceGetOwner invoice)) (if owner? (set! owner temp-owner) @@ -112,14 +112,14 @@ (check-splits (cdr splits)))))) (check-splits split-list))) - (if owner + (if (not (null? owner)) (begin (gncOwnerCopy (gncOwnerGetEndOwner owner) result-owner) (gncOwnerDestroy temp-owner) result-owner) (begin (gncOwnerDestroy temp-owner) - #f)))) ;; FIXME! + '())))) (export gnc:owner-get-address) diff --git a/src/business/business-reports/aging.scm b/src/business/business-reports/aging.scm index 5ff9b0fa37..dde1e37d2b 100644 --- a/src/business/business-reports/aging.scm +++ b/src/business/business-reports/aging.scm @@ -543,7 +543,7 @@ totals to report currency") ;; set default title (gnc:html-document-set-title! document report-title) ;; maybe redefine better... - (if account + (if (not (null? account)) (begin (gnc:html-document-set-title! document (string-append report-title ": " (xaccAccountGetName account))) @@ -558,7 +558,7 @@ totals to report currency") (gnc:html-table-set-col-headers! table heading-list) - (if account + (if (not (null? account)) (begin (setup-query query account report-date) ;; get the appropriate splits diff --git a/src/business/business-reports/business-reports.scm b/src/business/business-reports/business-reports.scm index b8c165ba62..d23b299a67 100644 --- a/src/business/business-reports/business-reports.scm +++ b/src/business/business-reports/business-reports.scm @@ -90,7 +90,7 @@ (if ref (begin (set! ref (string-append ref (gncOwnerReturnGUID end-owner))) - (if acc + (if (not (null? acc)) (set! ref (string-append ref "&acct=" (gncAccountGetGUID acc)))) (gnc-build-url URL-TYPE-OWNERREPORT ref "")) diff --git a/src/business/business-reports/easy-invoice.scm b/src/business/business-reports/easy-invoice.scm index 151801ed1d..d65a0b4f5c 100644 --- a/src/business/business-reports/easy-invoice.scm +++ b/src/business/business-reports/easy-invoice.scm @@ -473,7 +473,7 @@ (add-subtotal-row table used-columns tax-collector "grand-total" (_ "Tax"))) - (if (and show-payments lot) + (if (and show-payments (not (null? lot))) (let ((splits (sort-list! (gnc-lot-get-split-list lot) (lambda (s1 s2) @@ -524,7 +524,7 @@ (gnc:gnc-monetary-amount (cdr entry-values))) (let ((order (gncEntryGetOrder current))) - (if order (add-order order))) + (if (not (null? order)) (add-order order))) (do-rows-with-subtotals rest table @@ -683,7 +683,7 @@ (if (and references? (not (member o orders))) (addto! orders o))) - (if invoice + (if (not (null? invoice)) (begin (set! owner (gncInvoiceGetOwner invoice)) (let ((type (gncOwnerGetType @@ -707,7 +707,7 @@ (add-html! document "") - (if invoice + (if (not (null? invoice)) (begin ; invoice number and ID String table (add-html! document "") diff --git a/src/business/business-reports/fancy-invoice.scm b/src/business/business-reports/fancy-invoice.scm index 2e201f45eb..ca9dbc0d59 100644 --- a/src/business/business-reports/fancy-invoice.scm +++ b/src/business/business-reports/fancy-invoice.scm @@ -500,7 +500,7 @@ (add-subtotal-row table used-columns tax-collector "grand-total" (_ "Tax"))) - (if (and show-payments lot) + (if (and show-payments (not (null? lot))) (let ((splits (sort-list! (gnc-lot-get-split-list lot) (lambda (s1 s2) @@ -552,7 +552,7 @@ (gnc:gnc-monetary-amount (cdr entry-values))) (let ((order (gncEntryGetOrder current))) - (if order (add-order order))) + (if (not (null? order)) (add-order order))) (set! entries-added (+ entries-added 1)) @@ -766,7 +766,7 @@ (if (and references? (not (member o orders))) (addto! orders o))) - (if invoice + (if (not (null? invoice)) (begin (set! owner (gncInvoiceGetOwner invoice)) (let ((type (gncOwnerGetType @@ -784,7 +784,7 @@ ;; invoice number moved below ;;(gnc:html-document-set-title! document title) - (if invoice + (if (not (null? invoice)) (let* ((book (gncInvoiceGetBook invoice)) (slots (gnc-book-get-slots book)) (date-object #f) diff --git a/src/business/business-reports/invoice.scm b/src/business/business-reports/invoice.scm index 45bc2215c9..2853565a33 100644 --- a/src/business/business-reports/invoice.scm +++ b/src/business/business-reports/invoice.scm @@ -636,7 +636,7 @@ (if (and references? (not (member o orders))) (addto! orders o))) - (if invoice + (if (not (null? invoice)) (begin (set! owner (gncInvoiceGetOwner invoice)) (let ((type (gncOwnerGetType @@ -653,7 +653,7 @@ (gnc:html-document-set-title! document title) - (if invoice + (if (not (null? invoice)) (let ((book (gncInvoiceGetBook invoice))) (set! table (make-entry-table invoice (gnc:report-options report-obj) diff --git a/src/business/business-reports/owner-report.scm b/src/business/business-reports/owner-report.scm index d24f4c4de5..a7b358828c 100644 --- a/src/business/business-reports/owner-report.scm +++ b/src/business/business-reports/owner-report.scm @@ -163,7 +163,7 @@ (begin (if reverse? (set! bal (gnc-numeric-neg bal))) - (if invoice + (if (not (null? invoice)) (begin (apply-invoice post-date bal)) (apply-payment bal)))))) @@ -202,7 +202,7 @@ (type-str (cond ((equal? type gnc:transaction-type-invoice) - (if invoice + (if (not (null? invoice)) (gnc:make-html-text (gnc:html-markup-anchor (gnc:invoice-anchor-text invoice) @@ -255,7 +255,7 @@ ))) ; Now print out the invoice row - (if invoice + (if (not (null? invoice)) (set! due-date (gncInvoiceGetDateDue invoice))) (let ((row (make-row date due-date (xaccTransGetNum txn) @@ -575,7 +575,7 @@ (gnc:owner-anchor-text owner) (gncOwnerGetName owner)))) - (if account + (if (not (null? account)) (begin (set! table (make-txn-table (gnc:report-options report-obj) query account start-date end-date)) @@ -709,7 +709,7 @@ (define (gnc:owner-report-create owner account) ; Figure out an account to use if nothing exists here. - (if (not account) + (if (null? account) (set! account (find-first-account-for-owner owner))) (owner-report-create owner account)) @@ -722,7 +722,7 @@ (owner (gnc:owner-from-split split temp-owner)) (res #f)) - (if owner + (if (not (null? owner)) (set! res (gnc:owner-report-create owner account))) (gncOwnerDestroy temp-owner) diff --git a/src/business/business-utils/business-options.scm b/src/business/business-utils/business-options.scm index f124fb28f9..c9717db988 100644 --- a/src/business/business-utils/business-options.scm +++ b/src/business/business-utils/business-options.scm @@ -61,7 +61,7 @@ (gnc:make-option section name sort-tag 'invoice documentation-string getter (lambda (invoice) ;; setter - (if (not invoice) (set! invoice (default-getter))) + (if (null? invoice) (set! invoice (default-getter))) (set! invoice (convert-to-invoice invoice)) (let* ((result (validator invoice)) (valid (car result)) @@ -122,7 +122,7 @@ (gnc:make-option section name sort-tag 'customer documentation-string getter (lambda (customer) - (if (not customer) (set! customer (default-getter))) + (if (null? customer) (set! customer (default-getter))) (set! customer (convert-to-customer customer)) (let* ((result (validator customer)) (valid (car result)) @@ -183,7 +183,7 @@ (gnc:make-option section name sort-tag 'vendor documentation-string getter (lambda (vendor) - (if (not vendor) (set! vendor (default-getter))) + (if (null? vendor) (set! vendor (default-getter))) (set! vendor (convert-to-vendor vendor)) (let* ((result (validator vendor)) (valid (car result)) @@ -244,7 +244,7 @@ (gnc:make-option section name sort-tag 'employee documentation-string getter (lambda (employee) - (if (not employee) (set! employee (default-getter))) + (if (null? employee) (set! employee (default-getter))) (set! employee (convert-to-employee employee)) (let* ((result (validator employee)) (valid (car result)) @@ -343,7 +343,7 @@ (gnc:make-option section name sort-tag 'owner documentation-string getter (lambda (owner) - (if (not owner) (set! owner (default-getter))) + (if (null? owner) (set! owner (default-getter))) (set! owner (convert-to-owner owner)) (let* ((result (validator owner)) (valid (car result)) @@ -410,7 +410,7 @@ (gnc:make-option section name sort-tag 'taxtable documentation-string getter (lambda (taxtable) - (if (not taxtable) (set! taxtable (default-getter))) + (if (null? taxtable) (set! taxtable (default-getter))) (set! taxtable (convert-to-taxtable taxtable)) (let* ((result (validator taxtable)) (valid (car result)) diff --git a/src/engine/engine-interface.scm b/src/engine/engine-interface.scm index b81790a142..1bd1e45985 100644 --- a/src/engine/engine-interface.scm +++ b/src/engine/engine-interface.scm @@ -111,7 +111,7 @@ ;; status and date are not copied. The C split's guid is, ;; of course, unchanged. (define (gnc:split-scm-onto-split split-scm split book) - (if (not split) + (if (null? split) #f (begin (let ((memo (gnc:split-scm-get-memo split-scm)) @@ -125,7 +125,7 @@ (let ((account (xaccAccountLookup (gnc:split-scm-get-account-guid split-scm) book))) - (if account + (if (not (null? account)) (begin (xaccAccountBeginEdit account) (xaccSplitSetAccount split account) diff --git a/src/import-export/qif-import/qif-guess-map.scm b/src/import-export/qif-import/qif-guess-map.scm index 95c5607668..0b8b80f2df 100644 --- a/src/import-export/qif-import/qif-guess-map.scm +++ b/src/import-export/qif-import/qif-guess-map.scm @@ -26,7 +26,7 @@ (define (qif-import:load-map-prefs) (define (extract-all-account-info agroup root-name) - (if (not agroup) + (if (null? agroup) '() (let ((children-list (xaccGroupGetAccountListSorted agroup)) (names '())) diff --git a/src/import-export/qif-import/qif-merge-groups.scm b/src/import-export/qif-import/qif-merge-groups.scm index 8c3bd94458..2803e75102 100644 --- a/src/import-export/qif-import/qif-merge-groups.scm +++ b/src/import-export/qif-import/qif-merge-groups.scm @@ -53,7 +53,7 @@ (lambda (xtn) (let ((query (qof-query-create-for-splits))) (set! work-done (+ 1 work-done)) - (if progress-dialog + (if (not (null? progress-dialog)) (begin (gnc-progress-dialog-set-value progress-dialog (/ work-done work-to-do)) @@ -132,7 +132,7 @@ new-xtns) ;; get rid of the progress dialog - (if progress-dialog + (if (not (null? progress-dialog)) (gnc-progress-dialog-destroy progress-dialog)) ;; return the matches diff --git a/src/import-export/qif-import/qif-to-gnc.scm b/src/import-export/qif-import/qif-to-gnc.scm index 33a493764c..71717d0457 100644 --- a/src/import-export/qif-import/qif-to-gnc.scm +++ b/src/import-export/qif-import/qif-to-gnc.scm @@ -38,13 +38,13 @@ #t)))) (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* ((test-name (string-append long-name (sprintf #f " %a" count))) (test-acct (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)) (string-append short-name (sprintf #f " %a" count))))) short-name)) @@ -53,7 +53,7 @@ ;; if the name is in use but the commodity, or type are ;; incompatible, we need to create a new account with a modified ;; name. - (if same-gnc-account + (if (and same-gnc-account (not (null? same-gnc-account))) (if (compatible? same-gnc-account) (begin ;; everything is ok, so we can just use the same @@ -77,7 +77,8 @@ ;; here, existing-account means a previously *created* account ;; (possibly a new account, possibly a copy of an existing gnucash ;; acct) - (if (and existing-account (compatible? existing-account)) + (if (and (and existing-account (not (null? existing-account))) + (compatible? existing-account)) existing-account (let ((new-acct (xaccMallocAccount (gnc-get-current-book))) (parent-acct #f) @@ -91,7 +92,7 @@ ;; if this is a copy of an existing gnc account, copy the ;; account properties. For incompatible existing accts, ;; we'll do something different later. - (if same-gnc-account + (if (and same-gnc-account (not (null? same-gnc-account))) (begin (xaccAccountSetName new-acct (xaccAccountGetName same-gnc-account)) @@ -156,7 +157,7 @@ (set! parent-acct (qif-import:find-or-make-acct pinfo #t default-currency #f default-currency gnc-acct-hash old-group new-group)))) - (if parent-acct + (if (and parent-acct (not (null? parent-acct))) (xaccAccountInsertSubAccount parent-acct new-acct) (xaccGroupInsertAccount new-group new-acct)) @@ -308,7 +309,7 @@ (let xloop ((xtn (car markable-xtns)) (rest (cdr markable-xtns))) (set! work-done (+ 1 work-done)) - (if progress-dialog + (if (not (null? progress-dialog)) (begin (gnc-progress-dialog-set-value progress-dialog (/ work-done work-to-do)) @@ -325,7 +326,7 @@ (for-each (lambda (xtn) (set! work-done (+ 1 work-done)) - (if progress-dialog + (if (not (null? progress-dialog)) (begin (gnc-progress-dialog-set-value progress-dialog (/ work-done work-to-do)) @@ -352,7 +353,7 @@ sorted-qif-files-list) ;; get rid of the progress dialog - (if progress-dialog + (if (not (null? progress-dialog)) (gnc-progress-dialog-destroy progress-dialog)) new-group)))) diff --git a/src/import-export/qif-io-core/qif-acct-table.scm b/src/import-export/qif-io-core/qif-acct-table.scm index a2552a3578..05b30cc650 100644 --- a/src/import-export/qif-io-core/qif-acct-table.scm +++ b/src/import-export/qif-io-core/qif-acct-table.scm @@ -59,7 +59,7 @@ (type (qif-io:account-type qif-acct)) (desc (qif-io:account-description qif-acct)) (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))) (xaccAccountBeginEdit gnc-acct) (if gnc-type @@ -73,7 +73,7 @@ (hash-fold (lambda (name acct p) (let ((cmdty (xaccAccountGetCommodity acct))) - (if (not cmdty) + (if (null? cmdty) (begin (xaccAccountBeginEdit acct) (xaccAccountSetCommodity acct commodity) @@ -94,7 +94,7 @@ (income? (qif-io:category-income-cat qif-cat)) (desc (qif-io:category-description qif-cat)) (gnc-acct (hash-ref qif-cat-table name))) - (if gnc-acct + (if (and gnc-acct (not (null? gnc-acct))) (begin (xaccAccountBeginEdit gnc-acct) (cond (income? diff --git a/src/report/locale-specific/us/taxtxf-de_DE.scm b/src/report/locale-specific/us/taxtxf-de_DE.scm index 3e8a25d7b7..2c5efd7db2 100644 --- a/src/report/locale-specific/us/taxtxf-de_DE.scm +++ b/src/report/locale-specific/us/taxtxf-de_DE.scm @@ -660,7 +660,7 @@ (to-special #f) ; clear special-splits-period (from-special #f) (childrens-output - (if (not children) + (if (null? children) (let* ((splits-period (txf-special-splits-period account from-value to-value))) (if splits-period @@ -736,7 +736,7 @@ (if tax-mode? (list level-x-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 level-x-output childrens-output))))))) ;; Ignore diff --git a/src/report/locale-specific/us/taxtxf.scm b/src/report/locale-specific/us/taxtxf.scm index c7d78d90d4..083b522f74 100644 --- a/src/report/locale-specific/us/taxtxf.scm +++ b/src/report/locale-specific/us/taxtxf.scm @@ -637,7 +637,7 @@ (to-special #f) ; clear special-splits-period (from-special #f) (childrens-output - (if (not children) + (if (null? children) (let* ((splits-period (txf-special-splits-period account from-value to-value))) (if splits-period @@ -713,7 +713,7 @@ (if tax-mode? (list level-x-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 level-x-output childrens-output))))))) ;; Ignore diff --git a/src/report/report-gnome/report-gnome.scm b/src/report/report-gnome/report-gnome.scm index 771c216b64..ce3af4dc14 100644 --- a/src/report/report-gnome/report-gnome.scm +++ b/src/report/report-gnome/report-gnome.scm @@ -34,7 +34,7 @@ ;; instead, this function's side-effect is to set the report's editor widget. (define (gnc:report-edit-options 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) (begin (if (gnc:report-options report) diff --git a/src/report/report-system/gnc-report.h b/src/report/report-system/gnc-report.h index d501b5b2cd..edaa9a4c2f 100644 --- a/src/report/report-system/gnc-report.h +++ b/src/report/report-system/gnc-report.h @@ -38,6 +38,7 @@ gboolean gnc_run_report_id_string (const char * id_string, char **data); **/ gchar* gnc_report_name( SCM report ); +/* returns #f if the report id cannot be found */ SCM gnc_report_find(gint id); void gnc_report_remove_by_id(gint id); gint gnc_report_add(SCM report); diff --git a/src/report/report-system/html-utilities.scm b/src/report/report-system/html-utilities.scm index 0648de66a5..d334b1e5d6 100644 --- a/src/report/report-system/html-utilities.scm +++ b/src/report/report-system/html-utilities.scm @@ -78,14 +78,14 @@ ;; returns the account name as html-text and anchor to the register. (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:account-anchor-text acct) (xaccAccountGetName acct)) ""))) (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:split-anchor-text split) text) diff --git a/src/report/standard-reports/cash-flow.scm b/src/report/standard-reports/cash-flow.scm index c14bf61f54..554834dfde 100644 --- a/src/report/standard-reports/cash-flow.scm +++ b/src/report/standard-reports/cash-flow.scm @@ -185,7 +185,7 @@ (define (account-get-depth account) (define (account-get-depth-internal account-internal depth) (let ((parent (xaccAccountGetParentAccount account-internal))) - (if parent + (if (not (null? parent)) (account-get-depth-internal parent (+ depth 1)) depth))) (account-get-depth-internal account 1)) diff --git a/src/report/standard-reports/register.scm b/src/report/standard-reports/register.scm index 0b73e1018a..d0fa1b1392 100644 --- a/src/report/standard-reports/register.scm +++ b/src/report/standard-reports/register.scm @@ -116,7 +116,7 @@ (define (gnc:split-get-balance-display split) (let ((account (xaccSplitGetAccount split)) (balance (xaccSplitGetBalance split))) - (if (and account (gnc-reverse-balance account)) + (if (and (not (null? account)) (gnc-reverse-balance account)) (gnc-numeric-neg balance) balance))) @@ -125,7 +125,7 @@ (let* ((row-contents '()) (parent (xaccSplitGetParent split)) (account (xaccSplitGetAccount split)) - (currency (if account + (currency (if (not (null? account)) (xaccAccountGetCommodity account) (gnc-default-currency))) (damount (xaccSplitGetAmount split)) @@ -157,7 +157,7 @@ (if transaction-info? (let ((other-split (xaccSplitGetOtherSplit split))) - (if other-split + (if (not (null? other-split)) (gnc-account-get-full-name (xaccSplitGetAccount other-split)) (_ "-- Split Transaction --"))) @@ -343,7 +343,7 @@ (define (display-subtotal monetary) (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) monetary) (if (gnc-numeric-negative-p (gnc:gnc-monetary-amount monetary)) @@ -453,11 +453,11 @@ (define (splits-leader splits) (let ((accounts (map xaccSplitGetAccount splits))) - (if (null? accounts) #f + (if (null? accounts) '() (begin (set! accounts (cons (car accounts) (delete (car accounts) (cdr accounts)))) - (if (not (null? (cdr accounts))) #f + (if (not (null? (cdr accounts))) '() (car accounts)))))) (let* ((table (gnc:make-html-table)) diff --git a/src/report/standard-reports/standard-reports.scm b/src/report/standard-reports/standard-reports.scm index 943b1e0add..191e046c66 100644 --- a/src/report/standard-reports/standard-reports.scm +++ b/src/report/standard-reports/standard-reports.scm @@ -61,7 +61,7 @@ (gnc:debug "hash: " gnc:*register-report-hash*) (gnc:debug "split: " split) (if type-info - (if split + (if (not (null? split)) (begin (gnc:debug "get-split...") (get-split type-info)) (begin (gnc:debug "get-non-split...") (get-non-split type-info))) #f))) diff --git a/src/scm/printing/print-check.scm b/src/scm/printing/print-check.scm index 7779c61875..d2ce203511 100644 --- a/src/scm/printing/print-check.scm +++ b/src/scm/printing/print-check.scm @@ -108,7 +108,7 @@ (payee-stub-text "") (memo-stub-text "")) - (if ps + (if (not (null? ps)) (begin (if (not (eq? (print-check-format:format format-info) 'custom)) (begin