diff options
author | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2019-11-18 17:08:00 +0100 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2019-11-19 18:16:18 +0100 |
commit | 93ee955c5359e283e2fe88e45b4c02a60525ed11 (patch) | |
tree | 05ffd143958417e136381cf1f79b21119d7ccaa3 /sal | |
parent | b926a068a067e7aff6c8f11ed1098a76c39bf5e8 (diff) |
tdf#128101 android: fix documents with manual page break
code reads a .ui file to show a menu to edit/delete that pagebreak. That
file was not packaged in the Android viewer and causes an exception that
is not handled and ultimately results in a crash.
Change-Id: Ie73d886daf9202ba12e1b5a241bc7b6d184ae770
Reviewed-on: https://gerrit.libreoffice.org/83104
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/file.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
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; |