From fc4bc43dcd6f6871a47b9198e8c2571a5d448c3e Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Mon, 1 Jun 2009 14:52:21 +0200 Subject: Fix a crash in pdf-inspector --- test/pdf-inspector.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/pdf-inspector.cc') diff --git a/test/pdf-inspector.cc b/test/pdf-inspector.cc index aba4a71b..ce09757a 100644 --- a/test/pdf-inspector.cc +++ b/test/pdf-inspector.cc @@ -214,6 +214,8 @@ PdfInspector::analyze_page (int page) void *p; GtkWidget *label; char *text; + cairo_t *cr; + cairo_surface_t *surface; label = glade_xml_get_widget (xml, "pdf_total_label"); @@ -221,7 +223,15 @@ PdfInspector::analyze_page (int page) gtk_list_store_clear (GTK_LIST_STORE (model)); GooTimer timer; + surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, + doc->getPageCropWidth(page + 1), + doc->getPageCropHeight(page + 1)); + cr = cairo_create (surface); + cairo_surface_destroy (surface); + output->setCairo (cr); + cairo_destroy (cr); doc->displayPage (output, page + 1, 72, 72, 0, gFalse, gTrue, gTrue); + output->setCairo (NULL); // Total time; text = g_strdup_printf ("%g", timer.getElapsed ()); @@ -331,6 +341,7 @@ main (int argc, char *argv []) globalParams = new GlobalParams(); globalParams->setProfileCommands (true); + globalParams->setPrintCommands (true); if (argc == 2) file_name = argv[1]; -- cgit v1.2.3