From e9cf056f2d69b6ca5cb66f339978e461911e9c02 Mon Sep 17 00:00:00 2001 From: Paul Gardiner Date: Wed, 19 Sep 2012 14:59:36 +0100 Subject: Forms: correct bug in form reset If the 'fields' parameter is not present then all fields should be reset --- pdf/pdf_form.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pdf/pdf_form.c b/pdf/pdf_form.c index 76e28058..4cbf6614 100644 --- a/pdf/pdf_form.c +++ b/pdf/pdf_form.c @@ -1589,7 +1589,9 @@ static void reset_form(pdf_document *doc, pdf_obj *fields, int exclude) pdf_obj *form = pdf_dict_getp(doc->trailer, "Root/AcroForm/Fields"); int i, n; - if (exclude) + /* The 'fields' array not being present signals that all fields + * should be reset, so handle it using the exclude case - excluding none */ + if (exclude || !fields) { /* mark the fields we don't want to reset */ pdf_obj *nil = pdf_new_null(ctx); -- cgit v1.2.3