From 86b19df30c5cabb4f1efb51ec6e8eb4e0dddde6d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 29 Apr 2007 18:55:12 +0000 Subject: [PATCH] Document that a print operation can be run only once, and add a 2007-04-29 Matthias Clasen * gtk/gtkprintoperation.c (gtk_print_operation_run): Document that a print operation can be run only once, and add a corresponding g_return_if_fail(). (#379399, Masao Mutoh) svn path=/trunk/; revision=17715 --- ChangeLog | 6 ++++++ gtk/gtkprintoperation.c | 11 +++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5cfa553735..09f5c69966 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-04-29 Matthias Clasen + + * gtk/gtkprintoperation.c (gtk_print_operation_run): Document + that a print operation can be run only once, and add a + corresponding g_return_if_fail(). (#379399, Masao Mutoh) + 2007-04-29 Dan Winship * gdk/x11/gdkdisplay-x11.c diff --git a/gtk/gtkprintoperation.c b/gtk/gtkprintoperation.c index 80a773c573..77362b4302 100644 --- a/gtk/gtkprintoperation.c +++ b/gtk/gtkprintoperation.c @@ -2305,8 +2305,7 @@ gtk_print_operation_get_error (GtkPrintOperation *op, * @error: Return location for errors, or %NULL * * Runs the print operation, by first letting the user modify - * print settings in the print dialog, and then print the - * document. + * print settings in the print dialog, and then print the document. * * Normally that this function does not return until the rendering of all * pages is complete. You can connect to the ::status-changed signal on @@ -2354,6 +2353,9 @@ gtk_print_operation_get_error (GtkPrintOperation *op, * } * * + * Note that gtk_print_operation_run() can only be called once on a + * given #GtkPrintOperation. + * * Return value: the result of the print operation. A return value of * %GTK_PRINT_OPERATION_RESULT_APPLY indicates that the printing was * completed successfully. In this case, it is a good idea to obtain @@ -2378,9 +2380,10 @@ gtk_print_operation_run (GtkPrintOperation *op, g_return_val_if_fail (GTK_IS_PRINT_OPERATION (op), GTK_PRINT_OPERATION_RESULT_ERROR); - + g_return_val_if_fail (op->priv->status == GTK_PRINT_STATUS_INITIAL, + GTK_PRINT_OPERATION_RESULT_ERROR); priv = op->priv; - + run_print_pages = TRUE; do_print = FALSE; priv->error = NULL;