summaryrefslogtreecommitdiff
path: root/backend/pdf
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-12-09 12:43:23 +0100
committerinfirit <[email protected]>2014-12-09 23:02:27 +0100
commit07ac65d00384adeec314e677a66a5bb2dcb90cd0 (patch)
tree4f38751d399031395d0c8ee27daa0bb29cef8259 /backend/pdf
parent9ddd72c4f3e5e545a109d619c4e7faf2e90eca9f (diff)
downloadatril-07ac65d00384adeec314e677a66a5bb2dcb90cd0.tar.bz2
atril-07ac65d00384adeec314e677a66a5bb2dcb90cd0.tar.xz
[pdf] Implement document_links_find_link_page()
Taken from evince commit: 42fdab936eef083c81a9e6798ffea2c4bfab3842 From: Carlos Garcia Campos <[email protected]>
Diffstat (limited to 'backend/pdf')
-rw-r--r--backend/pdf/ev-poppler.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc
index 6b3412a3..4fd62dce 100644
--- a/backend/pdf/ev-poppler.cc
+++ b/backend/pdf/ev-poppler.cc
@@ -1324,6 +1324,25 @@ pdf_document_links_find_link_dest (EvDocumentLinks *document_links,
return ev_dest;
}
+static gint
+pdf_document_links_find_link_page (EvDocumentLinks *document_links,
+ const gchar *link_name)
+{
+ PdfDocument *pdf_document;
+ PopplerDest *dest;
+ gint retval = -1;
+
+ pdf_document = PDF_DOCUMENT (document_links);
+ dest = poppler_document_find_dest (pdf_document->document,
+ link_name);
+ if (dest) {
+ retval = dest->page_num - 1;
+ poppler_dest_free (dest);
+ }
+
+ return retval;
+}
+
static void
pdf_document_document_links_iface_init (EvDocumentLinksInterface *iface)
{
@@ -1331,6 +1350,7 @@ pdf_document_document_links_iface_init (EvDocumentLinksInterface *iface)
iface->get_links_model = pdf_document_links_get_links_model;
iface->get_links = pdf_document_links_get_links;
iface->find_link_dest = pdf_document_links_find_link_dest;
+ iface->find_link_page = pdf_document_links_find_link_page;
}
static EvMappingList *