diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-04-01 12:15:05 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-04-01 15:54:19 +0200 |
commit | 9451e9a6ad3b95fd6c9c6ad1de92905c86143293 (patch) | |
tree | c6db687759328e48fbee4581767d6f4b6b88c819 /desktop/source/app/officeipcthread.cxx | |
parent | 50461cff6aeaa6e142559b0a37b9c3110de7ff50 (diff) |
Clean up
Change-Id: I607108e5ec26992ec4763c4de3e1f53b4fbe886d
Diffstat (limited to 'desktop/source/app/officeipcthread.cxx')
-rw-r--r-- | desktop/source/app/officeipcthread.cxx | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index 39940f9d6881..2df44615490c 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -450,19 +450,12 @@ RequestHandler::Status RequestHandler::Enable(bool ipc) return IPC_STATUS_OK; } - OUString aUserInstallPath; - OUString aDummy; - - osl::Pipe pipe; - - PipeMode nPipeMode = PIPEMODE_DONTKNOW; - // The name of the named pipe is created with the hashcode of the user installation directory (without /user). We have to retrieve // this information from a unotools implementation. + OUString aUserInstallPath; ::utl::Bootstrap::PathStatus aLocateResult = ::utl::Bootstrap::locateUserInstallation( aUserInstallPath ); - if ( aLocateResult == ::utl::Bootstrap::PATH_EXISTS || aLocateResult == ::utl::Bootstrap::PATH_VALID) - aDummy = aUserInstallPath; - else + if (aLocateResult != utl::Bootstrap::PATH_EXISTS + && aLocateResult != utl::Bootstrap::PATH_VALID) { return IPC_STATUS_BOOTSTRAP_ERROR; } @@ -472,14 +465,16 @@ RequestHandler::Status RequestHandler::Enable(bool ipc) // First we try to create our pipe if this fails we try to connect. We have to do this // in a loop because the other office can crash or shutdown between createPipe // and connectPipe!! - auto aUserInstallPathHashCode = CreateMD5FromString( aDummy ); + auto aUserInstallPathHashCode = CreateMD5FromString(aUserInstallPath); // Check result to create a hash code from the user install path if ( aUserInstallPathHashCode.isEmpty() ) return IPC_STATUS_BOOTSTRAP_ERROR; // Something completely broken, we cannot create a valid hash code! - OUString aPipeIdent( "SingleOfficeIPC_" + aUserInstallPathHashCode ); + osl::Pipe pipe; + PipeMode nPipeMode = PIPEMODE_DONTKNOW; + OUString aPipeIdent( "SingleOfficeIPC_" + aUserInstallPathHashCode ); do { osl::Security security; @@ -545,8 +540,8 @@ RequestHandler::Status RequestHandler::Enable(bool ipc) sal_uInt32 nCount = rtl_getAppCommandArgCount(); for( sal_uInt32 i=0; i < nCount; i++ ) { - rtl_getAppCommandArg( i, &aDummy.pData ); - if (!addArgument(aArguments, ',', aDummy)) { + rtl_getAppCommandArg( i, &aUserInstallPath.pData ); + if (!addArgument(aArguments, ',', aUserInstallPath)) { return IPC_STATUS_BOOTSTRAP_ERROR; } } |