Changeset 256
- Timestamp:
- 10/17/06 11:55:46 (2 years ago)
- Files:
-
- trunk/src/PDFDocument.cxx (modified) (9 diffs)
- trunk/src/main.cxx (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/PDFDocument.cxx
r222 r256 17 17 18 18 #include <config.h> 19 #include <gdk/gdk.h> 19 20 #include <time.h> 20 21 #include <poppler.h> … … 159 160 { 160 161 PopplerRectangle *matchRect = (PopplerRectangle *)match->data; 161 DocumentRectangle *rect = 162 DocumentRectangle *rect = 162 163 new DocumentRectangle (matchRect->x1, 163 164 (height - matchRect->y2), … … 222 223 if ( POPPLER_ERROR == loadError->domain ) 223 224 { 224 errorCode = DocumentErrorEncrypted; 225 errorCode = DocumentErrorEncrypted; 225 226 } 226 227 else … … 231 232 // Maybe I'm wrong (very probable) but that's a wrong way. 232 233 // So I'm reading the error code from the error string... 233 sscanf (loadError->message, "Failed to load document (error %d)", 234 sscanf (loadError->message, "Failed to load document (error %d)", 234 235 (gint *)&errorCode); 235 236 } … … 237 238 // Get our error message. 238 239 gchar *errorMessage = IDocument::getErrorMessage (errorCode); 239 g_set_error (error, 240 g_set_error (error, 240 241 EPDFVIEW_DOCUMENT_ERROR, errorCode, 241 242 _("Failed to load document '%s'.\n%s\n"), … … 261 262 m_Outline = new DocumentOutline (); 262 263 setOutline (m_Outline, outline); 264 // XXX: I still don't know why, but it seems that if I don't request 265 // a page here, when rendering a page Glib tells me 266 // that cannot register existing type `PopplerPage'... Yes, this 267 // is a kludge, but I don't know enough to check it why it does that. 268 PopplerPage *page = poppler_document_get_page (m_Document, 0); 269 if ( NULL != page ) 270 { 271 g_object_unref (G_OBJECT (page)); 272 } 263 273 264 274 return TRUE; … … 402 412 do 403 413 { 404 PopplerAction *action = 414 PopplerAction *action = 405 415 poppler_index_iter_get_action (childrenList); 406 416 if ( POPPLER_ACTION_GOTO_DEST == action->type ) … … 469 479 poppler_page_get_size (page, &pageHeight, &pageWidth); 470 480 } 471 else 481 else 472 482 { 473 483 poppler_page_get_size (page, &pageWidth, &pageHeight); … … 529 539 } 530 540 } 531 532 541 533 542 /// trunk/src/main.cxx
r148 r256 45 45 exit (EXIT_FAILURE); 46 46 } 47 // Initialise the working thread. 48 IJob::init (); 47 49 // Initialise the GTK library. 48 50 gtk_init (&argc, &argv); 49 51 g_set_application_name (_("PDF Viewer")); 50 // Initialise the working thread.51 IJob::init ();52 52 // Create the main presenter. 53 53 PDFDocument *document = new PDFDocument; … … 65 65 document->load (argv[1], NULL); 66 66 } 67 67 68 gtk_main(); 68 69 69 70 // There's no need for us to delete the main view, as it's 70 71 // the presenter's responsibility. … … 73 74 // Save the configuration. 74 75 Config::getConfig().save (); 75 76 76 77 // All done!. 77 78 return EXIT_SUCCESS;
