diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-07-06 14:20:26 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-08-10 12:09:10 +0200 |
commit | 0abcccc4aab4d893ac2a0ef116ff1f0c006fbc30 (patch) | |
tree | 8fe312208afaf28e2d759f4a1c53ec4ef131124f /source/pdf/pdf-appearance.c | |
parent | 6f8cb5606e426084160eaec82e9c11966e7fb5f4 (diff) | |
download | mupdf-0abcccc4aab4d893ac2a0ef116ff1f0c006fbc30.tar.xz |
Rejig pdf_update_page and pdf_update_annot.
The intent is for a user to iterate over the annotations on a page calling
pdf_update_annot for each one. If this function returns true, then the
annotation has changed since the last time it was called, and the user
needs to re-render.
pdf_update_page is a simple loop over the annotations on a page, for use
if you only care about page level granularity.
Users should no longer look at or change the pdf_annot.has_new_ap field.
Diffstat (limited to 'source/pdf/pdf-appearance.c')
-rw-r--r-- | source/pdf/pdf-appearance.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/pdf/pdf-appearance.c b/source/pdf/pdf-appearance.c index 67a01fa9..fb5b8343 100644 --- a/source/pdf/pdf-appearance.c +++ b/source/pdf/pdf-appearance.c @@ -1373,11 +1373,12 @@ void pdf_update_appearance(fz_context *ctx, pdf_annot *annot) } } -void +int pdf_update_annot(fz_context *ctx, pdf_annot *annot) { pdf_document *doc = annot->page->doc; pdf_obj *obj, *ap, *as, *n; + int changed = 0; /* TODO: handle form field updates without using the annot pdf_obj dirty flag */ obj = annot->obj; @@ -1415,4 +1416,8 @@ pdf_update_annot(fz_context *ctx, pdf_annot *annot) annot->has_new_ap = 1; } } + + changed = annot->has_new_ap; + annot->has_new_ap = 0; + return changed; } |