--------------F2BE319626F7F61528C9C661
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I have been working on a tax related report and txf export routines. I
found a bug in gnc:make-account-list-option if both the multi-select
mode is #f and gnc:refresh-main-window is called. The next time a
different account is selected and the apply button is clicked, the
gnc:make-account-list-option returns a list with 2 elements! Oddly,
neither the car nor the cadr of this two element list is the account!
I found this on gnucahs-1.4.7, and I haven't checked other versions.
To reproduce the error, modify the ...src/scm/report/hellow-world.scm
file.
Here is a diff of hello-world.scm
---------------------------------------
134c134
< #f #t))
---
> #f #f))
292a293,304
> (if (null? accounts)
> (html-para "There are 0 accounts selected.")
> (let ((acc (if (> 1 (length accounts))
> (cadr accounts)
> (car accounts))))
> (gnc:account-set-notes acc "Some String")
> (gnc:refresh-main-window)
> (html-para (string-append "There are "
> (number->string
> (length accounts))
> " accounts selected."))))
>
---------------------------------------
The new code is inserted between the following two lines in
hello-world.scm:
(account-list accounts)
(make-para 'nice-day)
It helps to set the preferences to display the notes fields in the main
window.
--
Gilligan | __o .oooO
/| _ \<,_ ( )
/p|\ (_)/ (_) \ ( Oooo.
/ | \ ------------ \_) ( )
======== ) /
======== gilligan@mpinet.net (_/
~~~~~~~~~~~~~~~~ uschold@cs.ucf.edu
--------------F2BE319626F7F61528C9C661
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
I have been working on a tax related report and txf export routines.
I found a bug in gnc:make-account-list-option if both the multi-select
mode is #f and gnc:refresh-main-window is called. The next time a
different account is selected and the apply button is clicked, the gnc:make-account-list-option
returns a list with 2 elements! Oddly, neither the car nor the cadr of
this two element list is the account!
I found this on gnucahs-1.4.7, and I haven't checked other versions.
To reproduce the error, modify the ...src/scm/report/hellow-world.scm
file.
Here is a diff of hello-world.scm
---------------------------------------
134c134
< #f #t))
---
> #f #f))
292a293,304
> (if (null? accounts)
>
(html-para "There are 0 accounts selected.")
>
(let ((acc (if (> 1 (length accounts))
>
(cadr accounts)
>
(car accounts))))
>
(gnc:account-set-notes acc "Some String")
>
(gnc:refresh-main-window)
>
(html-para (string-append "There are "
>
(number->string
>
(length accounts))
>
" accounts selected."))))
>
---------------------------------------
The new code is inserted between the following two lines in hello-world.scm:
(account-list accounts)
(make-para 'nice-day)
It helps to set the preferences to display the notes fields in the main
window.
--
Gilligan | __o .oooO
/| _ \<,_ ( )
/p|\ (_)/ (_) \ ( Oooo.
/ | \ ------------ \_) ( )
======== ) /
======== gilligan@mpinet.net (_/
~~~~~~~~~~~~~~~~ uschold@cs.ucf.edu