diff options
-rw-r--r-- | desktop/source/lib/init.cxx | 8 | ||||
-rw-r--r-- | include/unotools/pathoptions.hxx | 1 | ||||
-rw-r--r-- | unotools/source/config/pathoptions.cxx | 6 |
3 files changed, 15 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index cc3139fcd22e..a54ebc6e469f 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -7977,6 +7977,14 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char OUString aNewTemp; osl::FileBase::getTempDirURL(aNewTemp); aOptions.SetTempPath(aNewTemp); + { + const char *pWorkPath = getenv("LOK_WORKDIR"); + if (pWorkPath) + { + OString sWorkPath(pWorkPath); + aOptions.SetWorkPath(OStringToOUString(sWorkPath, RTL_TEXTENCODING_UTF8)); + } + } desktop::Desktop::CreateTemporaryDirectory(); // The RequestHandler is specifically set to be ready when all the other diff --git a/include/unotools/pathoptions.hxx b/include/unotools/pathoptions.hxx index c7468048d5df..c19a2b34baf4 100644 --- a/include/unotools/pathoptions.hxx +++ b/include/unotools/pathoptions.hxx @@ -106,6 +106,7 @@ public: void SetAutoTextPath( const OUString& rPath ); void SetBasicPath( const OUString& rPath ); void SetTempPath( const OUString& rPath ); + void SetWorkPath( const OUString& rPath ); OUString SubstituteVariable( const OUString& rVar ) const; OUString ExpandMacros( const OUString& rPath ) const; diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx index 24c1fb323dcc..4234ec903df9 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -122,6 +122,7 @@ class SvtPathOptions_Impl void SetAutoTextPath( const OUString& rPath ) { SetPath( SvtPathOptions::Paths::AutoText, rPath ); } void SetBasicPath( const OUString& rPath ) { SetPath( SvtPathOptions::Paths::Basic, rPath ); } void SetTempPath( const OUString& rPath ) { SetPath( SvtPathOptions::Paths::Temp, rPath ); } + void SetWorkPath( const OUString& rPath ) { SetPath( SvtPathOptions::Paths::Work, rPath ); } OUString SubstVar( const OUString& rVar ) const; OUString ExpandMacros( const OUString& rPath ) const; @@ -589,6 +590,11 @@ void SvtPathOptions::SetTempPath( const OUString& rPath ) pImpl->SetTempPath( rPath ); } +void SvtPathOptions::SetWorkPath( const OUString& rPath ) +{ + pImpl->SetWorkPath( rPath ); +} + OUString SvtPathOptions::SubstituteVariable( const OUString& rVar ) const { return pImpl->SubstVar( rVar ); |