[gnumeric] avoid potential critical when trying to print



commit 1d3238f747e5b835e6b65ff68f8e4090d2f5579a
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Mon May 23 00:15:40 2011 -0600

    avoid potential critical when trying to print
    
    2011-05-23  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* src/print.c (gnm_print_uri_change_extension): if the setting has no
    	extension, specify one

 ChangeLog   |    5 +++++
 src/print.c |    7 ++++++-
 2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 731bc11..74f1755 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-23  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* src/print.c (gnm_print_uri_change_extension): if the setting has no
+	extension, specify one
+
 2011-05-22  Morten Welinder  <terra gnome org>
 
 	* src/complex.h: Use goffice's stuff as far as possible.
diff --git a/src/print.c b/src/print.c
index 0063afd..e6fe66c 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1587,7 +1587,12 @@ gnm_print_uri_change_extension (char const *uri, GtkPrintSettings* settings)
 	gchar *res;
 	gint uri_len = strlen(uri);
 
-	g_return_val_if_fail (ext != NULL, NULL);
+	if (ext == NULL) {
+		ext = "pdf";
+		gtk_print_settings_set (settings, 
+					GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT,
+					ext);
+	}
 	
 	base     = g_path_get_basename (uri);
 	used_ext = strrchr (base, '.');



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