mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-24 18:00:31 -06:00
[report-utilities] centralise gnc:not-all-zeros
it is used by old chart module *and* reports
This commit is contained in:
parent
d2f1cc0e37
commit
424676c31a
@ -249,17 +249,6 @@
|
||||
(set! rownum (+ 1 rownum)))
|
||||
newcol)))
|
||||
|
||||
(define (gnc:not-all-zeros data)
|
||||
(define (myor list)
|
||||
(begin
|
||||
(gnc:debug "list" list)
|
||||
(if (null? list) #f
|
||||
(or (car list) (myor (cdr list))))))
|
||||
|
||||
(cond ((number? data) (not (= 0 data)))
|
||||
((list? data) (myor (map gnc:not-all-zeros data)))
|
||||
(else #f)))
|
||||
|
||||
(define (gnc:html-barchart-prepend-column! barchart newcol)
|
||||
(let ((rows (gnc:html-barchart-data barchart))
|
||||
(this-row #f)
|
||||
|
@ -304,17 +304,6 @@
|
||||
(set! rownum (+ 1 rownum)))
|
||||
newcol)))
|
||||
|
||||
(define (gnc:not-all-zeros data)
|
||||
(define (myor list)
|
||||
(begin
|
||||
(gnc:debug "list" list)
|
||||
(if (null? list) #f
|
||||
(or (car list) (myor (cdr list))))))
|
||||
|
||||
(cond ((number? data) (not (= 0 data)))
|
||||
((list? data) (myor (map gnc:not-all-zeros data)))
|
||||
(else #f)))
|
||||
|
||||
(define (gnc:html-linechart-prepend-column! linechart newcol)
|
||||
(let ((rows (gnc:html-linechart-data linechart))
|
||||
(this-row #f)
|
||||
|
@ -151,14 +151,6 @@
|
||||
(define gnc:html-piechart-set-button-3-legend-urls!
|
||||
(record-modifier <html-piechart> 'button-3-legend-urls))
|
||||
|
||||
(define (gnc:not-all-zeros data)
|
||||
(define (myor list)
|
||||
(if (null? list) #f
|
||||
(or (car list) (myor (cdr list)))))
|
||||
(cond ((number? data) (not (= 0 data)))
|
||||
((list? data) (myor (map gnc:not-all-zeros data)))
|
||||
(else #f)))
|
||||
|
||||
(define (gnc:html-piechart-render piechart doc)
|
||||
(let* ((chart (gnc:make-html-chart))
|
||||
(title (gnc:html-piechart-title piechart))
|
||||
|
@ -132,14 +132,6 @@
|
||||
scatter
|
||||
(cons newpoint (gnc:html-scatter-data scatter)))))
|
||||
|
||||
(define (gnc:not-all-zeros data)
|
||||
(define (myor list)
|
||||
(if (null? list) #f
|
||||
(or (car list) (myor (cdr list)))))
|
||||
(cond ((number? data) (not (= 0 data)))
|
||||
((list? data) (myor (map gnc:not-all-zeros data)))
|
||||
(else #f)))
|
||||
|
||||
;; The Renderer
|
||||
(define (gnc:html-scatter-render scatter doc)
|
||||
(let* ((chart (gnc:make-html-chart))
|
||||
|
@ -974,6 +974,12 @@ query instead.")
|
||||
|
||||
;; ***************************************************************************
|
||||
|
||||
(define (gnc:not-all-zeros data)
|
||||
(cond
|
||||
((number? data) (not (= 0 data)))
|
||||
((pair? data) (any gnc:not-all-zeros data))
|
||||
(else #f)))
|
||||
|
||||
;; Adds "file:///" to the beginning of a URL if it doesn't already exist
|
||||
;;
|
||||
;; @param url URL
|
||||
|
Loading…
Reference in New Issue
Block a user