From 80db4b8b5f7e0e49a9dd5208dcd55ab7cb80b16c Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Mon, 22 Oct 2007 13:25:20 +0000 Subject: [PATCH] Fix a crash when printing with the gnome-print dialog. Fixes bug #488939. 2007-10-22 Carlos Garcia Campos * backend/pdf/ev-poppler.cc: (pdf_document_file_exporter_begin): * shell/ev-print-job.c: (ev_print_job_class_init): Fix a crash when printing with the gnome-print dialog. Fixes bug #488939. svn path=/trunk/; revision=2713 --- ChangeLog | 8 ++++++++ backend/pdf/ev-poppler.cc | 2 +- shell/ev-print-job.c | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index dab5687d..87f92bbc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-10-22 Carlos Garcia Campos + + * backend/pdf/ev-poppler.cc: (pdf_document_file_exporter_begin): + * shell/ev-print-job.c: (ev_print_job_class_init): + + Fix a crash when printing with the gnome-print dialog. Fixes bug + #488939. + 2007-10-18 Sebastien Bacher * backend/pixbuf/pixbuf-document.c: diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc index 4a783416..c7f4eeed 100644 --- a/backend/pdf/ev-poppler.cc +++ b/backend/pdf/ev-poppler.cc @@ -1530,7 +1530,7 @@ pdf_document_file_exporter_begin (EvFileExporter *exporter, pdf_document->print_ctx = g_new0 (PdfPrintContext, 1); ctx = pdf_document->print_ctx; ctx->format = fc->format; - ctx->pages_per_sheet = fc->pages_per_sheet; + ctx->pages_per_sheet = CLAMP (fc->pages_per_sheet, 1, 16); ctx->paper_width = fc->paper_width; ctx->paper_height = fc->paper_height; diff --git a/shell/ev-print-job.c b/shell/ev-print-job.c index d042ab68..39e334be 100644 --- a/shell/ev-print-job.c +++ b/shell/ev-print-job.c @@ -176,6 +176,7 @@ ev_print_job_class_init (EvPrintJobClass *ev_print_job_class) static void ev_print_job_init (EvPrintJob *ev_print_job) { + ev_print_job->fc.pages_per_sheet = 1; } void -- 2.43.5