[Gnucash-changes] r13228 - gnucash/trunk/src/report/report-gnome - Take #2: Fixups for two botched gnc-plugin-page-report.c commits tonight.

Chris Shoemaker chris at cvs.gnucash.org
Sat Feb 11 23:13:30 EST 2006


Author: chris
Date: 2006-02-11 23:13:29 -0500 (Sat, 11 Feb 2006)
New Revision: 13228
Trac: http://svn.gnucash.org/trac/changeset/13228

Modified:
   gnucash/trunk/src/report/report-gnome/gnc-plugin-page-report.c
Log:
   Take #2:  Fixups for two botched gnc-plugin-page-report.c commits tonight.
   1) Correctly handle gc protection for non-boolean 'edited_reports' field.
   2) Pass list argument instead of immediate to gfec_apply.


Modified: gnucash/trunk/src/report/report-gnome/gnc-plugin-page-report.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/gnc-plugin-page-report.c	2006-02-12 02:40:35 UTC (rev 13227)
+++ gnucash/trunk/src/report/report-gnome/gnc-plugin-page-report.c	2006-02-12 04:13:29 UTC (rev 13228)
@@ -815,7 +815,7 @@
   
 	if (priv->cur_report != SCM_BOOL_F)
 		scm_gc_unprotect_object(priv->cur_report);
-	if (priv->edited_reports != SCM_BOOL_F)
+	if (priv->edited_reports != SCM_EOL)
 	        scm_gc_unprotect_object(priv->edited_reports);
   }
 
@@ -954,10 +954,11 @@
                                             SCM report)
 { 
         SCM new_edited = scm_delete(priv->edited_reports, report);
-	if (priv->edited_reports != SCM_BOOL_F)
+	if (priv->edited_reports != SCM_EOL)
 	        scm_gc_unprotect_object(priv->edited_reports);
         priv->edited_reports = new_edited;
-        scm_gc_protect_object(priv->edited_reports);
+        if (new_edited != SCM_EOL)
+            scm_gc_protect_object(priv->edited_reports);
 }
 
 void
@@ -965,10 +966,11 @@
                                          SCM report)
 {
         SCM new_edited = scm_cons(report, priv->edited_reports);
-	if (priv->edited_reports != SCM_BOOL_F)
+	if (priv->edited_reports != SCM_EOL)
 	        scm_gc_unprotect_object(priv->edited_reports);
         priv->edited_reports = new_edited;
-        scm_gc_protect_object(priv->edited_reports);
+        if (new_edited != SCM_EOL)
+            scm_gc_protect_object(priv->edited_reports);
 }
 
 void
@@ -1290,7 +1292,7 @@
 static void
 error_handler(const char *str)
 {
-    g_warning("Report Error: %s", str);
+    PWARN("Report Error: %s", str);
 }
 
 static void
@@ -1304,7 +1306,8 @@
         if (priv->cur_report == SCM_BOOL_F)
                 return;
 
-        result = gfec_apply(start_editor, priv->cur_report, error_handler);
+        result = gfec_apply(start_editor, scm_cons(priv->cur_report, SCM_EOL), 
+                            error_handler);
         if (result == SCM_BOOL_F || result == SCM_UNDEFINED) {
                 gnc_warning_dialog(GTK_WIDGET(gnc_ui_get_toplevel()),
                                    _("There are no options for this report."));



More information about the gnucash-changes mailing list