]> www.fi.muni.cz Git - evince.git/commitdiff
Use EvPage instead of page index to get images
authorCarlos Garcia Campos <carlosgc@gnome.org>
Wed, 9 Dec 2009 17:36:17 +0000 (18:36 +0100)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Wed, 9 Dec 2009 17:36:17 +0000 (18:36 +0100)
So that we can re-use the page object instead of creating and deleting a
new one.

backend/pdf/ev-poppler.cc
libdocument/ev-document-images.c
libdocument/ev-document-images.h
libview/ev-jobs.c

index 82cde9e311893145d439369c06eac7172aa9969b..6d1c937a9401d231b6e1cec1d9d73831c7657f41 100644 (file)
@@ -1326,7 +1326,7 @@ pdf_document_document_links_iface_init (EvDocumentLinksIface *iface)
 
 static GList *
 pdf_document_images_get_image_mapping (EvDocumentImages *document_images,
-                                      gint              page)
+                                      EvPage           *page)
 {
        GList *retval = NULL;
        PdfDocument *pdf_document;
@@ -1335,7 +1335,7 @@ pdf_document_images_get_image_mapping (EvDocumentImages *document_images,
        GList *list;
 
        pdf_document = PDF_DOCUMENT (document_images);
-       poppler_page = poppler_document_get_page (pdf_document->document, page);
+       poppler_page = POPPLER_PAGE (page->backend_page);
        mapping_list = poppler_page_get_image_mapping (poppler_page);
 
        for (list = mapping_list; list; list = list->next) {
@@ -1346,7 +1346,7 @@ pdf_document_images_get_image_mapping (EvDocumentImages *document_images,
 
                ev_image_mapping = g_new (EvMapping, 1);
                
-               ev_image_mapping->data = ev_image_new (page, image_mapping->image_id);
+               ev_image_mapping->data = ev_image_new (page->index, image_mapping->image_id);
                ev_image_mapping->area.x1 = image_mapping->area.x1;
                ev_image_mapping->area.y1 = image_mapping->area.y1;
                ev_image_mapping->area.x2 = image_mapping->area.x2;
@@ -1356,7 +1356,6 @@ pdf_document_images_get_image_mapping (EvDocumentImages *document_images,
        }
 
        poppler_page_free_image_mapping (mapping_list);
-       g_object_unref (poppler_page);
 
        return g_list_reverse (retval);
 }
index 1754ded2f4fe0a5e0591f116c6ae69136705bd47..a7f85f0ccf6255caf8511e3d45154aad4d68a913 100644 (file)
@@ -30,7 +30,7 @@ ev_document_images_class_init (EvDocumentImagesIface *klass)
 
 GList *
 ev_document_images_get_image_mapping (EvDocumentImages *document_images,
-                                     gint              page)
+                                     EvPage           *page)
 {
        EvDocumentImagesIface *iface = EV_DOCUMENT_IMAGES_GET_IFACE (document_images);
 
index d9d76965822000af97063320e1419b82718d2690..95b2ac7d6d0035410dcc71e03a9aa5106349bc79 100644 (file)
@@ -48,14 +48,14 @@ struct _EvDocumentImagesIface {
 
         /* Methods  */
         GList     *(* get_image_mapping) (EvDocumentImages *document_images,
-                                         gint              page);
+                                         EvPage           *page);
        GdkPixbuf *(* get_image)         (EvDocumentImages *document_images,
                                          EvImage          *image);
 };
 
 GType      ev_document_images_get_type            (void) G_GNUC_CONST;
 GList     *ev_document_images_get_image_mapping   (EvDocumentImages *document_images,
-                                                  gint              page);
+                                                  EvPage           *page);
 GdkPixbuf *ev_document_images_get_image           (EvDocumentImages *document_images,
                                                   EvImage          *image);
 
index ac716308da3c55af4cbac7abec20ff9cce48aff1..20f4ee21775719e6620dd4adafe58a2a13b5a73b 100644 (file)
@@ -606,7 +606,7 @@ ev_job_page_data_run (EvJob *job)
        if ((job_pd->flags & EV_PAGE_DATA_INCLUDE_IMAGES) && EV_IS_DOCUMENT_IMAGES (job->document))
                job_pd->image_mapping =
                        ev_document_images_get_image_mapping (EV_DOCUMENT_IMAGES (job->document),
-                                                             job_pd->page);
+                                                             ev_page);
        if ((job_pd->flags & EV_PAGE_DATA_INCLUDE_ANNOTS) && EV_IS_DOCUMENT_ANNOTATIONS (job->document))
                job_pd->annot_mapping =
                        ev_document_annotations_get_annotations (EV_DOCUMENT_ANNOTATIONS (job->document),