summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-form.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-07-02 12:06:05 +0200
committerTor Andersson <tor.andersson@artifex.com>2018-07-05 15:32:34 +0200
commit4cda8ae62880a807a3b19d68b5407eafeea6e338 (patch)
tree2288e7e6e86f4ed5c724fa0b6d91a8f0e94e28b0 /source/pdf/pdf-form.c
parent100606af20710f8e335ace0fd0a34e78208d28dc (diff)
downloadmupdf-4cda8ae62880a807a3b19d68b5407eafeea6e338.tar.xz
Return true if any annots have new APs in pdf_update_page.
Diffstat (limited to 'source/pdf/pdf-form.c')
-rw-r--r--source/pdf/pdf-form.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/pdf/pdf-form.c b/source/pdf/pdf-form.c
index 93b88e2c..16811edd 100644
--- a/source/pdf/pdf-form.c
+++ b/source/pdf/pdf-form.c
@@ -42,14 +42,10 @@ static void pdf_field_mark_dirty(fz_context *ctx, pdf_document *doc, pdf_obj *fi
if (kids)
{
int i, n = pdf_array_len(ctx, kids);
-
for (i = 0; i < n; i++)
pdf_field_mark_dirty(ctx, doc, pdf_array_get(ctx, kids, i));
}
- else
- {
- pdf_dirty_obj(ctx, field);
- }
+ pdf_dirty_obj(ctx, field);
}
static void update_field_value(fz_context *ctx, pdf_document *doc, pdf_obj *obj, const char *text)
@@ -622,14 +618,18 @@ int pdf_pass_event(fz_context *ctx, pdf_document *doc, pdf_page *page, pdf_ui_ev
return changed;
}
-void pdf_update_page(fz_context *ctx, pdf_page *page)
+int
+pdf_update_page(fz_context *ctx, pdf_page *page)
{
pdf_annot *annot;
-
+ int changed = 0;
for (annot = page->annots; annot; annot = annot->next)
{
pdf_update_annot(ctx, annot);
+ if (annot->has_new_ap)
+ changed = 1;
}
+ return changed;
}
pdf_widget *pdf_focused_widget(fz_context *ctx, pdf_document *doc)