diff options
author | Carlos Garcia Campos <carlosgc@gnome.org> | 2009-06-01 14:52:21 +0200 |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2009-06-16 16:34:16 +0200 |
commit | fc4bc43dcd6f6871a47b9198e8c2571a5d448c3e (patch) | |
tree | 5bdee5bd382f14a39938dfb3000b54b68f1c7bb8 /test | |
parent | 3da7a2657892fde52b62e1f73476cb33d6c75e96 (diff) |
Fix a crash in pdf-inspector
Diffstat (limited to 'test')
-rw-r--r-- | test/pdf-inspector.cc | 11 |
1 files changed, 11 insertions, 0 deletions
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]; |