diff options
-rw-r--r-- | android/source/build.gradle | 7 | ||||
-rw-r--r-- | sal/osl/unx/file.cxx | 9 |
2 files changed, 15 insertions, 1 deletions
diff --git a/android/source/build.gradle b/android/source/build.gradle index 5bf49406648e..5ca9a02a4973 100644 --- a/android/source/build.gradle +++ b/android/source/build.gradle @@ -149,6 +149,13 @@ task copyUnpackAssets(type: Copy) { ) } } + // documents with manual page break trigger attempt to read the ui file + // would trigger a css::container::NoSuchElementException with osl_File_E_NOENT + // if not present and since it is not caught would crash the app... + into('config') { + from "${liboInstdir}/share/config" + include '**/pagebreakmenu.ui' + } } task copyAssets(type: Copy) { diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index 96a9cfecf2b1..b6a0acaae2c4 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -830,8 +830,15 @@ oslFileError openFilePath(const char *cpFilePath, oslFileHandle* pHandle, sal_uI { void* address; size_t size; + // some requests are /assets//foo... + size_t offset = sizeof("/assets/")-1; + if (cpFilePath[offset] == '/') { + __android_log_print(ANDROID_LOG_DEBUG,"libo:sal/osl/unx/file", "double-slash in path: %s", cpFilePath); + offset++; + } AAssetManager* mgr = lo_get_native_assetmgr(); - AAsset* asset = AAssetManager_open(mgr, cpFilePath + sizeof("/assets/")-1, AASSET_MODE_BUFFER); + AAsset* asset = AAssetManager_open(mgr, cpFilePath + offset, AASSET_MODE_BUFFER); + if (!asset) { address = NULL; |