aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/print_dlg.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2006-07-01 12:11:11 +0000
committerUlf Lamping <ulf.lamping@web.de>2006-07-01 12:11:11 +0000
commit321316861e0e93c544438644a057aa11b44ea502 (patch)
tree9c96f6c02ee487fc4aac0fad1e254c387ae6f85f /gtk/print_dlg.c
parent637a18eedb69a6b74f76e7f874a8c27cb928bd74 (diff)
bugfix: open the Win32 print dialog a second time resulted in "funny" behaviour
printing on Win32 uses the print to file "option", don't overwrite the internal settings while doing so svn path=/trunk/; revision=18631
Diffstat (limited to 'gtk/print_dlg.c')
-rw-r--r--gtk/print_dlg.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gtk/print_dlg.c b/gtk/print_dlg.c
index da191c919f..b8466581af 100644
--- a/gtk/print_dlg.c
+++ b/gtk/print_dlg.c
@@ -859,6 +859,7 @@ print_ok_cb(GtkWidget *ok_bt, gpointer parent_w)
gboolean win_printer = FALSE;
int tmp_fd;
char tmp_namebuf[128+1]; /* XXX - length was used elsewhere too, why? */
+ char *tmp_oldfile;
#endif
cf_print_status_t status;
@@ -906,7 +907,8 @@ print_ok_cb(GtkWidget *ok_bt, gpointer parent_w)
"Couldn't create a temporary file for printing.");
return;
}
- g_free(args->file);
+ /* remember to restore these values later! */
+ tmp_oldfile = args->file;
args->file = g_strdup(tmp_namebuf);
eth_unlink(args->file);
args->to_file = TRUE;
@@ -1038,6 +1040,10 @@ print_ok_cb(GtkWidget *ok_bt, gpointer parent_w)
/* trash temp file */
eth_remove(args->file);
+
+ /* restore old settings */
+ args->to_file = FALSE;
+ args->file = tmp_oldfile;
}
#endif
}