[Libreoffice-commits] core.git: sal/android
Jan Holesovsky
kendy at collabora.com
Tue Jul 1 04:49:19 PDT 2014
sal/android/libreofficekit-jni.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
New commits:
commit ed52e65bcb639e4f1893817f4f3c9d698297fe3b
Author: Jan Holesovsky <kendy at collabora.com>
Date: Tue Jul 1 13:46:19 2014 +0200
android: LibreOfficeKit needs the path to program/ as the starting point.
Change-Id: I7d4534649361e1bfa2c285e67e6765a4be55ec69
diff --git a/sal/android/libreofficekit-jni.c b/sal/android/libreofficekit-jni.c
index 4c9f20b..12bb3f9 100644
--- a/sal/android/libreofficekit-jni.c
+++ b/sal/android/libreofficekit-jni.c
@@ -71,6 +71,10 @@ jboolean Java_org_libreoffice_kit_LibreOfficeKit_initializeNative
const char *cacheDirPath;
const char *apkFilePath;
+ const char program_dir[] = "/program";
+ size_t data_dir_len;
+ char *full_program_dir;
+
(void) clazz;
dataDirPath = (*env)->GetStringUTFChars(env, dataDir, NULL);
@@ -123,8 +127,17 @@ jboolean Java_org_libreoffice_kit_LibreOfficeKit_initializeNative
extract_files(UNPACK_TREE, UNPACK_TREE, 0);
extract_files(UNPACK_TREE_GZ, UNPACK_TREE_GZ, 1);
+ // LibreOfficeKit expects a path to the program/ directory
+ data_dir_len = strlen(data_dir);
+ full_program_dir = malloc(data_dir_len + sizeof(program_dir));
+
+ strncpy(full_program_dir, data_dir, data_dir_len);
+ strncpy(full_program_dir + data_dir_len, program_dir, sizeof(program_dir));
+
// Initialize LibreOfficeKit
- gpOffice = libreofficekit_hook(data_dir);
+ gpOffice = libreofficekit_hook(full_program_dir);
+
+ free(full_program_dir);
if (!gpOffice)
{
LOGE("libreofficekit_hook returned null");
More information about the Libreoffice-commits
mailing list