Bug 704078: Resolve stray javascript validation events.
authorRobin Watts <[email protected]>
Thu, 22 Jul 2021 11:53:25 +0000 (12:53 +0100)
committerRobin Watts <[email protected]>
Thu, 22 Jul 2021 11:53:25 +0000 (12:53 +0100)
pdf_field_event_format is calling the keystroke event, rather than
the format event. This means we are giving spurious warnings at
unexpected times (document load/widget resynthesis etc).

The fix is just to call the correct event. Credit to Tor for spotting
the 1 character typo!

source/pdf/pdf-form.c

index e809894873dbd97a9f4ab23fa770c40a164683db..73a24d9415d86239ff256174e9c10fb4f0ff6255 100644 (file)
@@ -2105,7 +2105,7 @@ char *pdf_field_event_format(fz_context *ctx, pdf_document *doc, pdf_obj *field)
        pdf_js *js = doc->js;
        if (js)
        {
-               pdf_obj *action = pdf_dict_getp_inheritable(ctx, field, "AA/K/JS");
+               pdf_obj *action = pdf_dict_getp_inheritable(ctx, field, "AA/F/JS");
                if (action)
                {
                        const char *value = pdf_field_value(ctx, field);