Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

Commit

Permalink
Fix return value of BeginDocument (fixes #103)
Browse files Browse the repository at this point in the history
pdfRenderer->BeginDocument return true on success so the condition was wrongly inverted. This commit fixes that and uses a bit cleaner code.
  • Loading branch information
Robyer committed May 11, 2017
1 parent 3bda8b1 commit 00d093d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tess-two/jni/com_googlecode_tesseract_android/tessbaseapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 00d093d

Please sign in to comment.