summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2019-02-15 16:04:51 +0100
committerJan Holesovsky <kendy@collabora.com>2019-06-05 22:19:33 +0200
commite1e516f233ba65460e33c39de88e318e865eb1f8 (patch)
tree937eed9bc2c6ea5b20f0b3e9c7945e4cbbfd2b7c
parent276c3910bd7bc5e5bacecd280db812519ac6e36c (diff)
android: Set the program path sensibly when we've got nullptr.
Change-Id: I4415459ca5d758d06d866faeca85e1cf154d0567 Reviewed-on: https://gerrit.libreoffice.org/67877 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r--desktop/source/lib/init.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6e65942b6101..1360f75d6338 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -24,6 +24,10 @@
#include <postmac.h>
#endif
+#ifdef ANDROID
+#include <osl/detail/android-bootstrap.h>
+#endif
+
#include <algorithm>
#include <memory>
#include <iostream>
@@ -4972,11 +4976,16 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
}
else
{
+#ifdef ANDROID
+ aAppPath = OUString::fromUtf8(lo_get_app_data_dir()) + "/program";
+#else
// Fun conversion dance back and forth between URLs and system paths...
OUString aAppURL;
::osl::Module::getUrlFromAddress( reinterpret_cast< oslGenericFunction >(lo_initialize),
aAppURL);
osl::FileBase::getSystemPathFromFileURL( aAppURL, aAppPath );
+#endif
+
#ifdef IOS
// The above gives something like
// "/private/var/containers/Bundle/Application/953AA851-CC15-4C60-A2CB-C2C6F24E6F71/Foo.app/Foo",