mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug#342206: evaluate the saved form of the report to get it added to the runtime environment; if the result of the eval is not a record (i.e., the report), then assume that the report has the same name as an existing report, and don't write it to the saved reports file.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15662 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
4afde76e83
commit
b72cf9f7fa
@ -395,11 +395,18 @@
|
||||
(gnc-build-dotgnucash-path "saved-reports-2.0"))
|
||||
|
||||
(define (gnc:report-save-to-savefile report)
|
||||
(let ((conf-file-name gnc:current-saved-reports))
|
||||
;;(display conf-file-name)
|
||||
(display (gnc:report-generate-saved-forms report)
|
||||
(open-file conf-file-name "a"))
|
||||
(force-output)))
|
||||
(let* ((conf-file-name gnc:current-saved-reports)
|
||||
(saved-form (gnc:report-generate-saved-forms report))
|
||||
;; Immediate evaluate the saved form to both load it into the
|
||||
;; runtime, but also so we can check if it's "allowed" to actually
|
||||
;; be written to the saved reports file by inspecting the result.
|
||||
;; #Bug#342206.
|
||||
(save-result (eval-string saved-form)))
|
||||
(if (record? save-result)
|
||||
(begin
|
||||
(display saved-form
|
||||
(open-file conf-file-name "a"))
|
||||
(force-output)))))
|
||||
|
||||
;; gets the renderer from the report template;
|
||||
;; gets the stylesheet from the report;
|
||||
|
Loading…
Reference in New Issue
Block a user