[report] *delete-trailing-whitespace/reindent/untabify*

This commit is contained in:
Christopher Lam 2019-01-10 17:52:27 +08:00
parent 8f8f5b8461
commit f021658382

View File

@ -23,8 +23,7 @@
(use-modules (gnucash utilities))
(use-modules (gnucash app-utils))
(use-modules (gnucash gettext))
(eval-when
(compile load eval expand)
(eval-when (compile load eval expand)
(load-extension "libgncmod-report-system" "scm_init_sw_report_system_module"))
(use-modules (sw_report_system))
@ -405,7 +404,8 @@
#f))
)
(define (gnc:restore-report-by-guid-with-custom-template id template-id template-name custom-template-id options)
(define (gnc:restore-report-by-guid-with-custom-template
id template-id template-name custom-template-id options)
(if options
(let* (
(r ((record-constructor <report>)
@ -565,7 +565,9 @@
(format #f ";; options for report ~S\n" (gnc:report-name report))
(format
#f "(let ((options (gnc:report-template-new-options/report-guid ~S ~S)))\n"
(gnc:report-type report) (gnc:report-template-name (hash-ref *gnc:_report-templates_* (gnc:report-type report))))
(gnc:report-type report)
(gnc:report-template-name
(hash-ref *gnc:_report-templates_* (gnc:report-type report))))
(gnc:generate-restore-forms (gnc:report-options report) "options")
;; 2.6->2.4 compatibility code prefix
;; Temporary check to make the new report saving code more or less backwards
@ -575,16 +577,17 @@
(format
#f " (gnc:restore-report-by-guid-with-custom-template ~S ~S ~S ~S options)\n"
(gnc:report-id report) (gnc:report-type report)
(gnc:report-template-name (hash-ref *gnc:_report-templates_* (gnc:report-type report)))
(gnc:report-template-name
(hash-ref *gnc:_report-templates_* (gnc:report-type report)))
(gnc:report-custom-template report))
;; 2.6->2.4 compatibility code suffix
(format
#f " (gnc:restore-report-by-guid ~S ~S ~S options))\n"
(gnc:report-id report) (gnc:report-type report)
(gnc:report-template-name (hash-ref *gnc:_report-templates_* (gnc:report-type report))))
(gnc:report-template-name
(hash-ref *gnc:_report-templates_* (gnc:report-type report))))
;; end of 2.6->2.4 compatibility code suffix.
")"
))
")"))
;; Generate guile code required to recreate embedded report instances
(define (gnc:report-serialize-embedded embedded-reports)
@ -693,19 +696,22 @@
;; save them
(let* ((name (gnc:report-template-make-unique-name (gnc:report-name report)))
(type (gnc:report-type report))
(templ-name (gnc:report-template-name (hash-ref *gnc:_report-templates_* (gnc:report-type report))))
(templ-name (gnc:report-template-name
(hash-ref *gnc:_report-templates_* (gnc:report-type report))))
(options (gnc:report-options report)))
(gnc:report-template-serialize-internal name type templ-name options #f)))
;; Generate guile code required to recreate a report template
;; Note: multi column report templates encapsulate instantiated reports, not other report templates
;; this means that the template recreation code must also contain the code to instantiate
;; these embedded report instances. This results in a mix of template and instatiated reports
;; in the saved reports file...
;; Note: multi column report templates encapsulate instantiated
;; reports, not other report templates this means that the template
;; recreation code must also contain the code to instantiate these
;; embedded report instances. This results in a mix of template and
;; instatiated reports in the saved reports file...
(define (gnc:report-template-serialize report-template)
(let* ((name (gnc:report-template-name report-template))
(type (gnc:report-template-parent-type report-template))
(templ-name (gnc:report-template-name (hash-ref *gnc:_report-templates_* type)))
(templ-name (gnc:report-template-name
(hash-ref *gnc:_report-templates_* type)))
(options (gnc:report-template-new-options report-template))
(guid (gnc:report-template-report-guid report-template)))
(gnc:report-template-serialize-internal name type templ-name options guid)))
@ -719,7 +725,9 @@
;; 2. an overwrite is requestes by setting overwrite? to #t
(define (gnc:report-to-template report overwrite?)
(let* ((custom-template-id (gnc:report-custom-template report))
(overwrite-ok? (and (gnc:report-template-is-custom/template-guid? custom-template-id) overwrite?))
(overwrite-ok? (and (gnc:report-template-is-custom/template-guid?
custom-template-id)
overwrite?))
;; Generate a serialized report-template with a random guid
(saved-form (gnc:report-template-serialize-from-report report))
;; Immediately evaluate the serialized report template to