diff options
author | Robin Watts <robin.watts@artifex.com> | 2013-04-30 13:59:07 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-04-30 15:13:37 +0100 |
commit | 2df69b18472d6ac1989209377916093878317faa (patch) | |
tree | 072999f620fcc90b36a19d3a212a8533d9846ba9 /android | |
parent | eba1aca4d2ea2efc60316d3c8cf53dc0dac2343a (diff) | |
download | mupdf-2df69b18472d6ac1989209377916093878317faa.tar.xz |
Android: Update text handling in android specific code.
Need to update text handling in line with new object types due
to image extraction.
Diffstat (limited to 'android')
-rw-r--r-- | android/jni/mupdf.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/android/jni/mupdf.c b/android/jni/mupdf.c index 2282d7dc..46ddb334 100644 --- a/android/jni/mupdf.c +++ b/android/jni/mupdf.c @@ -928,11 +928,17 @@ bboxcharat(fz_text_page *page, int idx) static int textlen(fz_text_page *page) { - fz_text_block *block; - fz_text_line *line; int len = 0; - for (block = page->blocks; block < page->blocks + page->len; block++) + int block_num; + + for (block_num = 0; block_num < page->len; block_num) { + fz_text_block *block; + fz_text_line *line; + + if (page->blocks[block_num].type != FZ_PAGE_BLOCK_TEXT) + continue; + block = page->blocks[block_num].u.text; for (line = block->lines; line < block->lines + block->len; line++) { int span_num; @@ -1058,7 +1064,7 @@ JNI_FN(MuPDFCore_getOutlineInternal)(JNIEnv * env, jobject thiz) fz_outline *outline; int nItems; globals *glo = get_globals(env, thiz); - int ret; + jobjectArray ret; olClass = (*env)->FindClass(env, PACKAGENAME "/OutlineItem"); if (olClass == NULL) return NULL; @@ -1243,8 +1249,13 @@ JNI_FN(MuPDFCore_text)(JNIEnv * env, jobject thiz) for (b = 0; b < text->len; b++) { - fz_text_block *block = &text->blocks[b]; - jobjectArray *larr = (*env)->NewObjectArray(env, block->len, textLineClass, NULL); + fz_text_block *block; + jobjectArray *larr; + + if (text->blocks[b].type != FZ_PAGE_BLOCK_TEXT) + continue; + block = text->blocks[b].u.text; + larr = (*env)->NewObjectArray(env, block->len, textLineClass, NULL); if (larr == NULL) fz_throw(ctx, "NewObjectArray failed"); for (l = 0; l < block->len; l++) |