[html-acct-table] modernise to srfi-9 records

This commit is contained in:
Christopher Lam 2019-08-12 21:15:45 +08:00
parent 81b20d0a62
commit a42f1211d8

View File

@ -495,6 +495,8 @@
;; user. This class simply maps its contents to the html-table. ;; user. This class simply maps its contents to the html-table.
;; ;;
(use-modules (srfi srfi-9))
;; this is to work around a bug in the HTML export sytmem ;; this is to work around a bug in the HTML export sytmem
;; which causes COLSPAN= attributes not to be exported (!!) ;; which causes COLSPAN= attributes not to be exported (!!)
(define gnc:colspans-are-working-right (define gnc:colspans-are-working-right
@ -506,23 +508,14 @@
;; utility class for generating account tables ;; utility class for generating account tables
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define <html-acct-table> (define-record-type <html-acct-table>
(make-record-type "<html-acct-table>" (gnc:_make-html-acct-table_ matrix env)
'(matrix ;; an html-table gnc:html-acct-table?
env ;; an alist (matrix gnc:_html-acct-table-matrix_ gnc:_html-acct-table-set-matrix!_)
))) (env gnc:_html-acct-table-env_ gnc:_html-acct-table-set-env!_))
(define gnc:html-acct-table?
(record-predicate <html-acct-table>))
(define gnc:_make-html-acct-table_
(record-constructor <html-acct-table>))
(define (gnc:make-html-acct-table) (define (gnc:make-html-acct-table)
(gnc:_make-html-acct-table_ (gnc:_make-html-acct-table_ (gnc:make-html-table) #f))
(gnc:make-html-table) ;; matrix
#f ;; env
))
(define (gnc:make-html-acct-table/env env) (define (gnc:make-html-acct-table/env env)
(let ((acct-table (gnc:make-html-acct-table))) (let ((acct-table (gnc:make-html-acct-table)))
@ -538,18 +531,6 @@
(gnc:html-acct-table-add-accounts! acct-table accts) (gnc:html-acct-table-add-accounts! acct-table accts)
acct-table)) acct-table))
(define gnc:_html-acct-table-matrix_
(record-accessor <html-acct-table> 'matrix))
(define gnc:_html-acct-table-set-matrix!_
(record-modifier <html-acct-table> 'matrix))
(define gnc:_html-acct-table-env_
(record-accessor <html-acct-table> 'env))
(define gnc:_html-acct-table-set-env!_
(record-modifier <html-acct-table> 'env))
;; some useful predicates to export ;; some useful predicates to export
(define (gnc:account-code-less-p a b) (define (gnc:account-code-less-p a b)
(string<? (xaccAccountGetCode a) (string<? (xaccAccountGetCode a)