From b7df29cce7f4815a2109f7b4339674c1e662e883 Mon Sep 17 00:00:00 2001 From: Paul Gardiner Date: Thu, 23 Aug 2018 14:48:27 +0100 Subject: Honour the read-only form-field flag. Avoid pdf_pass_event interacting with widgets that have the read-only field set. --- source/pdf/pdf-form.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/pdf/pdf-form.c b/source/pdf/pdf-form.c index ea2c5887..af0f572d 100644 --- a/source/pdf/pdf-form.c +++ b/source/pdf/pdf-form.c @@ -546,11 +546,12 @@ int pdf_pass_event(fz_context *ctx, pdf_document *doc, pdf_page *page, pdf_ui_ev annot = a; } - /* Skip hidden annotations. */ + /* Skip hidden annotations and read-only widgets. */ if (annot) { + int ff = pdf_dict_get_int(ctx, annot->obj, PDF_NAME(Ff)); int f = pdf_dict_get_int(ctx, annot->obj, PDF_NAME(F)); - if (f & (PDF_ANNOT_IS_HIDDEN|PDF_ANNOT_IS_NO_VIEW)) + if (f & (PDF_ANNOT_IS_HIDDEN|PDF_ANNOT_IS_NO_VIEW) || ff & PDF_FIELD_IS_READ_ONLY) annot = NULL; } -- cgit v1.2.3