summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2016-07-17 16:51:37 +0800
committerSebastian Rasmussen <sebras@gmail.com>2016-07-17 22:33:52 +0800
commit8625af9d32111e555eef595d6fcca739b0249253 (patch)
treeed902b69b400489bca84c384fc865e99af352626
parentab9415f28a357adbc53f45e0187c6bf90ade540b (diff)
downloadmupdf-8625af9d32111e555eef595d6fcca739b0249253.tar.xz
JNI: Cleanup of Annotation and PDFObject_toByteString.
-rw-r--r--platform/java/mupdf_native.c12
-rw-r--r--platform/java/src/com/artifex/mupdf/fitz/Page.java3
2 files changed, 6 insertions, 9 deletions
diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c
index e960cb5c..d7870c0a 100644
--- a/platform/java/mupdf_native.c
+++ b/platform/java/mupdf_native.c
@@ -3970,7 +3970,7 @@ FUN(Page_getAnnotations)(JNIEnv *env, jobject self)
fz_context *ctx = get_context(env);
fz_page *page = from_Page(env, self);
fz_annot *annot = NULL;
- fz_annot *first = NULL;
+ fz_annot *annots = NULL;
jobject jannots = NULL;
int annot_count;
int i;
@@ -3985,10 +3985,10 @@ FUN(Page_getAnnotations)(JNIEnv *env, jobject self)
{
jannots = (*env)->GetObjectField(env, self, fid_Page_nativeAnnots);
- first = fz_first_annot(ctx, page);
+ annots = fz_first_annot(ctx, page);
/* Count the annotations */
- annot = first;
+ annot = annots;
for (annot_count = 0; annot != NULL; annot_count++)
annot = fz_next_annot(ctx, annot);
@@ -3997,9 +3997,7 @@ FUN(Page_getAnnotations)(JNIEnv *env, jobject self)
/* If no annotations, we don't want an annotation
* object stored in the page. */
if (jannots != NULL)
- {
(*env)->SetObjectField(env, self, fid_Page_nativeAnnots, NULL);
- }
break; /* No annotations! */
}
@@ -4009,7 +4007,7 @@ FUN(Page_getAnnotations)(JNIEnv *env, jobject self)
(*env)->SetObjectField(env, self, fid_Page_nativeAnnots, jannots);
/* Now run through actually creating the annotation objects */
- annot = first;
+ annot = annots;
for (i = 0; annot != NULL && i < annot_count; i++)
{
jobject jannot = to_Annotation(ctx, env, annot);
@@ -6129,9 +6127,9 @@ FUN(PDFObject_toByteString)(JNIEnv *env, jobject self)
{
fz_context *ctx = get_context(env);
pdf_obj *obj = from_PDFObject(env, self);
- signed char *bs = NULL;
const char *str = NULL;
jobject jbs = NULL;
+ jbyte *bs = NULL;
if (ctx == NULL || obj == NULL)
return 0;
diff --git a/platform/java/src/com/artifex/mupdf/fitz/Page.java b/platform/java/src/com/artifex/mupdf/fitz/Page.java
index 64fe4030..7763df04 100644
--- a/platform/java/src/com/artifex/mupdf/fitz/Page.java
+++ b/platform/java/src/com/artifex/mupdf/fitz/Page.java
@@ -24,13 +24,12 @@ public class Page
public native void run(Device dev, Matrix ctm, Cookie cookie);
public native void runPageContents(Device dev, Matrix ctm, Cookie cookie);
- public native Annotation[] getAnnotations();
public void run(Device dev, Matrix ctm) {
run(dev, ctm, null);
}
- // FIXME: Later
+ public native Annotation[] getAnnotations();
public native Link[] getLinks();
// FIXME: Later. Much later.