From 58147ea4704f71996f0c3d54a44420bdc6861911 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Fri, 23 Dec 2022 09:57:23 -0800 Subject: [PATCH] [c++options] Convert trep-engine, trep-based-reports, and tests to new API --- .../reports/standard/test/test-income-gst.scm | 7 +++---- .../reports/standard/test/test-transaction.scm | 14 ++++++-------- gnucash/report/trep-engine.scm | 4 +--- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/gnucash/report/reports/standard/test/test-income-gst.scm b/gnucash/report/reports/standard/test/test-income-gst.scm index 97c267ab4e..fa2c5ae9cd 100644 --- a/gnucash/report/reports/standard/test/test-income-gst.scm +++ b/gnucash/report/reports/standard/test/test-income-gst.scm @@ -43,10 +43,9 @@ (gnc:options->sxml rpt-uuid options "test-gstr" test-title)) (define (set-option! options section name value) - (let ((option (gnc:lookup-option options section name))) - (if option - (gnc:option-set-value option value) - (test-assert (format #f "wrong-option ~a ~a" section name) #f)))) + (if (gnc-lookup-option options section name) + (gnc-set-option options section name value) + (test-assert (format #f "wrong-option ~a ~a" section name) #f))) (define* (create-txn d m y desc splits #:optional txn-type) (let* ((splits (map (lambda (s) (vector (cdr s) (car s) (car s))) splits)) diff --git a/gnucash/report/reports/standard/test/test-transaction.scm b/gnucash/report/reports/standard/test/test-transaction.scm index 4a0ffc43c7..0f7a2e583b 100644 --- a/gnucash/report/reports/standard/test/test-transaction.scm +++ b/gnucash/report/reports/standard/test/test-transaction.scm @@ -102,15 +102,13 @@ (sxml->table-row-col sxml 1 row col)) (define (set-option! options section name value) - (let ((option (gnc:lookup-option options section name))) - (if option - (gnc:option-set-value option value) - (test-assert (format #f "wrong-option ~a ~a" section name) #f)))) + (if (gnc-lookup-option options section name) + (gnc-set-option options section name value) + (test-assert (format #f "wrong-option ~a ~a" section name) #f))) (define (opt-val options section name) - (let ((option (gnc:lookup-option options section name))) - (if option - (gnc:option-value option) - (test-assert (format #f "wrong-option ~a ~a" section name) #f)))) + (if (gnc-lookup-option options section name) + (gnc-get-option options section name value) + (test-assert (format #f "wrong-option ~a ~a" section name) #f))) (define structure (list "Root" (list (cons 'type ACCT-TYPE-ASSET)) diff --git a/gnucash/report/trep-engine.scm b/gnucash/report/trep-engine.scm index c3b07a4a7e..b68a4e9111 100644 --- a/gnucash/report/trep-engine.scm +++ b/gnucash/report/trep-engine.scm @@ -990,9 +990,7 @@ be excluded from periodic reporting.") (gnc-register-internal-option options "__trep" "unique-transactions" #f) (GncOptionDBPtr-set-default-section options gnc:pagename-general) -;; A temporary hack so that trep users will get the options type they expect. - (lambda (key) - options))) + options)) ;; ;;;;;;;;;;;;;;;;;;;; ;; Here comes the big function that builds the whole table.