diff --git a/tess-two/jni/com_googlecode_tesseract_android/tessbaseapi.cpp b/tess-two/jni/com_googlecode_tesseract_android/tessbaseapi.cpp index b1c25c4d0..33cea1541 100644 --- a/tess-two/jni/com_googlecode_tesseract_android/tessbaseapi.cpp +++ b/tess-two/jni/com_googlecode_tesseract_android/tessbaseapi.cpp @@ -647,15 +647,11 @@ jboolean Java_com_googlecode_tesseract_android_TessBaseAPI_nativeBeginDocument(J const char *c_title = env->GetStringUTFChars(title, NULL); tesseract::TessPDFRenderer* pdfRenderer = (tesseract::TessPDFRenderer*) jRenderer; - jboolean res = JNI_TRUE; - - if (pdfRenderer->BeginDocument(c_title)) { - res = JNI_FALSE; - } + bool res = pdfRenderer->BeginDocument(c_title); env->ReleaseStringUTFChars(title, c_title); - return res; + return (jboolean) (res ? JNI_TRUE : JNI_FALSE); } jboolean Java_com_googlecode_tesseract_android_TessBaseAPI_nativeEndDocument(JNIEnv *env,