summaryrefslogtreecommitdiff
path: root/backend/pdf/ev-poppler.cc
diff options
context:
space:
mode:
authorJosé Aliste <[email protected]>2013-02-13 16:24:35 +0100
committerraveit65 <[email protected]>2017-08-28 16:04:00 +0200
commit998dea356a0d26d4654c066af22363d274f35924 (patch)
treec2c8eb1c3c5903d734a4ec900fb239053ed0668e /backend/pdf/ev-poppler.cc
parent92bc7323814536b183b6091ee3be692e8e2a702d (diff)
downloadatril-998dea356a0d26d4654c066af22363d274f35924.tar.bz2
atril-998dea356a0d26d4654c066af22363d274f35924.tar.xz
pdf: Add activation link for Fields that have it.
origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=01254fb
Diffstat (limited to 'backend/pdf/ev-poppler.cc')
-rw-r--r--backend/pdf/ev-poppler.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc
index 0ba8c0bf..3e999111 100644
--- a/backend/pdf/ev-poppler.cc
+++ b/backend/pdf/ev-poppler.cc
@@ -2128,16 +2128,19 @@ pdf_document_get_crop_box (EvDocument *document,
#endif
static EvFormField *
-ev_form_field_from_poppler_field (PopplerFormField *poppler_field)
+ev_form_field_from_poppler_field (PdfDocument *pdf_document,
+ PopplerFormField *poppler_field)
{
EvFormField *ev_field = NULL;
gint id;
gdouble font_size;
gboolean is_read_only;
+ PopplerAction *action;
id = poppler_form_field_get_id (poppler_field);
font_size = poppler_form_field_get_font_size (poppler_field);
is_read_only = poppler_form_field_is_read_only (poppler_field);
+ action = poppler_form_field_get_action (poppler_field);
switch (poppler_form_field_get_field_type (poppler_field)) {
case POPPLER_FORM_FIELD_TEXT: {
@@ -2228,6 +2231,9 @@ ev_form_field_from_poppler_field (PopplerFormField *poppler_field)
ev_field->font_size = font_size;
ev_field->is_read_only = is_read_only;
+ if (action)
+ ev_field->activation_link = ev_link_from_action (pdf_document, action);
+
return ev_field;
}
@@ -2254,7 +2260,7 @@ pdf_document_forms_get_form_fields (EvDocumentForms *document,
mapping = (PopplerFormFieldMapping *)list->data;
- ev_field = ev_form_field_from_poppler_field (mapping->field);
+ ev_field = ev_form_field_from_poppler_field (PDF_DOCUMENT (document), mapping->field);
if (!ev_field)
continue;