gnucash maint: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Mon Aug 19 09:00:54 EDT 2019


Updated	 via  https://github.com/Gnucash/gnucash/commit/0a3fd598 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/416e7f7e (commit)
	 via  https://github.com/Gnucash/gnucash/commit/b3ff04ee (commit)
	 via  https://github.com/Gnucash/gnucash/commit/bd9edbbb (commit)
	 via  https://github.com/Gnucash/gnucash/commit/bf7d121e (commit)
	from  https://github.com/Gnucash/gnucash/commit/99c69023 (commit)



commit 0a3fd5984e53b8c8e588c4a0af733343eef4762e
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sun Aug 18 23:36:02 2019 +0800

    [general-journal] deprecate the journal report generator
    
    it is unused.

diff --git a/gnucash/report/standard-reports/general-journal.scm b/gnucash/report/standard-reports/general-journal.scm
index 5babfd861..3600b62ee 100644
--- a/gnucash/report/standard-reports/general-journal.scm
+++ b/gnucash/report/standard-reports/general-journal.scm
@@ -41,6 +41,7 @@
 ;; report constructor
 
 (define (gnc:make-general-journal-report)
+  (issue-deprecation-warning "gnc:make-general-journal-report is unused.")
   (let* ((regrpt (gnc:make-report regrptguid)))
     regrpt))
 

commit 416e7f7e5eabeaf70bc851f08347d5d43599cbd9
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sun Aug 18 23:29:17 2019 +0800

    [general-journal] set document title after rendering
    
    Instead of setting document <title> register.scm's General/Title
    option, set it in the document returned by register.scm's
    renderer. This is in anticipation of "General"/"Title" option in
    register.scm being removed.

diff --git a/gnucash/report/standard-reports/general-journal.scm b/gnucash/report/standard-reports/general-journal.scm
index 23e3cb7c0..5babfd861 100644
--- a/gnucash/report/standard-reports/general-journal.scm
+++ b/gnucash/report/standard-reports/general-journal.scm
@@ -90,14 +90,7 @@
       )
      )
     ;; we'll leave query malloc'd in case this is required by the C side...
