diff options
author | Paul Gardiner <paulg.artifex@glidos.net> | 2012-10-16 15:13:39 +0100 |
---|---|---|
committer | Paul Gardiner <paulg.artifex@glidos.net> | 2012-10-16 15:13:39 +0100 |
commit | 96f335bc84756cddc094bb44df28223a546808a0 (patch) | |
tree | 89898c3aa0dee293629e1171a8ec64ee954cd501 /android | |
parent | 31791f3ebe049af8dccacd5871c0aeac7dc86b29 (diff) | |
download | mupdf-96f335bc84756cddc094bb44df28223a546808a0.tar.xz |
Forms: avoid the need to reload the page on every change
Add pdf_update_annot, which is called before rendering an annotation, and
checks that the annotation structure has correct information. There are
three reasons the information can be out of date.
Attributes of a field may have been changed such that its appearance
stream needs updating. In this case the field will have have "Dirty"
added to its dictionary
The mouse may have changed state over the field, and a different
appearance stream needs selecting. The annotation structure now records
the mouse states for which the current appearance stream is acceptable.
The field may have changed state as recorded by its "AS" value, and a
different appearance stream needs selecting.
Diffstat (limited to 'android')
-rw-r--r-- | android/jni/mupdf.c | 6 | ||||
-rw-r--r-- | android/src/com/artifex/mupdf/MuPDFCore.java | 10 |
2 files changed, 5 insertions, 11 deletions
diff --git a/android/jni/mupdf.c b/android/jni/mupdf.c index 2ec02bf8..2adc3b7c 100644 --- a/android/jni/mupdf.c +++ b/android/jni/mupdf.c @@ -150,10 +150,10 @@ Java_com_artifex_mupdf_MuPDFCore_gotoPageInternal(JNIEnv *env, jobject thiz, int JNIEXPORT void JNICALL Java_com_artifex_mupdf_MuPDFCore_markDirtyInternal(JNIEnv *env, jobject thiz, int page) { - if (currentPage != NULL && page == pagenum) + if (currentPageList != NULL && page == pagenum) { - fz_free_page(doc, currentPage); - currentPage = NULL; + fz_free_display_list(ctx, currentPageList); + currentPageList = NULL; } } diff --git a/android/src/com/artifex/mupdf/MuPDFCore.java b/android/src/com/artifex/mupdf/MuPDFCore.java index f2017f77..2e0db110 100644 --- a/android/src/com/artifex/mupdf/MuPDFCore.java +++ b/android/src/com/artifex/mupdf/MuPDFCore.java @@ -114,12 +114,8 @@ public class MuPDFCore break; } - if (changed) { - if (page == pageNum) - pageNum = -1; - + if (changed) markDirtyInternal(page); - } return new PassClickResult(changed, wtype, text); } @@ -129,10 +125,8 @@ public class MuPDFCore gotoPage(page); success = setFocusedWidgetTextInternal(text) != 0 ? true : false; - if (success) { - pageNum = -1; + if (success) markDirtyInternal(page); - } return success; } |