From 8ddd878ed3f00e0bc7455f40baa120d303560341 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 14 Mar 2018 17:12:57 +0000 Subject: Allow lok to re-set temporary paths on second init. Change-Id: I40cd0538b573c2d090f56424e1110b938981a878 Reviewed-on: https://gerrit.libreoffice.org/51292 Tested-by: Jenkins Reviewed-by: Michael Meeks (cherry picked from commit 005abf983d34042a7ced46d886f8ef2250cb3fce) Reviewed-on: https://gerrit.libreoffice.org/51296 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky --- desktop/inc/app.hxx | 2 ++ desktop/source/lib/init.cxx | 8 ++++++++ 2 files changed, 10 insertions(+) (limited to 'desktop') diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx index 91dde49439ab..9ea716fc3e3f 100644 --- a/desktop/inc/app.hxx +++ b/desktop/inc/app.hxx @@ -130,9 +130,11 @@ class Desktop : public Application css::uno::Reference< css::uno::XComponentContext > const & context); static void DeregisterServices(); + public: static void CreateTemporaryDirectory(); static void RemoveTemporaryDirectory(); + private: static bool InitializeConfiguration(); static void FlushConfiguration(); static bool InitializeQuickstartMode( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 45cd0a0c18b2..25b66ab08480 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -92,6 +92,7 @@ #include #include #include +#include #include #include #include @@ -3746,6 +3747,13 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char if (eStage != PRE_INIT) { + SAL_INFO("lok", "Re-initialize temp paths"); + SvtPathOptions aOptions; + OUString aNewTemp; + osl::FileBase::getTempDirURL(aNewTemp); + aOptions.SetTempPath(aNewTemp); + desktop::Desktop::CreateTemporaryDirectory(); + SAL_INFO("lok", "Enabling RequestHandler"); RequestHandler::Enable(false); SAL_INFO("lok", "Starting soffice_main"); -- cgit