gnucash stable: [gnc-plugin-page-report.cpp] save initial_report instead of cur_report
Christopher Lam
clam at code.gnucash.org
Sat Aug 22 00:51:16 EDT 2026
Updated via https://github.com/Gnucash/gnucash/commit/80c442da (commit)
from https://github.com/Gnucash/gnucash/commit/eaa2e6db (commit)
commit 80c442dad342a73677e1a6060a73ef5b597185c9
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Sat Aug 15 22:32:23 2026 +0800
[gnc-plugin-page-report.cpp] save initial_report instead of cur_report
When the tab navigates from initial_report to another report via
clicking, it is sensible to save the initial report instead of the
current report. This was the original intention of the initial_report
struct member.
Note this will cause a behaviour change. If a report tab is created,
and the user clicks through this report into a subreport, the original
report will be saved/restored instead of the current report. This was
the original intention of the initial_report object.
In practice the behaviour change is less lossy; previously if a report
tab was generated and subreports instantiated, the quit/load mechanism
would reload the current_report and the initial_report would be lost,
and it would have been impossible to revert to the initial_rpeort.
With this change, the initial_report is restored instead of the
current_report, and the user may still drill down into subsequent
subreports as desired.
diff --git a/gnucash/gnome/gnc-plugin-page-report.cpp b/gnucash/gnome/gnc-plugin-page-report.cpp
index 68c2ace85c..586e49c240 100644
--- a/gnucash/gnome/gnc-plugin-page-report.cpp
+++ b/gnucash/gnome/gnc-plugin-page-report.cpp
@@ -941,8 +941,8 @@ gnc_plugin_page_report_save_page (GncPluginPage *plugin_page,
report = GNC_PLUGIN_PAGE_REPORT(plugin_page);
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
- if (!priv || !priv->cur_report || scm_is_null(priv->cur_report) ||
- SCM_UNBNDP(priv->cur_report) || SCM_BOOL_F == priv->cur_report)
+ if (!priv || !priv->initial_report || scm_is_null (priv->initial_report) ||
+ SCM_UNBNDP (priv->initial_report) || scm_is_false (priv->initial_report))
{
LEAVE("not saving invalid report");
return;
@@ -951,7 +951,7 @@ gnc_plugin_page_report_save_page (GncPluginPage *plugin_page,
gen_save_text = scm_c_eval_string("gnc:report-serialize");
get_embedded_list = scm_c_eval_string("gnc:report-embedded-list");
get_options = scm_c_eval_string("gnc:report-options");
- embedded = scm_call_1(get_embedded_list, scm_call_1(get_options, priv->cur_report));
+ embedded = scm_call_1(get_embedded_list, scm_call_1(get_options, priv->initial_report));
count = scm_ilength(embedded);
while (count-- > 0)
{
@@ -975,7 +975,7 @@ gnc_plugin_page_report_save_page (GncPluginPage *plugin_page,
g_free(key_name);
}
- scm_text = scm_call_1(gen_save_text, priv->cur_report);
+ scm_text = scm_call_1 (gen_save_text, priv->initial_report);
if (!scm_is_string (scm_text))
{
LEAVE("nothing to save");
Summary of changes:
gnucash/gnome/gnc-plugin-page-report.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
More information about the gnucash-changes
mailing list