summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-form.c
diff options
context:
space:
mode:
authorPaul Gardiner <paul.gardiner@artifex.com>2018-08-23 14:48:27 +0100
committerPaul Gardiner <paul.gardiner@artifex.com>2018-08-23 15:03:20 +0100
commitb7df29cce7f4815a2109f7b4339674c1e662e883 (patch)
tree52e385158be5a4b3583185ce68c6335bdf584e4c /source/pdf/pdf-form.c
parent04c37454b9ef5a0576c3dd34adc7426450bf18e7 (diff)
downloadmupdf-b7df29cce7f4815a2109f7b4339674c1e662e883.tar.xz
Honour the read-only form-field flag.
Avoid pdf_pass_event interacting with widgets that have the read-only field set.
Diffstat (limited to 'source/pdf/pdf-form.c')
-rw-r--r--source/pdf/pdf-form.c5
1 files 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;
}