From 55b20c348352b2d5e3bf802bc57fae6b850ff674 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 14 Nov 2016 15:04:29 +0100 Subject: pdf: Don't pass form UI events to link annotations. Don't try handling them both as links and form widgets. --- source/pdf/pdf-form.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/pdf/pdf-form.c b/source/pdf/pdf-form.c index f4c5278c..02f0d87d 100644 --- a/source/pdf/pdf-form.c +++ b/source/pdf/pdf-form.c @@ -596,14 +596,21 @@ int pdf_pass_event(fz_context *ctx, pdf_document *doc, pdf_page *page, pdf_ui_ev break; } + /* Skip hidden annotations. */ if (annot) { int f = pdf_to_int(ctx, pdf_dict_get(ctx, annot->obj, PDF_NAME_F)); - if (f & (PDF_ANNOT_IS_HIDDEN|PDF_ANNOT_IS_NO_VIEW)) annot = NULL; } + /* Skip Link annotations. */ + if (annot) + { + if (pdf_name_eq(ctx, pdf_dict_get(ctx, annot->obj, PDF_NAME_Subtype), PDF_NAME_Link)) + annot = NULL; + } + switch (ui_event->etype) { case PDF_EVENT_TYPE_POINTER: -- cgit v1.2.3