[gnumeric] only remember print settings if we showed a print dialog



commit bce018df60913f4bfdb4b11d78593087c84f4361
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Mon May 9 08:36:11 2011 -0600

    only remember print settings if we showed a print dialog
    
    2011-05-09  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* src/print.c (gnm_print_sheet): only remember settings if we showed
    	a print dialog

 ChangeLog   |    5 +++++
 src/print.c |   33 +++++++++++++++++----------------
 2 files changed, 22 insertions(+), 16 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ee5f674..2161b64 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-05-09  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* src/print.c (gnm_print_sheet): only remember settings if we showed
+	a print dialog
+
+2011-05-09  Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* gnumeric.xsd: add xs:element name="print-to-uri"
 	* src/print-info.h (print_info_set_printtofile_uri): new
 	* src/print-info.c (print_info_set_printtofile_uri): new
diff --git a/src/print.c b/src/print.c
index b5b6b7b..cebf8ae 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1731,23 +1731,24 @@ gnm_print_sheet (WorkbookControl *wbc, Sheet *sheet,
 	res = gtk_print_operation_run (print, action, parent, NULL);
 
 	switch (res) {
-	case GTK_PRINT_OPERATION_RESULT_APPLY: {
-		char const *printer;
-		settings = gtk_print_operation_get_print_settings (print);
-		gnm_conf_set_print_settings (settings);
-		gnm_insert_meta_date (GO_DOC (sheet->workbook), GSF_META_NAME_PRINT_DATE);
-		printer = gtk_print_settings_get_printer (settings);
-		if (strcmp (printer, "Print to File") == 0 || 
-		    strcmp (printer, _("Print to File")) == 0) {
-			    gchar *wb_output_uri = 
-				    gnm_print_uri_change_extension (doc->uri, 
-								    settings);
-			    print_info_set_printtofile_from_settings 
-				    (sheet->print_info, settings, wb_output_uri);
-			    g_free (wb_output_uri);
-		    }
+	case GTK_PRINT_OPERATION_RESULT_APPLY: 
+		if (action == GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG) {
+			char const *printer;
+			settings = gtk_print_operation_get_print_settings (print);
+			gnm_conf_set_print_settings (settings);
+			gnm_insert_meta_date (GO_DOC (sheet->workbook), GSF_META_NAME_PRINT_DATE);
+			printer = gtk_print_settings_get_printer (settings);
+			if (strcmp (printer, "Print to File") == 0 || 
+			    strcmp (printer, _("Print to File")) == 0) {
+				gchar *wb_output_uri = 
+					gnm_print_uri_change_extension (doc->uri, 
+									settings);
+				print_info_set_printtofile_from_settings 
+					(sheet->print_info, settings, wb_output_uri);
+				g_free (wb_output_uri);
+			}
+		}
 		break;
-	}
 	case GTK_PRINT_OPERATION_RESULT_CANCEL:
 		printing_instance_delete (pi);
 		break;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]