summaryrefslogtreecommitdiff
path: root/platform/java/mupdf_native.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-06-19 13:15:31 +0200
committerRobin Watts <robin.watts@artifex.com>2018-06-22 16:48:50 +0100
commitf7ace61076d0ab3c71e1d2bd70967ddb0b86f220 (patch)
tree8bd8b4fe4d7414685d162f66911e9951ea3dce16 /platform/java/mupdf_native.c
parent148b0934370336fc8b260e8c3aef83daf4d80ba4 (diff)
downloadmupdf-f7ace61076d0ab3c71e1d2bd70967ddb0b86f220.tar.xz
Keep copy of decoded utf8 text string in pdf_obj.
Removes the need to alloc/free text strings in the API, allowing for simple functions like pdf_dict_get_text_string.
Diffstat (limited to 'platform/java/mupdf_native.c')
-rw-r--r--platform/java/mupdf_native.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c
index 74ba2d11..8e9e9f3f 100644
--- a/platform/java/mupdf_native.c
+++ b/platform/java/mupdf_native.c
@@ -8800,7 +8800,7 @@ FUN(PDFAnnotation_getContents)(JNIEnv *env, jobject self)
if (!ctx || !annot) return NULL;
fz_try(ctx)
- contents = pdf_copy_annot_contents(ctx, annot);
+ contents = pdf_get_annot_contents(ctx, annot);
fz_catch(ctx)
{
jni_rethrow(env, ctx);
@@ -8808,7 +8808,6 @@ FUN(PDFAnnotation_getContents)(JNIEnv *env, jobject self)
}
result = (*env)->NewStringUTF(env, contents);
- fz_free(ctx, contents);
return result;
}
@@ -8846,7 +8845,7 @@ FUN(PDFAnnotation_getAuthor)(JNIEnv *env, jobject self)
if (!ctx || !annot) return NULL;
fz_try(ctx)
- author = pdf_copy_annot_author(ctx, annot);
+ author = pdf_get_annot_author(ctx, annot);
fz_catch(ctx)
{
jni_rethrow(env, ctx);