summaryrefslogtreecommitdiff
path: root/sal/rtl
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2012-03-13 18:54:55 +0200
committerTor Lillqvist <tml@iki.fi>2012-03-21 00:00:00 +0200
commit3c5fa6f532e222dbda9accc2a0bca787cd8351b9 (patch)
treeca22596410d7d296ecfe1e723dd2308992ed234a /sal/rtl
parent0fbceef557bd17b99ec7bb5bb758098e9c0e0e1e (diff)
Simply hardcode the inifile as "rc" in the app bundle directory on iOS
Diffstat (limited to 'sal/rtl')
-rw-r--r--sal/rtl/source/bootstrap.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/sal/rtl/source/bootstrap.cxx b/sal/rtl/source/bootstrap.cxx
index 81834973ef3d..5e5292482414 100644
--- a/sal/rtl/source/bootstrap.cxx
+++ b/sal/rtl/source/bootstrap.cxx
@@ -54,6 +54,12 @@
#include <memory>
#include <utility>
+#ifdef IOS
+#include <premac.h>
+#import <Foundation/Foundation.h>
+#include <postmac.h>
+#endif
+
#define MY_STRING_(x) # x
#define MY_STRING(x) MY_STRING_(x)
@@ -390,6 +396,15 @@ Bootstrap_Impl * BootstrapMap::getBaseIni() {
if (baseIni_ == 0) {
rtl::OUString uri;
if (baseIniUri_.isEmpty()) {
+#ifdef IOS
+ // On iOS hardcode the inifile as "rc" in the .app
+ // directory. Apps are self-contained anyway, there is no
+ // possibility to have several "applications" in the same
+ // installation location with different inifiles.
+ const char *inifile = [[[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent: @"rc"] UTF8String];
+ uri = rtl::OUString(inifile, strlen(inifile), RTL_TEXTENCODING_UTF8);
+ resolvePathnameUrl(&uri);
+#else
if (CommandLineParameters::get().get(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INIFILENAME")),
&uri))
@@ -416,6 +431,7 @@ Bootstrap_Impl * BootstrapMap::getBaseIni() {
uri += rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(SAL_CONFIGFILE("")));
}
+#endif
} else {
uri = baseIniUri_;
}