summaryrefslogtreecommitdiff
path: root/gtk/gtkprintoperation-unix.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2006-04-24 14:37:45 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2006-04-24 14:37:45 +0000
commit3d07d219e5644c1eb9103c816742f7053e006691 (patch)
treeba0d682a9bc1124f4128b924a87f303f219edd41 /gtk/gtkprintoperation-unix.c
parent4141a92ffffdf17869c96ac5e2d85fc4437a73ec (diff)
downloadgtk+-3d07d219e5644c1eb9103c816742f7053e006691.tar.gz
Return a copy of the original page setup if the dialog was canceled.
2006-04-24 Matthias Clasen <mclasen@redhat.com> * gtk/gtkprintoperation-unix.c (gtk_print_run_page_setup_dialog): Return a copy of the original page setup if the dialog was canceled.
Diffstat (limited to 'gtk/gtkprintoperation-unix.c')
-rw-r--r--gtk/gtkprintoperation-unix.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/gtk/gtkprintoperation-unix.c b/gtk/gtkprintoperation-unix.c
index 1257fc0db8..b5122ae822 100644
--- a/gtk/gtkprintoperation-unix.c
+++ b/gtk/gtkprintoperation-unix.c
@@ -245,12 +245,18 @@ gtk_print_run_page_setup_dialog (GtkWindow *parent,
page_setup);
gtk_page_setup_unix_dialog_set_print_settings (GTK_PAGE_SETUP_UNIX_DIALOG (dialog),
settings);
- gtk_dialog_run (GTK_DIALOG (dialog));
-
- new_page_setup = gtk_page_setup_unix_dialog_get_page_setup (GTK_PAGE_SETUP_UNIX_DIALOG (dialog));
-
+ if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK)
+ new_page_setup = gtk_page_setup_unix_dialog_get_page_setup (GTK_PAGE_SETUP_UNIX_DIALOG (dialog));
+ else
+ {
+ if (page_setup)
+ new_page_setup = gtk_page_setup_copy (page_setup);
+ else
+ new_page_setup = gtk_page_setup_new ();
+ }
+
gtk_widget_destroy (dialog);
-
+
return new_page_setup;
}