gnucash maint: Multiple changes pushed
Christopher Lam
clam at code.gnucash.org
Tue Nov 19 06:37:22 EST 2019
Updated via https://github.com/Gnucash/gnucash/commit/eea5ac98 (commit)
via https://github.com/Gnucash/gnucash/commit/9bb2e4a2 (commit)
via https://github.com/Gnucash/gnucash/commit/fbc7c902 (commit)
from https://github.com/Gnucash/gnucash/commit/043abcb4 (commit)
commit eea5ac98c0330995706225f2a8f8ba62a5390d51
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Tue Nov 19 19:11:55 2019 +0800
[stylesheet-plain][html5] omit <h3></h3> when headline is empty.
We compare headline with "", rather than test (string-null? headline),
because headline may be either a string or a complex gnc:html-text
object.
diff --git a/gnucash/report/stylesheets/stylesheet-plain.scm b/gnucash/report/stylesheets/stylesheet-plain.scm
index 6cb790942..16bf0b513 100644
--- a/gnucash/report/stylesheets/stylesheet-plain.scm
+++ b/gnucash/report/stylesheets/stylesheet-plain.scm
@@ -213,7 +213,7 @@
(let ((headline (or (gnc:html-document-headline doc)
(gnc:html-document-title doc))))
- (if headline
+ (if (and headline (not (equal? headline "")))
(gnc:html-document-add-object!
ssdoc
(gnc:make-html-text
commit 9bb2e4a21af7a85693474cf51ed7bb9423a6ab4e
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Tue Nov 19 19:10:43 2019 +0800
[html-fonts][html5] add html,body height 100vh
This CSS rule allows children elements (such as <canvas>) to inherit
100% viewport height for displaying full-screen charts. This is
necessary for standards-mode.
https://quirks.spec.whatwg.org/#the-html-element-fills-the-viewport-quirk
diff --git a/gnucash/report/report-system/html-fonts.scm b/gnucash/report/report-system/html-fonts.scm
index 151fb3418..c74b8550a 100644
--- a/gnucash/report/report-system/html-fonts.scm
+++ b/gnucash/report/report-system/html-fonts.scm
@@ -137,6 +137,7 @@
"body, p, table, tr, td { vertical-align: top; " text-cell-info " }\n"
"tr.alternate-row { background: " alternate-row-color " }\n"
"tr { page-break-inside: avoid !important;}\n"
+ "html, body { height: 100vh; margin: 0; }\n"
"td, th { border-color: grey }\n"
"th.column-heading-left { text-align: left; " number-header-info " }\n"
"th.column-heading-center { text-align: center; " number-header-info " }\n"
commit fbc7c9027ed49e8311fc37800499753a70840ab8
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Mon Nov 18 21:19:50 2019 +0800
[scm/utilities] even more efficient list-flatten functions
because:
* list? is O(N), because it needs to test for an improper
list. improper lists are lists whose last pair's cdr cell is not
'(). null? and pair? are both O(1).
* avoids reverse which is also O(N): guile has unlimited stack
therefore we can do non-tail-call loop first to pass as parameter to
the tail-call loop. this removes the need for prepend-and-reverse.
diff --git a/gnucash/report/report-system/html-document.scm b/gnucash/report/report-system/html-document.scm
index baf0c6aec..a9c6b162d 100644
--- a/gnucash/report/report-system/html-document.scm
+++ b/gnucash/report/report-system/html-document.scm
@@ -107,7 +107,8 @@
(define (gnc:html-document-tree-collapse . tree)
(let lp ((e tree) (accum '()))
- (cond ((list? e) (fold lp accum e))
+ (cond ((null? e) accum)
+ ((pair? e) (fold lp accum e))
((string? e) (cons e accum))
(else (cons (object->string e) accum)))))
diff --git a/libgnucash/scm/utilities.scm b/libgnucash/scm/utilities.scm
index 4bdc61ed8..4fcf60b82 100644
--- a/libgnucash/scm/utilities.scm
+++ b/libgnucash/scm/utilities.scm
@@ -212,14 +212,14 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; flattens an arbitrary deep nested list into simple list. this is
;; probably the most efficient algorithm available. '(1 2 (3 4)) -->
-;; '(1 2 3 4)
+;; '(1 2 3 4) thanks to manumanumanu on #guile
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (gnc:list-flatten . lst)
- (reverse
- (let lp ((e lst) (accum '()))
- (if (list? e)
- (fold lp accum e)
- (cons e accum)))))
+ (let loop ((lst lst) (acc '()))
+ (cond
+ ((null? lst) acc)
+ ((pair? lst) (loop (car lst) (loop (cdr lst) acc)))
+ (else (cons lst acc)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; compatibility hack for fixing guile-2.0 string handling. this code
Summary of changes:
gnucash/report/report-system/html-document.scm | 3 ++-
gnucash/report/report-system/html-fonts.scm | 1 +
gnucash/report/stylesheets/stylesheet-plain.scm | 2 +-
libgnucash/scm/utilities.scm | 12 ++++++------
4 files changed, 10 insertions(+), 8 deletions(-)
More information about the gnucash-changes
mailing list