summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2015-09-01 20:10:09 -0400
committerHenry Castro <hcastro@collabora.com>2015-09-01 20:10:09 -0400
commit1bea5bf90187f0dac06d0c438b96def4bcd746f8 (patch)
tree028abee7e791bf119442e2d69ee4b25639a0e4c1
parentlok: use preInitBootstrap (diff)
downloadcore-1bea5bf90187f0dac06d0c438b96def4bcd746f8.tar.gz
core-1bea5bf90187f0dac06d0c438b96def4bcd746f8.zip
Revert lok: use preInitBootstrap
Change-Id: I4030781b76ba4954174b3fab2ffb8e8e93a02bcd
-rw-r--r--desktop/source/lib/init.cxx40
1 files changed, 12 insertions, 28 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index f448a30e3590..32f0aacda6a4 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -966,6 +966,11 @@ static void lo_status_indicator_callback(void *data, comphelper::LibreOfficeKit:
}
}
+/// pre-load all C++ component factories and leak references to them.
+static void forceLoadAllNativeComponents()
+{
+}
+
/// pre-load and parse all filter XML
static void forceLoadFilterXML()
{
@@ -1042,6 +1047,12 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
Application::EnableHeadlessMode(true);
}
+ if (eStage == PRE_INIT)
+ {
+ forceLoadAllNativeComponents();
+ forceLoadFilterXML();
+ }
+
// This is horrible crack. I really would want to go back to simply just call
// InitVCL() here. The OfficeIPCThread thing is just horrible.
@@ -1125,34 +1136,7 @@ LibreOfficeKit *libreofficekit_hook(const char* install_path)
SAL_JNI_EXPORT
int lok_preinit(const char* install_path, const char* user_profile_path)
{
- rtl::Bootstrap::set(OUString("UserInstallation"), OUString(user_profile_path, strlen(user_profile_path), RTL_TEXTENCODING_UTF8));
-
- OUString aAppPath;
- if (install_path)
- {
- aAppPath = OUString(install_path, strlen(install_path), RTL_TEXTENCODING_UTF8);
- }
- 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 );
- }
-
- OUString aAppURL;
- if (osl::FileBase::getFileURLFromSystemPath(aAppPath, aAppURL) != osl::FileBase::E_None)
- return -1;
-
-
- rtl::Bootstrap::setIniFilename(aAppURL + "/" SAL_CONFIGFILE("soffice"));
-
- // pre-load all C++ component factories and leak references to them.
- cppu::preInitBootstrap();
- forceLoadFilterXML();
-
- return 0;
+ return lo_initialize(NULL, install_path, user_profile_path);
}
static void lo_destroy(LibreOfficeKit* pThis)