-    
-    ;; set options in the general tab...
-    (set-option!
-     gnc:pagename-general (N_ "Title") (_ reportname))
-    ;; we can't (currently) set the Report name here
-    ;; because it is automatically set to the template
-    ;; name... :(
-    
+
     ;; set options in the display tab...
     (for-each
      (lambda (l)
@@ -126,7 +119,10 @@
 
 (define (general-journal-renderer report-obj)
   ;; just delegate rendering to the Register Report renderer...
-  ((gnc:report-template-renderer/report-guid regrptguid regrptname) report-obj))
+  (let* ((renderer (gnc:report-template-renderer/report-guid regrptguid #f))
+         (doc (renderer report-obj)))
+    (gnc:html-document-set-title! doc (_ reportname))
+    doc))
 
 (gnc:define-report 
  'version 1

commit b3ff04eedc989080b4f73244bb01edbb81f6a83f
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sun Aug 18 14:37:45 2019 +0800

    [balsheet-pnl] reuse i18n strings

diff --git a/gnucash/report/standard-reports/balsheet-pnl.scm b/gnucash/report/standard-reports/balsheet-pnl.scm
index 5bf1c2f98..8e9afe25e 100644
--- a/gnucash/report/standard-reports/balsheet-pnl.scm
+++ b/gnucash/report/standard-reports/balsheet-pnl.scm
@@ -879,10 +879,10 @@ also show overall period profit & loss."))
            (lambda ()
              (display report-title)
              (display " ")
-             (when (or incr (eq? report-type 'pnl))
-               (display (qof-print-date startdate))
-               (display (_ " to ")))
-             (display (qof-print-date enddate)))))
+             (if (or incr (eq? report-type 'pnl))
+                 (format #t (_ "~a to ~a")
+                         (qof-print-date startdate) (qof-print-date enddate))
+                 (qof-print-date enddate)))))
 
     (if (eq? (get-option gnc:pagename-general optname-options-summary) 'always)
         (gnc:html-document-add-object!
@@ -1057,9 +1057,9 @@ also show overall period profit & loss."))
          multicol-table-right (_ "Equity")
          (append equity-accounts
                  (list
-                  (vector "Unrealized Gains"
+                  (vector (_ "Unrealized Gains")
                           unrealized-gain-fn)
-                  (vector "Retained Earnings"
+                  (vector (_ "Retained Earnings")
                           retained-earnings-fn)))
          #:negate-amounts? #t)
 
@@ -1074,7 +1074,7 @@ also show overall period profit & loss."))
             (gnc:html-document-add-object!
              doc
              (gnc:make-html-text
-              (gnc:html-markup-anchor chart "Barchart"))))))
+              (gnc:html-markup-anchor chart (_ "Barchart")))))))
 
      ((eq? report-type 'pnl)
       (let* ((closing-str (get-option pagename-entries optname-closing-pattern))

commit bd9edbbbf68c39f486d2fe17bf06c06761fc7a3e
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Fri Aug 16 09:32:56 2019 +0800

    Bug 797279 - Reports RTL do not support RTL - fix string
    
    fix guile-2.0 string handling to prevent munging unicode in
    report-titles etc. while loading/saving reports

diff --git a/libgnucash/scm/utilities.scm b/libgnucash/scm/utilities.scm
index 83a0ab139..105f49341 100644
--- a/libgnucash/scm/utilities.scm
+++ b/libgnucash/scm/utilities.scm
@@ -194,3 +194,53 @@
      ((null? (cdr lst)) (reverse (cons (car lst) result)))
      ((= (car lst) (cadr lst)) (lp (cdr lst) result))
      (else (lp (cdr lst) (cons (car lst) result))))))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; compatibility hack for fixing guile-2.0 string handling. this code
+;; may be removed when minimum guile is 2.2 or later. see
+;; https://lists.gnu.org/archive/html/guile-user/2019-04/msg00012.html
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(when (string=? (effective-version) "2.0")
+  ;; When using Guile 2.0.x, use monkey patching to change the
+  ;; behavior of string ports to use UTF-8 as the internal encoding.
+  ;; Note that this is the default behavior in Guile 2.2 or later.
+  (let* ((mod                     (resolve-module '(guile)))
+         (orig-open-input-string  (module-ref mod 'open-input-string))
+         (orig-open-output-string (module-ref mod 'open-output-string))
+         (orig-object->string     (module-ref mod 'object->string))
+         (orig-simple-format      (module-ref mod 'simple-format)))
+
+    (define (open-input-string str)
+      (with-fluids ((%default-port-encoding "UTF-8"))
+        (orig-open-input-string str)))
+
+    (define (open-output-string)
+      (with-fluids ((%default-port-encoding "UTF-8"))
+        (orig-open-output-string)))
+
+    (define (object->string . args)
+      (with-fluids ((%default-port-encoding "UTF-8"))
+        (apply orig-object->string args)))
+
+    (define (simple-format . args)
+      (with-fluids ((%default-port-encoding "UTF-8"))
+        (apply orig-simple-format args)))
+
+    (define (call-with-input-string str proc)
+      (proc (open-input-string str)))
+
+    (define (call-with-output-string proc)
+      (let ((port (open-output-string)))
+        (proc port)
+        (get-output-string port)))
+
+    (module-set! mod 'open-input-string       open-input-string)
+    (module-set! mod 'open-output-string      open-output-string)
+    (module-set! mod 'object->string          object->string)
+    (module-set! mod 'simple-format           simple-format)
+    (module-set! mod 'call-with-input-string  call-with-input-string)
+    (module-set! mod 'call-with-output-string call-with-output-string)
+
+    (when (eqv? (module-ref mod 'format) orig-simple-format)
+      (module-set! mod 'format simple-format))))

commit bf7d121e27ca98de9c6352350cf631f64996bd16
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Thu Aug 15 23:07:51 2019 +0800

    Bug 797279 - Reports RTL do not support RTL - fix reports

diff --git a/gnucash/report/business-reports/balsheet-eg.css b/gnucash/report/business-reports/balsheet-eg.css
index 83d6d5b43..5a8d4b8e2 100644
--- a/gnucash/report/business-reports/balsheet-eg.css
+++ b/gnucash/report/business-reports/balsheet-eg.css
@@ -26,11 +26,9 @@
     width: 1em;
   }
   td.accname {
-    text-align: left;
     vertical-align: top;
   }
   td.accnametotal {
-    text-align: left;
     vertical-align: top;
     font-weight: bold;
   }
diff --git a/gnucash/report/business-reports/balsheet-eg.eguile.scm b/gnucash/report/business-reports/balsheet-eg.eguile.scm
index e4ab987f3..23cd32e3c 100644
--- a/gnucash/report/business-reports/balsheet-eg.eguile.scm
+++ b/gnucash/report/business-reports/balsheet-eg.eguile.scm
@@ -125,7 +125,7 @@
 ?>
 
 <!-- The HTML starts here... -->
-<html>
+<html dir='auto'>
 <head>
 <meta http-equiv="content-type" content="text-html; charset=utf-8">
 <title><?scm:d coyname ?> <?scm:d opt-report-title ?> <?scm:d (qof-print-date opt-date) ?></title>
diff --git a/gnucash/report/business-reports/receipt.eguile.scm b/gnucash/report/business-reports/receipt.eguile.scm
index 155b42dcd..6097384c1 100644
--- a/gnucash/report/business-reports/receipt.eguile.scm
+++ b/gnucash/report/business-reports/receipt.eguile.scm
@@ -103,7 +103,7 @@
 
 <!-- ====================================================================== -->
 <!-- The HTML for the invoice starts here -->
-<html>
+<html dir='auto'>
 <head>
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
 <title><?scm:d (_ "Invoice") ?> <?scm:d invoiceid ?></title>
diff --git a/gnucash/report/business-reports/taxinvoice.eguile.scm b/gnucash/report/business-reports/taxinvoice.eguile.scm
index 9a8036273..1a14bc508 100644
--- a/gnucash/report/business-reports/taxinvoice.eguile.scm
+++ b/gnucash/report/business-reports/taxinvoice.eguile.scm
@@ -125,7 +125,7 @@
 
 <!-- ====================================================================== -->
 <!-- The HTML for the invoice starts here -->
-<html>
+<html dir='auto'>
 <head>
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
 <title><?scm:d (_ "Invoice") ?> <?scm:d invoiceid ?></title>
diff --git a/gnucash/report/report-system/html-document.scm b/gnucash/report/report-system/html-document.scm
index f7124f6bd..ecb045e2c 100644
--- a/gnucash/report/report-system/html-document.scm
+++ b/gnucash/report/report-system/html-document.scm
@@ -150,7 +150,7 @@
             ;;./share/gnucash/scm/gnucash/report/taxinvoice.eguile.scm:<html>
             ;;./share/gnucash/scm/gnucash/report/balsheet-eg.eguile.scm:<html>
 
-            (push "<html>\n")
+            (push "<html dir='auto'>\n")
             (push "<head>\n")
             (push "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n")
             (if style-text
diff --git a/gnucash/report/report-system/html-fonts.scm b/gnucash/report/report-system/html-fonts.scm
index e9ea98f35..eb30fe726 100644
--- a/gnucash/report/report-system/html-fonts.scm
+++ b/gnucash/report/report-system/html-fonts.scm
@@ -140,7 +140,7 @@
             (string-append
                 "h3 { " title-font-info " }\n"
                 "a { " account-link-font-info " }\n"
-                "body, p, table, tr, td { text-align: left; vertical-align: top; " text-cell-font-info " }\n"
+                "body, p, table, tr, td { vertical-align: top; " text-cell-font-info " }\n"
                 "tr.alternate-row { background: " alternate-row-color " }\n"
                 "tr { page-break-inside: avoid !important;}\n"
                 "th.column-heading-left { text-align: left; " number-header-font-info " }\n"
diff --git a/gnucash/report/report-system/test/test-report-html.scm b/gnucash/report/report-system/test/test-report-html.scm
index 7e44f36d8..e4a854d48 100644
--- a/gnucash/report/report-system/test/test-report-html.scm
+++ b/gnucash/report/report-system/test/test-report-html.scm
@@ -45,7 +45,7 @@
 )
 
 (define html-doc-header-no-title
-"<html>\n\
+"<html dir='auto'>\n\
 <head>\n\
 <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n\
 </head><body>")
@@ -87,7 +87,7 @@
 
     (gnc:html-document-set-title! test-doc "HTML Document Title")
     (test-equal "HTML Document - Render with title"
-"<html>\n\
+"<html dir='auto'>\n\
 <head>\n\
 <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n\
 <title>\n\



Summary of changes:
 gnucash/report/business-reports/balsheet-eg.css    |  2 -
 .../report/business-reports/balsheet-eg.eguile.scm |  2 +-
 gnucash/report/business-reports/receipt.eguile.scm |  2 +-
 .../report/business-reports/taxinvoice.eguile.scm  |  2 +-
 gnucash/report/report-system/html-document.scm     |  2 +-
 gnucash/report/report-system/html-fonts.scm        |  2 +-
 .../report/report-system/test/test-report-html.scm |  4 +-
 gnucash/report/standard-reports/balsheet-pnl.scm   | 14 +++---
 .../report/standard-reports/general-journal.scm    | 15 +++----
 libgnucash/scm/utilities.scm                       | 50 ++++++++++++++++++++++
 10 files changed, 70 insertions(+), 25 deletions(-)



More information about the gnucash-changes mailing list