From 99ad583dd22c6b07defb443caa4e7b6d7fe1001a Mon Sep 17 00:00:00 2001 From: Andrew Sackville-West Date: Sat, 5 Jan 2008 06:10:31 +0000 Subject: [PATCH] prepare report system to handle newer reports in case user downgrades from > 2.2.x The incoming changes to the report system are not backwards compatible with 2.2 branch. This should allow the reports opened or saved by the new system to function in 2.2.x. BP git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16804 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/report/report-system/report-system.scm | 3 +++ src/report/report-system/report.scm | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/report/report-system/report-system.scm b/src/report/report-system/report-system.scm index 55486824ee..48cc2b76ff 100644 --- a/src/report/report-system/report-system.scm +++ b/src/report/report-system/report-system.scm @@ -106,8 +106,10 @@ (export gnc:define-report) (export ) (export gnc:report-template-new-options/name) +(export gnc:report-template-new-options/report-guid) (export gnc:report-template-menu-name/name) (export gnc:report-template-renderer/name) +(export gnc:report-template-renderer/report-guid) (export gnc:report-template-new-options) (export gnc:report-template-version) (export gnc:report-template-name) @@ -137,6 +139,7 @@ (export gnc:report-set-ctext!) (export gnc:make-report) (export gnc:restore-report) +(export gnc:restore-report-by-guid) (export gnc:make-report-options) (export gnc:report-export-types) (export gnc:report-export-thunk) diff --git a/src/report/report-system/report.scm b/src/report/report-system/report.scm index 3df716b46e..0dc7a730e8 100644 --- a/src/report/report-system/report.scm +++ b/src/report/report-system/report.scm @@ -47,7 +47,7 @@ (define (make-record-type "" ;; The data items in a report record - '(version name options-generator + '(version name report-guid parent-type options-generator options-cleanup-cb options-changed-cb renderer in-menu? menu-path menu-name menu-tip export-types export-thunk))) @@ -65,6 +65,8 @@ ((record-constructor ) #f ;; version #f ;; name + #f ;; report-guid for backwards compat of newer reports + #f ;; parent-type for backwards compat of newer reports #f ;; options-generator #f ;; options-cleanup-cb #f ;; options-changed-cb @@ -138,6 +140,10 @@ (gnc:report-template-new-options templ) #f))) +;; dummy function to enable backwards compatibility of newer reports +(define (gnc:report-template-new-options/report-guid template-id template-name) + (gnc:report-template-new-options/name template-name)) + (define (gnc:report-template-menu-name/name template-name) (let ((templ (hash-ref *gnc:_report-templates_* template-name))) (if templ @@ -151,6 +157,10 @@ (gnc:report-template-renderer templ) #f))) +;; dummy function to enable backwards compatibility of newer reports +(define (gnc:report-template-renderer/report-guid template-id template-name) + (gnc:report-template-renderer/name template-name)) + (define (gnc:report-template-new-options report-template) (let ((generator (gnc:report-template-options-generator report-template)) (namer @@ -277,6 +287,10 @@ (gnc-report-add r)) ) +;; dummy function to enable backwards compatibility with newer reports +(define (gnc:restore-report-by-guid id template-id template-name options) + (gnc:restore-report id template-name options)) + (define (gnc:make-report-options template-name) (let ((template (hash-ref *gnc:_report-templates_* template-name)))