Commit 061f2528 authored by Christian Persch's avatar Christian Persch Committed by Christian Persch

Use a priv variable when accessing priv multiple times in the same

2006-05-02  Christian Persch  <chpe@cvs.gnome.org>

	* gtk/gtkpagesetupunixdialog.c:
	* gtk/gtkprintcontext.c:
	* gtk/gtkprinter.c:
	* gtk/gtkprinteroptionwidget.c:
	* gtk/gtkprintjob.c:
	* gtk/gtkprintoperation-unix.c:
	* gtk/gtkprintoperation.c:
	* gtk/gtkprintunixdialog.c: Use a priv variable when accessing priv
	  multiple times in the same function. Bug #340288.
parent 5d6f77b4
2006-05-02 Christian Persch <chpe@cvs.gnome.org>
* gtk/gtkpagesetupunixdialog.c:
* gtk/gtkprintcontext.c:
* gtk/gtkprinter.c:
* gtk/gtkprinteroptionwidget.c:
* gtk/gtkprintjob.c:
* gtk/gtkprintoperation-unix.c:
* gtk/gtkprintoperation.c:
* gtk/gtkprintunixdialog.c: Use a priv variable when accessing priv
multiple times in the same function. Bug #340288.
2006-05-02 Michael Natterer <mitch@imendio.com>
* gtk/gtklabel.c (gtk_label_set_line_wrap): added note about the
......
2006-05-02 Christian Persch <chpe@cvs.gnome.org>
* gtk/gtkpagesetupunixdialog.c:
* gtk/gtkprintcontext.c:
* gtk/gtkprinter.c:
* gtk/gtkprinteroptionwidget.c:
* gtk/gtkprintjob.c:
* gtk/gtkprintoperation-unix.c:
* gtk/gtkprintoperation.c:
* gtk/gtkprintunixdialog.c: Use a priv variable when accessing priv
multiple times in the same function. Bug #340288.
2006-05-02 Michael Natterer <mitch@imendio.com>
* gtk/gtklabel.c (gtk_label_set_line_wrap): added note about the
......
This diff is collapsed.
......@@ -83,14 +83,15 @@ gtk_print_context_class_init (GtkPrintContextClass *class)
GtkPrintContext *
_gtk_print_context_new (GtkPrintOperation *op)
{
GtkPrintOperationPrivate *priv = op->priv;
GtkPrintContext *context;
context = g_object_new (GTK_TYPE_PRINT_CONTEXT, NULL);
context->op = op;
context->cr = cairo_create (op->priv->surface);
context->cr = cairo_create (priv->surface);
switch (op->priv->unit)
switch (priv->unit)
{
default:
case GTK_UNIT_PIXEL:
......@@ -99,16 +100,16 @@ _gtk_print_context_new (GtkPrintOperation *op)
context->pixels_per_unit_y = 1.0;
break;
case GTK_UNIT_POINTS:
context->pixels_per_unit_x = op->priv->dpi_x / POINTS_PER_INCH;
context->pixels_per_unit_y = op->priv->dpi_y / POINTS_PER_INCH;
context->pixels_per_unit_x = priv->dpi_x / POINTS_PER_INCH;
context->pixels_per_unit_y = priv->dpi_y / POINTS_PER_INCH;
break;
case GTK_UNIT_INCH:
context->pixels_per_unit_x = op->priv->dpi_x;
context->pixels_per_unit_y = op->priv->dpi_y;
context->pixels_per_unit_x = priv->dpi_x;
context->pixels_per_unit_y = priv->dpi_y;
break;
case GTK_UNIT_MM:
context->pixels_per_unit_x = op->priv->dpi_x / MM_PER_INCH;
context->pixels_per_unit_y = op->priv->dpi_y / MM_PER_INCH;
context->pixels_per_unit_x = priv->dpi_x / MM_PER_INCH;
context->pixels_per_unit_y = priv->dpi_y / MM_PER_INCH;
break;
}
cairo_scale (context->cr,
......@@ -118,7 +119,7 @@ _gtk_print_context_new (GtkPrintOperation *op)
context->fontmap = pango_cairo_font_map_new ();
/* We use the unit-scaled resolution, as we still want fonts given in points to work */
pango_cairo_font_map_set_resolution (PANGO_CAIRO_FONT_MAP (context->fontmap),
op->priv->dpi_y / context->pixels_per_unit_y);
priv->dpi_y / context->pixels_per_unit_y);
return context;
}
......@@ -126,6 +127,7 @@ _gtk_print_context_new (GtkPrintOperation *op)
void
_gtk_print_context_rotate_according_to_orientation (GtkPrintContext *context)
{
GtkPrintOperationPrivate *priv = context->op->priv;
cairo_t *cr = context->cr;
cairo_matrix_t matrix;
GtkPaperSize *paper_size;
......@@ -134,9 +136,9 @@ _gtk_print_context_rotate_according_to_orientation (GtkPrintContext *context)
paper_size = gtk_page_setup_get_paper_size (context->page_setup);
width = gtk_paper_size_get_width (paper_size, GTK_UNIT_INCH);
width = width * context->op->priv->dpi_x / context->pixels_per_unit_x;
width = width * priv->dpi_x / context->pixels_per_unit_x;
height = gtk_paper_size_get_height (paper_size, GTK_UNIT_INCH);
height = height * context->op->priv->dpi_y / context->pixels_per_unit_y;
height = height * priv->dpi_y / context->pixels_per_unit_y;
switch (gtk_page_setup_get_orientation (context->page_setup))
{
......@@ -173,18 +175,21 @@ _gtk_print_context_rotate_according_to_orientation (GtkPrintContext *context)
void
_gtk_print_context_translate_into_margin (GtkPrintContext *context)
{
GtkPrintOperationPrivate *priv;
gdouble left, top;
g_return_if_fail (GTK_IS_PRINT_CONTEXT (context));
priv = context->op->priv;
/* We do it this way to also handle GTK_UNIT_PIXELS */
left = gtk_page_setup_get_left_margin (context->page_setup, GTK_UNIT_INCH);
top = gtk_page_setup_get_top_margin (context->page_setup, GTK_UNIT_INCH);
cairo_translate (context->cr,
left * context->op->priv->dpi_x / context->pixels_per_unit_x,
top * context->op->priv->dpi_y / context->pixels_per_unit_y);
left * priv->dpi_x / context->pixels_per_unit_x,
top * priv->dpi_y / context->pixels_per_unit_y);
}
void
......@@ -254,17 +259,20 @@ gtk_print_context_get_page_setup (GtkPrintContext *context)
gdouble
gtk_print_context_get_width (GtkPrintContext *context)
{
GtkPrintOperationPrivate *priv;
gdouble width;
g_return_val_if_fail (GTK_IS_PRINT_CONTEXT (context), 0);
if (context->op->priv->use_full_page)
priv = context->op->priv;
if (priv->use_full_page)
width = gtk_page_setup_get_paper_width (context->page_setup, GTK_UNIT_INCH);
else
width = gtk_page_setup_get_page_width (context->page_setup, GTK_UNIT_INCH);
/* Really dpi_x? What about landscape? what does dpi_x mean in that case? */
return width * context->op->priv->dpi_x / context->pixels_per_unit_x;
return width * priv->dpi_x / context->pixels_per_unit_x;
}
/**
......@@ -280,17 +288,20 @@ gtk_print_context_get_width (GtkPrintContext *context)
gdouble
gtk_print_context_get_height (GtkPrintContext *context)
{
GtkPrintOperationPrivate *priv;
gdouble height;
g_return_val_if_fail (GTK_IS_PRINT_CONTEXT (context), 0);
if (context->op->priv->use_full_page)
priv = context->op->priv;
if (priv->use_full_page)
height = gtk_page_setup_get_paper_height (context->page_setup, GTK_UNIT_INCH);
else
height = gtk_page_setup_get_page_height (context->page_setup, GTK_UNIT_INCH);
/* Really dpi_x? What about landscape? what does dpi_x mean in that case? */
return height * context->op->priv->dpi_y / context->pixels_per_unit_y;
return height * priv->dpi_y / context->pixels_per_unit_y;
}
/**
......
......@@ -186,36 +186,36 @@ gtk_printer_class_init (GtkPrinterClass *class)
static void
gtk_printer_init (GtkPrinter *printer)
{
printer->priv = GTK_PRINTER_GET_PRIVATE (printer);
GtkPrinterPrivate *priv;
printer->priv->name = NULL;
printer->priv->location = NULL;
printer->priv->description = NULL;
printer->priv->icon_name = NULL;
priv = printer->priv = GTK_PRINTER_GET_PRIVATE (printer);
printer->priv->is_active = TRUE;
printer->priv->is_new = TRUE;
printer->priv->has_details = FALSE;
priv->name = NULL;
priv->location = NULL;
priv->description = NULL;
priv->icon_name = NULL;
printer->priv->state_message = NULL;
printer->priv->job_count = 0;
priv->is_active = TRUE;
priv->is_new = TRUE;
priv->has_details = FALSE;
priv->state_message = NULL;
priv->job_count = 0;
}
static void
gtk_printer_finalize (GObject *object)
{
g_return_if_fail (object != NULL);
GtkPrinter *printer = GTK_PRINTER (object);
GtkPrinterPrivate *priv = printer->priv;
g_free (printer->priv->name);
g_free (printer->priv->location);
g_free (printer->priv->description);
g_free (printer->priv->state_message);
g_free (printer->priv->icon_name);
g_free (priv->name);
g_free (priv->location);
g_free (priv->description);
g_free (priv->state_message);
g_free (priv->icon_name);
if (G_OBJECT_CLASS (gtk_printer_parent_class)->finalize)
G_OBJECT_CLASS (gtk_printer_parent_class)->finalize (object);
G_OBJECT_CLASS (gtk_printer_parent_class)->finalize (object);
}
static void
......@@ -225,19 +225,20 @@ gtk_printer_set_property (GObject *object,
GParamSpec *pspec)
{
GtkPrinter *printer = GTK_PRINTER (object);
GtkPrinterPrivate *priv = printer->priv;
switch (prop_id)
{
case PROP_NAME:
printer->priv->name = g_value_dup_string (value);
priv->name = g_value_dup_string (value);
break;
case PROP_BACKEND:
printer->priv->backend = GTK_PRINT_BACKEND (g_value_get_object (value));
priv->backend = GTK_PRINT_BACKEND (g_value_get_object (value));
break;
case PROP_IS_VIRTUAL:
printer->priv->is_virtual = g_value_get_boolean (value);
priv->is_virtual = g_value_get_boolean (value);
break;
default:
......@@ -253,38 +254,39 @@ gtk_printer_get_property (GObject *object,
GParamSpec *pspec)
{
GtkPrinter *printer = GTK_PRINTER (object);
GtkPrinterPrivate *priv = printer->priv;
switch (prop_id)
{
case PROP_NAME:
if (printer->priv->name)
g_value_set_string (value, printer->priv->name);
if (priv->name)
g_value_set_string (value, priv->name);
else
g_value_set_string (value, "");
break;
case PROP_BACKEND:
g_value_set_object (value, printer->priv->backend);
g_value_set_object (value, priv->backend);
break;
case PROP_STATE_MESSAGE:
if (printer->priv->state_message)
g_value_set_string (value, printer->priv->state_message);
if (priv->state_message)
g_value_set_string (value, priv->state_message);
else
g_value_set_string (value, "");
break;
case PROP_LOCATION:
if (printer->priv->location)
g_value_set_string (value, printer->priv->location);
if (priv->location)
g_value_set_string (value, priv->location);
else
g_value_set_string (value, "");
break;
case PROP_ICON_NAME:
if (printer->priv->icon_name)
g_value_set_string (value, printer->priv->icon_name);
if (priv->icon_name)
g_value_set_string (value, priv->icon_name);
else
g_value_set_string (value, "");
break;
case PROP_JOB_COUNT:
g_value_set_int (value, printer->priv->job_count);
g_value_set_int (value, priv->job_count);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......@@ -388,13 +390,17 @@ gboolean
gtk_printer_set_description (GtkPrinter *printer,
const gchar *description)
{
GtkPrinterPrivate *priv;
g_return_val_if_fail (GTK_IS_PRINTER (printer), FALSE);
if (safe_strcmp (printer->priv->description, description) == 0)
priv = printer->priv;
if (safe_strcmp (priv->description, description) == 0)
return FALSE;
g_free (printer->priv->description);
printer->priv->description = g_strdup (description);
g_free (priv->description);
priv->description = g_strdup (description);
return TRUE;
}
......@@ -422,13 +428,17 @@ gboolean
gtk_printer_set_state_message (GtkPrinter *printer,
const gchar *message)
{
GtkPrinterPrivate *priv;
g_return_val_if_fail (GTK_IS_PRINTER (printer), FALSE);
if (safe_strcmp (printer->priv->state_message, message) == 0)
priv = printer->priv;
if (safe_strcmp (priv->state_message, message) == 0)
return FALSE;
g_free (printer->priv->state_message);
printer->priv->state_message = g_strdup (message);
g_free (priv->state_message);
priv->state_message = g_strdup (message);
g_object_notify (G_OBJECT (printer), "state-message");
return TRUE;
......@@ -456,13 +466,17 @@ gboolean
gtk_printer_set_location (GtkPrinter *printer,
const gchar *location)
{
GtkPrinterPrivate *priv;
g_return_val_if_fail (GTK_IS_PRINTER (printer), FALSE);
if (safe_strcmp (printer->priv->location, location) == 0)
priv = printer->priv;
if (safe_strcmp (priv->location, location) == 0)
return FALSE;
g_free (printer->priv->location);
printer->priv->location = g_strdup (location);
g_free (priv->location);
priv->location = g_strdup (location);
g_object_notify (G_OBJECT (printer), "location");
return TRUE;
......@@ -490,10 +504,14 @@ void
gtk_printer_set_icon_name (GtkPrinter *printer,
const gchar *icon)
{
GtkPrinterPrivate *priv;
g_return_if_fail (GTK_IS_PRINTER (printer));
g_free (printer->priv->icon_name);
printer->priv->icon_name = g_strdup (icon);
priv = printer->priv;
g_free (priv->icon_name);
priv->icon_name = g_strdup (icon);
g_object_notify (G_OBJECT (printer), "icon-name");
}
......@@ -519,12 +537,16 @@ gboolean
gtk_printer_set_job_count (GtkPrinter *printer,
gint count)
{
GtkPrinterPrivate *priv;
g_return_val_if_fail (GTK_IS_PRINTER (printer), FALSE);
if (printer->priv->job_count == count)
priv = printer->priv;
if (priv->job_count == count)
return FALSE;
printer->priv->job_count = count;
priv->job_count = count;
g_object_notify (G_OBJECT (printer), "job-count");
......
This diff is collapsed.
......@@ -165,18 +165,21 @@ gtk_print_job_class_init (GtkPrintJobClass *class)
static void
gtk_print_job_init (GtkPrintJob *job)
{
job->priv = GTK_PRINT_JOB_GET_PRIVATE (job);
job->priv->spool_file_fd = -1;
GtkPrintJobPrivate *priv;
job->priv->title = g_strdup ("");
job->priv->surface = NULL;
job->priv->backend = NULL;
job->priv->printer = NULL;
priv = job->priv = GTK_PRINT_JOB_GET_PRIVATE (job);
job->priv->printer_set = FALSE;
job->priv->settings_set = FALSE;
job->priv->page_setup_set = FALSE;
job->priv->status = GTK_PRINT_STATUS_INITIAL;
priv->spool_file_fd = -1;
priv->title = g_strdup ("");
priv->surface = NULL;
priv->backend = NULL;
priv->printer = NULL;
priv->printer_set = FALSE;
priv->settings_set = FALSE;
priv->page_setup_set = FALSE;
priv->status = GTK_PRINT_STATUS_INITIAL;
job->print_pages = GTK_PRINT_PAGES_ALL;
job->page_ranges = NULL;
......@@ -196,6 +199,7 @@ gtk_print_job_constructor (GType type,
GObjectConstructParam *construct_params)
{
GtkPrintJob *job;
GtkPrintJobPrivate *priv;
GObject *object;
object =
......@@ -204,15 +208,16 @@ gtk_print_job_constructor (GType type,
construct_params);
job = GTK_PRINT_JOB (object);
priv = job->priv;
g_assert (priv->printer_set &&
priv->settings_set &&
priv->page_setup_set);
g_assert (job->priv->printer_set &&
job->priv->settings_set &&
job->priv->page_setup_set);
_gtk_printer_prepare_for_print (job->priv->printer,
_gtk_printer_prepare_for_print (priv->printer,
job,
job->priv->settings,
job->priv->page_setup);
priv->settings,
priv->page_setup);
return object;
}
......@@ -221,41 +226,37 @@ gtk_print_job_constructor (GType type,
static void
gtk_print_job_finalize (GObject *object)
{
GtkPrintJob *job;
g_return_if_fail (object != NULL);
job = GTK_PRINT_JOB (object);
GtkPrintJob *job = GTK_PRINT_JOB (object);
GtkPrintJobPrivate *priv = job->priv;
if (job->priv->spool_file_fd > 0)
if (priv->spool_file_fd >= 0)
{
close (job->priv->spool_file_fd);
job->priv->spool_file_fd = -1;
close (priv->spool_file_fd);
priv->spool_file_fd = -1;
}
if (job->priv->backend)
g_object_unref (G_OBJECT (job->priv->backend));
if (priv->backend)
g_object_unref (priv->backend);
if (job->priv->printer)
g_object_unref (G_OBJECT (job->priv->printer));
if (priv->printer)
g_object_unref (priv->printer);
if (job->priv->surface)
cairo_surface_destroy (job->priv->surface);
if (priv->surface)
cairo_surface_destroy (priv->surface);
if (job->priv->settings)
g_object_unref (job->priv->settings);
if (priv->settings)
g_object_unref (priv->settings);
if (job->priv->page_setup)
g_object_unref (job->priv->page_setup);
if (priv->page_setup)
g_object_unref (priv->page_setup);
g_free (job->page_ranges);
job->page_ranges = NULL;
g_free (job->priv->title);
job->priv->title = NULL;
if (G_OBJECT_CLASS (gtk_print_job_parent_class)->finalize)
G_OBJECT_CLASS (gtk_print_job_parent_class)->finalize (object);
g_free (priv->title);
priv->title = NULL;
G_OBJECT_CLASS (gtk_print_job_parent_class)->finalize (object);
}
/**
......@@ -363,12 +364,16 @@ void
gtk_print_job_set_status (GtkPrintJob *job,
GtkPrintStatus status)
{
GtkPrintJobPrivate *priv;
g_return_if_fail (GTK_IS_PRINT_JOB (job));
if (job->priv->status == status)
priv = job->priv;
if (priv->status == status)
return;
job->priv->status = status;
priv->status = status;
g_signal_emit (job, signals[STATUS_CHANGED], 0);
}
......@@ -392,10 +397,14 @@ gtk_print_job_set_source_file (GtkPrintJob *job,
const gchar *filename,
GError **error)
{
GtkPrintJobPrivate *priv;
g_return_val_if_fail (GTK_IS_PRINT_JOB (job), FALSE);
job->priv->spool_file_fd = g_open (filename, O_RDONLY|O_BINARY);
if (job->priv->spool_file_fd < 0)
priv = job->priv;
priv->spool_file_fd = g_open (filename, O_RDONLY|O_BINARY);
if (priv->spool_file_fd < 0)
{
gchar *display_filename = g_filename_display_name (filename);
int save_errno = errno;
......@@ -430,33 +439,38 @@ cairo_surface_t *
gtk_print_job_get_surface (GtkPrintJob *job,
GError **error)
{
GtkPrintJobPrivate *priv;
gchar *filename;
gdouble width, height;
GtkPaperSize *paper_size;
g_return_val_if_fail (GTK_IS_PRINT_JOB (job), NULL);
if (job->priv->surface)
return job->priv->surface;
job->priv->spool_file_fd = g_file_open_tmp ("gtkprint_XXXXXX",
priv = job->priv;
if (priv->surface)
return priv->surface;
g_return_val_if_fail (priv->spool_file_fd == -1, NULL);
priv->spool_file_fd = g_file_open_tmp ("gtkprint_XXXXXX",
&filename,
error);
if (job->priv->spool_file_fd == -1)
if (priv->spool_file_fd == -1)
return NULL;
fchmod (job->priv->spool_file_fd, S_IRUSR | S_IWUSR);
fchmod (priv->spool_file_fd, S_IRUSR | S_IWUSR);
unlink (filename);
paper_size = gtk_page_setup_get_paper_size (job->priv->page_setup);
paper_size = gtk_page_setup_get_paper_size (priv->page_setup);
width = gtk_paper_size_get_width (paper_size, GTK_UNIT_POINTS);
height = gtk_paper_size_get_height (paper_size, GTK_UNIT_POINTS);
job->priv->surface = _gtk_printer_create_cairo_surface (job->priv->printer,
priv->surface = _gtk_printer_create_cairo_surface (priv->printer,
width, height,
job->priv->spool_file_fd);
priv->spool_file_fd);
return job->priv->surface;
return priv->surface;
}
static void
......@@ -467,31 +481,32 @@ gtk_print_job_set_property (GObject *object,
{
GtkPrintJob *job = GTK_PRINT_JOB (object);
GtkPrintJobPrivate *priv = job->priv;
GtkPrintSettings *settings;
switch (prop_id)
{
case GTK_PRINT_JOB_PROP_TITLE:
job->priv->title = g_value_dup_string (value);
priv->title = g_value_dup_string (value);
break;
case GTK_PRINT_JOB_PROP_PRINTER:
job->priv->printer = GTK_PRINTER (g_value_dup_object (value));
job->priv->printer_set = TRUE;
job->priv->backend = g_object_ref (gtk_printer_get_backend (job->priv->printer));
priv->printer = GTK_PRINTER (g_value_dup_object (value));
priv->printer_set = TRUE;
priv->backend = g_object_ref (gtk_printer_get_backend (priv->printer));
break;
case GTK_PRINT_JOB_PROP_PAGE_SETUP:
job->priv->page_setup = GTK_PAGE_SETUP (g_value_dup_object (value));
job->priv->page_setup_set = TRUE;
priv->page_setup = GTK_PAGE_SETUP (g_value_dup_object (value));
priv->page_setup_set = TRUE;
break;
case GTK_PRINT_JOB_PROP_SETTINGS:
/* We save a copy of the settings since we modify
* if when preparing the printer job. */
settings = GTK_PRINT_SETTINGS (g_value_get_object (value));
job->priv->settings = gtk_print_settings_copy (settings);
job->priv->settings_set = TRUE;
priv->settings = gtk_print_settings_copy (settings);
priv->settings_set = TRUE;
break;
default:
......@@ -507,20 +522,21 @@ gtk_print_job_get_property (GObject *object,
GParamSpec *pspec)
{
GtkPrintJob *job = GTK_PRINT_JOB (object);
GtkPrintJobPrivate *priv = job->priv;
switch (prop_id)
{
case GTK_PRINT_JOB_PROP_TITLE:
g_value_set_string (value, job->priv->title);
g_value_set_string (value, priv->title);
break;
case GTK_PRINT_JOB_PROP_PRINTER:
g_value_set_object (value, job->priv->printer);
g_value_set_object (value, priv->printer);
break;
case GTK_PRINT_JOB_PROP_SETTINGS:
g_value_set_object (value, job->priv->settings);
g_value_set_object (value, priv->settings);
break;
case GTK_PRINT_JOB_PROP_PAGE_SETUP:
g_value_set_object (value, job->priv->page_setup);
g_value_set_object (value, priv->page_setup);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......@@ -549,14 +565,18 @@ gtk_print_job_send (GtkPrintJob *job,
GDestroyNotify dnotify,
GError **error)
{
GtkPrintJobPrivate *priv;
g_return_val_if_fail (GTK_IS_PRINT_JOB (job), FALSE);
g_return_val_if_fail (job->priv->spool_file_fd > 0, FALSE);
priv = job->priv;
g_return_val_if_fail (priv->spool_file_fd > 0, FALSE);
gtk_print_job_set_status (job, GTK_PRINT_STATUS_SENDING_DATA);
lseek (job->priv->spool_file_fd, 0, SEEK_SET);
gtk_print_backend_print_stream (job->priv->backend,
lseek (priv->spool_file_fd, 0, SEEK_SET);
gtk_print_backend_print_stream (priv->backend,
job,
job->priv->spool_file_fd,
priv->spool_file_fd,
callback,
user_data,
dnotify);
......
......@@ -80,16 +80,13 @@ unix_finish_send (GtkPrintJob *job,
GError *error)
{
GtkPrintOperationUnix *op_unix;
GtkWindow *parent;
op_unix = (GtkPrintOperationUnix *) user_data;
parent = op_unix->parent;
if (error != NULL)
{
GtkWidget *edialog;
edialog = gtk_message_dialog_new (parent,
edialog = gtk_message_dialog_new (op_unix->parent,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
......@@ -125,16 +122,17 @@ static GtkWidget *
get_print_dialog (GtkPrintOperation *op,
GtkWindow *parent)
{
GtkPrintOperationPrivate *priv = op->priv;
GtkWidget *pd;
GtkPageSetup *page_setup;
pd = gtk_print_unix_dialog_new (NULL, parent);
if (op->priv->print_settings)
if (priv->print_settings)
gtk_print_unix_dialog_set_settings (GTK_PRINT_UNIX_DIALOG (pd),
op->priv->print_settings);
if (op->priv->default_page_setup)
page_setup = gtk_page_setup_copy (op->priv->default_page_setup);
priv->print_settings);
if (priv->default_page_setup)
page_setup = gtk_page_setup_copy (priv->default_page_setup);
else
page_setup = gtk_page_setup_new ();
......@@ -171,6 +169,7 @@ handle_print_response (GtkWidget *dialog,