diff options
author | Tor Lillqvist <tml@iki.fi> | 2012-11-22 14:01:42 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2012-11-22 14:06:06 +0200 |
commit | 129831703f0539bf06279f47f915098e5a7287f8 (patch) | |
tree | 634f44f19c703a9d26702816aead13f7929ea226 /sal/rtl | |
parent | 9cb4f96790a28470829a5aff11e8b2dd8e94c40b (diff) |
Add an $APP_DATA_DIR predefiend thingie in bootstrap ("rc") files for Android
It expands to what lo_get_app_data_dir() returns, i.e. the activity's
getApplicationInfo().dataDir.
Use it in the LibreOffice4Android app's rc files instead of a
hardcoded (possibly device- and/or OS version dependent) path.
Change-Id: I8145f2c86eeded39232fb251a79fa64f31f77f55
Diffstat (limited to 'sal/rtl')
-rw-r--r-- | sal/rtl/source/bootstrap.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sal/rtl/source/bootstrap.cxx b/sal/rtl/source/bootstrap.cxx index 4d9f19090bdf..1f293b5d9f24 100644 --- a/sal/rtl/source/bootstrap.cxx +++ b/sal/rtl/source/bootstrap.cxx @@ -40,6 +40,10 @@ #include <boost/unordered_map.hpp> #include <list> +#ifdef ANDROID +#include <osl/detail/android-bootstrap.h> +#endif + #ifdef IOS #include <premac.h> #import <Foundation/Foundation.h> @@ -509,6 +513,14 @@ bool Bootstrap_Impl::getValue( pData)); return true; } +#ifdef ANDROID + if (key == "APP_DATA_DIR") { + const char *app_data_dir = lo_get_app_data_dir(); + rtl_uString_assign( + value, rtl::OUString(app_data_dir, strlen(app_data_dir), RTL_TEXTENCODING_UTF8).pData); + return true; + } +#endif if (key == "ORIGIN") { rtl_uString_assign( value, |