Commit c1e10754 authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Handle failures from gnome-print.

1999-10-09  Morten Welinder  <terra@diku.dk>

	* src/print.c (sheet_print): Handle failures from gnome-print.
parent 7fb1e285
1999-10-09 Morten Welinder <terra@diku.dk>
* src/print.c (sheet_print): Handle failures from gnome-print.
1999-10-09 Jody Goldberg <jgoldberg@home.com>
* src/item-bar.c (item_bar_event) : Ensure that we ungrab whenever
......
1999-10-09 Morten Welinder <terra@diku.dk>
* src/print.c (sheet_print): Handle failures from gnome-print.
1999-10-09 Jody Goldberg <jgoldberg@home.com>
* src/item-bar.c (item_bar_event) : Ensure that we ungrab whenever
......
......@@ -612,6 +612,12 @@ sheet_print (Sheet *sheet, gboolean preview,
printer, gnome_paper_name (pj->pi->paper));
}
if (pj->print_context == NULL) {
gnumeric_notice (sheet->workbook, GNOME_MESSAGE_BOX_ERROR,
_("Printing failed -- bad filename?"));
loop = 0;
}
for (i = 0; i < loop; i++) {
switch (pj->range) {
......@@ -636,8 +642,10 @@ sheet_print (Sheet *sheet, gboolean preview,
if (preview)
print_preview_print_done (pj->preview);
else {
gnome_print_context_close_file (pj->print_context);
gtk_object_unref (GTK_OBJECT (pj->print_context));
if (pj->print_context) {
gnome_print_context_close_file (pj->print_context);
gtk_object_unref (GTK_OBJECT (pj->print_context));
}
gtk_object_unref (GTK_OBJECT (printer));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment