gnucash master: Bug 798730 - Open report doesn't remember selected accounts over restart

John Ralls jralls at code.gnucash.org
Fri Jan 20 16:22:45 EST 2023


Updated	 via  https://github.com/Gnucash/gnucash/commit/816219c2 (commit)
	from  https://github.com/Gnucash/gnucash/commit/d1492c70 (commit)



commit 816219c2466bd5dba2020b3e39a325ef20113888
Author: John Ralls <jralls at ceridwen.us>
Date:   Fri Jan 20 13:14:08 2023 -0800

    Bug 798730 - Open report doesn't remember selected accounts over restart
    
    scm_to_value<GncOptionAccountList> written for std::vector<Account*>
    instead of std::vector<GncGUID>.

diff --git a/bindings/guile/gnc-optiondb.i b/bindings/guile/gnc-optiondb.i
index 9dffc7c66..610b1a38b 100644
--- a/bindings/guile/gnc-optiondb.i
+++ b/bindings/guile/gnc-optiondb.i
@@ -468,19 +468,15 @@ scm_to_value<GncOptionAccountList>(SCM new_value)
     GncOptionAccountList retval{};
     if (scm_is_false(scm_list_p(new_value)) || scm_is_null(new_value))
         return retval;
+    auto book{get_current_book()};
     auto next{new_value};
-    while (auto node{scm_car(next)})
+    while (!scm_is_null(next) && scm_car(next))
     {
-        void* account{};
-        SWIG_ConvertPtr(node, &account, SWIGTYPE_p_Account, 0);
-        if (account)
-        {
-            auto guid{qof_entity_get_guid(static_cast<Account*>(account))};
-            retval.push_back(*guid);
-        }
+        auto guid_str{scm_to_utf8_string(scm_car(next))};
+        GncGUID guid;
+        string_to_guid(guid_str, &guid);
+        retval.push_back(guid);
         next = scm_cdr(next);
-        if (scm_is_null(next))
-            break;
     }
     return retval;
 }



Summary of changes:
 bindings/guile/gnc-optiondb.i | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)



More information about the gnucash-changes mailing list