Commit e63cb095 authored by Carlos Garcia Campos's avatar Carlos Garcia Campos

Use EvPage instead of page index to get links

So that we can re-use the page object instead of creating and deleting a
new one.
parent e3c697ad
......@@ -697,9 +697,9 @@ djvu_document_find_iface_init (EvDocumentFindIface *iface)
static GList *
djvu_document_links_get_links (EvDocumentLinks *document_links,
gint page)
EvPage *page)
{
return djvu_links_get_links (document_links, page, SCALE_FACTOR);
return djvu_links_get_links (document_links, page->index, SCALE_FACTOR);
}
static void
......
......@@ -1260,7 +1260,7 @@ pdf_document_links_get_links_model (EvDocumentLinks *document_links)
static GList *
pdf_document_links_get_links (EvDocumentLinks *document_links,
gint page)
EvPage *page)
{
PdfDocument *pdf_document;
PopplerPage *poppler_page;
......@@ -1270,8 +1270,7 @@ pdf_document_links_get_links (EvDocumentLinks *document_links,
double height;
pdf_document = PDF_DOCUMENT (document_links);
poppler_page = poppler_document_get_page (pdf_document->document,
page);
poppler_page = POPPLER_PAGE (page->backend_page);
mapping_list = poppler_page_get_link_mapping (poppler_page);
poppler_page_get_size (poppler_page, NULL, &height);
......@@ -1293,7 +1292,6 @@ pdf_document_links_get_links (EvDocumentLinks *document_links,
}
poppler_page_free_link_mapping (mapping_list);
g_object_unref (poppler_page);
return g_list_reverse (retval);
}
......
......@@ -56,7 +56,7 @@ ev_document_links_get_links_model (EvDocumentLinks *document_links)
GList *
ev_document_links_get_links (EvDocumentLinks *document_links,
gint page)
EvPage *page)
{
EvDocumentLinksIface *iface = EV_DOCUMENT_LINKS_GET_IFACE (document_links);
GList *retval;
......
......@@ -63,7 +63,7 @@ struct _EvDocumentLinksIface
gboolean (* has_document_links) (EvDocumentLinks *document_links);
GtkTreeModel *(* get_links_model) (EvDocumentLinks *document_links);
GList *(* get_links) (EvDocumentLinks *document_links,
gint page);
EvPage *page);
EvLinkDest *(* find_link_dest) (EvDocumentLinks *document_links,
const gchar *link_name);
};
......@@ -73,7 +73,7 @@ gboolean ev_document_links_has_document_links (EvDocumentLinks *document_li
GtkTreeModel *ev_document_links_get_links_model (EvDocumentLinks *document_links);
GList *ev_document_links_get_links (EvDocumentLinks *document_links,
gint page);
EvPage *page);
EvLinkDest *ev_document_links_find_link_dest (EvDocumentLinks *document_links,
const gchar *link_name);
......
......@@ -598,7 +598,7 @@ ev_job_page_data_run (EvJob *job)
ev_selection_get_selection_map (EV_SELECTION (job->document), ev_page);
if ((job_pd->flags & EV_PAGE_DATA_INCLUDE_LINKS) && EV_IS_DOCUMENT_LINKS (job->document))
job_pd->link_mapping =
ev_document_links_get_links (EV_DOCUMENT_LINKS (job->document), job_pd->page);
ev_document_links_get_links (EV_DOCUMENT_LINKS (job->document), ev_page);
if ((job_pd->flags & EV_PAGE_DATA_INCLUDE_FORMS) && EV_IS_DOCUMENT_FORMS (job->document))
job_pd->form_field_mapping =
ev_document_forms_get_form_fields (EV_DOCUMENT_FORMS (job->document),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment