r15662 - gnucash/trunk/src/report/report-system - 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.
Josh Sled
jsled at cvs.gnucash.org
Sun Feb 25 15:36:11 EST 2007
Author: jsled
Date: 2007-02-25 15:36:10 -0500 (Sun, 25 Feb 2007)
New Revision: 15662
Trac: http://svn.gnucash.org/trac/changeset/15662
Modified:
gnucash/trunk/src/report/report-system/report.scm
Log:
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.
Modified: gnucash/trunk/src/report/report-system/report.scm
===================================================================
--- gnucash/trunk/src/report/report-system/report.scm 2007-02-25 19:51:00 UTC (rev 15661)
+++ gnucash/trunk/src/report/report-system/report.scm 2007-02-25 20:36:10 UTC (rev 15662)
@@ -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;
More information about the gnucash-changes
mailing list