diff options
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index b58f23e14691..0f46a04621dc 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1816,7 +1816,7 @@ static void lo_status_indicator_callback(void *data, comphelper::LibreOfficeKit: } } -static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char* pUserProfilePath) +static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char* pUserProfileUrl) { enum { PRE_INIT, // setup shared data in master process @@ -1849,8 +1849,23 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char if (eStage != PRE_INIT) comphelper::LibreOfficeKit::setStatusIndicatorCallback(lo_status_indicator_callback, pLib); - if (eStage != SECOND_INIT && pUserProfilePath) - rtl::Bootstrap::set("UserInstallation", OUString(pUserProfilePath, strlen(pUserProfilePath), RTL_TEXTENCODING_UTF8)); + if (eStage != SECOND_INIT && pUserProfileUrl) + { + OUString url( + pUserProfileUrl, strlen(pUserProfileUrl), RTL_TEXTENCODING_UTF8); + OUString path; + if (url.startsWithIgnoreAsciiCase("vnd.sun.star.pathname:", &path)) + { + OUString url2; + osl::FileBase::RC e = osl::FileBase::getFileURLFromSystemPath( + path, url2); + if (e == osl::FileBase::E_None) + url = url2; + else + SAL_WARN("lok", "resolving <" << url << "> failed with " << +e); + } + rtl::Bootstrap::set("UserInstallation", url); + } OUString aAppPath; if (pAppPath) |