From 6d869a15eb33bdda06a737d2af6c04139e2b3bfe Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Tue, 7 May 2013 13:04:41 +0100 Subject: Android: Fix android build. Update android build in line with text extraction structure changes. --- android/jni/Core.mk | 1 + android/jni/Core2.mk | 1 + android/jni/mupdf.c | 18 ++++++++++++------ 3 files changed, 14 insertions(+), 6 deletions(-) (limited to 'android') diff --git a/android/jni/Core.mk b/android/jni/Core.mk index 3f18da28..73e6a08c 100644 --- a/android/jni/Core.mk +++ b/android/jni/Core.mk @@ -33,6 +33,7 @@ LOCAL_C_INCLUDES := \ ../xps \ ../cbz \ ../image \ + ../ucdn \ ../scripts \ .. ifdef V8_BUILD diff --git a/android/jni/Core2.mk b/android/jni/Core2.mk index 3c8c1841..9a7c0de9 100644 --- a/android/jni/Core2.mk +++ b/android/jni/Core2.mk @@ -33,6 +33,7 @@ LOCAL_C_INCLUDES := \ ../pdf \ ../xps \ ../cbz \ + ../ucdn \ ../scripts \ .. ifdef V8_BUILD diff --git a/android/jni/mupdf.c b/android/jni/mupdf.c index d5e4d5fa..8382c27c 100644 --- a/android/jni/mupdf.c +++ b/android/jni/mupdf.c @@ -941,10 +941,10 @@ textlen(fz_text_page *page) block = page->blocks[block_num].u.text; for (line = block->lines; line < block->lines + block->len; line++) { - int span_num; - for (span_num = 0; span_num < line->len; span_num++) + fz_text_span *span; + + for (span = line->first_span; span; span = span->next) { - fz_text_span *span = line->spans[span_num]; len += span->len; } len++; /* pseudo-newline */ @@ -1261,12 +1261,18 @@ JNI_FN(MuPDFCore_text)(JNIEnv * env, jobject thiz) for (l = 0; l < block->len; l++) { fz_text_line *line = &block->lines[l]; - jobjectArray *sarr = (*env)->NewObjectArray(env, line->len, textSpanClass, NULL); + jobjectArray *sarr; + fz_text_span *span; + int len = 0; + + for (span = line->first_span; span; span = span->next) + len++; + + sarr = (*env)->NewObjectArray(env, len, textSpanClass, NULL); if (sarr == NULL) fz_throw(ctx, "NewObjectArray failed"); - for (s = 0; s < line->len; s++) + for (span = line->first_span; span; span = span->next) { - fz_text_span *span = line->spans[s]; jobjectArray *carr = (*env)->NewObjectArray(env, span->len, textCharClass, NULL); if (carr == NULL) fz_throw(ctx, "NewObjectArray failed"); -- cgit v1.2.3