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:
Joshua Sled 2007-02-25 20:36:10 +00:00
parent 4afde76e83
commit b72cf9f7fa

View File

@ -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)
(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)))
(force-output)))))
;; gets the renderer from the report template;
;; gets the stylesheet from the report;