gnucash maint: Multiple changes pushed
Christopher Lam
clam at code.gnucash.org
Fri Jun 21 11:41:44 EDT 2019
Updated via https://github.com/Gnucash/gnucash/commit/03d9bf90 (commit)
via https://github.com/Gnucash/gnucash/commit/7b5ff8d8 (commit)
via https://github.com/Gnucash/gnucash/commit/7c9145a7 (commit)
from https://github.com/Gnucash/gnucash/commit/3731c84f (commit)
commit 03d9bf902a74d0b8e2a3dc5f1a178583a4993c89
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Thu Jun 20 22:55:05 2019 +0800
[html-acct-table] compact gnc:html-make-nbsps
avoid repeatedly string-append
diff --git a/gnucash/report/report-system/html-acct-table.scm b/gnucash/report/report-system/html-acct-table.scm
index 1e5f27bd6..e67f9f599 100644
--- a/gnucash/report/report-system/html-acct-table.scm
+++ b/gnucash/report/report-system/html-acct-table.scm
@@ -1058,9 +1058,10 @@
;;
(define (gnc:html-make-nbsps n)
- (if (> n 0)
- (string-append " " (gnc:html-make-nbsps (- n 1)))
- ""))
+ (let lp ((n n) (res '()))
+ (if (positive? n)
+ (lp (1- n) (cons " " res))
+ (string-join res ""))))
;; Stylesheets define the following cell styles which these functions
;; use: "text-cell" "total-label-cell" "number-cell"
commit 7b5ff8d894f84c5355d717d0816a98b7c820f57f
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Thu Jun 20 19:25:35 2019 +0800
[html-acct-table] compact gnc-commodity-table
diff --git a/gnucash/report/report-system/html-acct-table.scm b/gnucash/report/report-system/html-acct-table.scm
index b013351df..1e5f27bd6 100644
--- a/gnucash/report/report-system/html-acct-table.scm
+++ b/gnucash/report/report-system/html-acct-table.scm
@@ -1135,29 +1135,21 @@
;; be a bit redundant, i beleive that it makes the report more
;; readable.
(let* ((table (gnc:make-html-table))
- )
- (amount
- 'format
- (lambda (curr val)
- (let ((bal (gnc:make-gnc-monetary curr val)))
- (gnc:html-table-append-row!
- table
- (list
- ;; add the account balance in the respective commodity
- (gnc:make-html-table-cell/markup
- "number-cell" bal)
- (let ((spacer (gnc:make-html-table-cell)))
- (gnc:html-table-cell-set-style!
- spacer "td" 'attribute (list "style" "min-width: 1em"))
- spacer)
- ;; add the account balance in the report commodity
- (gnc:make-html-table-cell/markup
- "number-cell" (exchange-fn bal report-commodity))
- )
- )
- ))
- #f)
- (gnc:html-table-set-style! table "table" 'attribute(list "style" "width:100%; max-width:20em") 'attribute (list "cellpadding" "0"))
+ (spacer (gnc:make-html-table-cell))
+ (list-of-balances (amount 'format gnc:make-gnc-monetary #f)))
+ (gnc:html-table-cell-set-style! spacer "td"
+ 'attribute (list "style" "min-width: 1em"))
+ (for-each
+ (lambda (bal)
+ (gnc:html-table-append-row!
+ table (list (gnc:make-html-table-cell/markup "number-cell" bal)
+ spacer
+ (gnc:make-html-table-cell/markup
+ "number-cell" (exchange-fn bal report-commodity)))))
+ list-of-balances)
+ (gnc:html-table-set-style! table "table"
+ 'attribute (list "style" "width:100%; max-width:20em")
+ 'attribute (list "cellpadding" "0"))
table))
;;
commit 7c9145a711dac54c24fef044723a243724c82676
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Fri Jun 21 20:35:12 2019 +0800
Set the summarybar currency to default_currency
diff --git a/gnucash/gnome-utils/window-main-summarybar.c b/gnucash/gnome-utils/window-main-summarybar.c
index aa564663e..9262bded3 100644
--- a/gnucash/gnome-utils/window-main-summarybar.c
+++ b/gnucash/gnome-utils/window-main-summarybar.c
@@ -359,10 +359,10 @@ gnc_main_window_summary_refresh (GNCMainSummary * summary)
root = gnc_get_current_root_account ();
- options.default_currency = xaccAccountGetCommodity(root);
+ options.default_currency = gnc_default_currency ();
if (options.default_currency == NULL)
{
- options.default_currency = gnc_default_currency ();
+ options.default_currency = xaccAccountGetCommodity(root);
}
options.grand_total =
Summary of changes:
gnucash/gnome-utils/window-main-summarybar.c | 4 +--
gnucash/report/report-system/html-acct-table.scm | 45 ++++++++++--------------
2 files changed, 21 insertions(+), 28 deletions(-)
More information about the gnucash-changes
mailing list