From a42f1211d885e3db147781ef7e3f43f3a9ef09fa Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Mon, 12 Aug 2019 21:15:45 +0800 Subject: [PATCH] [html-acct-table] modernise to srfi-9 records --- .../report/report-system/html-acct-table.scm | 35 +++++-------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/gnucash/report/report-system/html-acct-table.scm b/gnucash/report/report-system/html-acct-table.scm index 1cf5a4d635..f67129c47b 100644 --- a/gnucash/report/report-system/html-acct-table.scm +++ b/gnucash/report/report-system/html-acct-table.scm @@ -495,6 +495,8 @@ ;; 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 ;; which causes COLSPAN= attributes not to be exported (!!) (define gnc:colspans-are-working-right @@ -506,23 +508,14 @@ ;; utility class for generating account tables ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(define - (make-record-type "" - '(matrix ;; an html-table - env ;; an alist - ))) - -(define gnc:html-acct-table? - (record-predicate )) - -(define gnc:_make-html-acct-table_ - (record-constructor )) +(define-record-type + (gnc:_make-html-acct-table_ matrix env) + gnc:html-acct-table? + (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:make-html-acct-table) - (gnc:_make-html-acct-table_ - (gnc:make-html-table) ;; matrix - #f ;; env - )) + (gnc:_make-html-acct-table_ (gnc:make-html-table) #f)) (define (gnc:make-html-acct-table/env env) (let ((acct-table (gnc:make-html-acct-table))) @@ -538,18 +531,6 @@ (gnc:html-acct-table-add-accounts! acct-table accts) acct-table)) -(define gnc:_html-acct-table-matrix_ - (record-accessor 'matrix)) - -(define gnc:_html-acct-table-set-matrix!_ - (record-modifier 'matrix)) - -(define gnc:_html-acct-table-env_ - (record-accessor 'env)) - -(define gnc:_html-acct-table-set-env!_ - (record-modifier 'env)) - ;; some useful predicates to export (define (gnc:account-code-less-p a b) (string