[Libreoffice-commits] core.git: 3 commits - desktop/source
Stephan Bergmann
sbergman at redhat.com
Fri Apr 1 13:54:40 UTC 2016
desktop/source/app/officeipcthread.cxx | 46 ++++++++++++++-------------------
1 file changed, 20 insertions(+), 26 deletions(-)
New commits:
commit d3d45ab54e78fa760860923d0ff5c4692d89c99c
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 1 14:10:14 2016 +0200
Remove dead -tofront processing
aArguments must adhere to a certain grammar, and if it doesn't (which would be
the case if it started with "-tofront"), then the Parser ctor would have thrown
an exception and we wouldn't reach this code anyway. Looks like a remnant from
Sun webtop times, got originally introduced with
c9d844f62c388d463445097f1cc453535491e171 "INTEGRATION: CWS cl03: #109140# -start
-> -show", but there appears to be no other mentions of -tofront across the LO
code base.
Change-Id: I5097bf38753f6cc9184a934da81342b3ccf330b4
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index 2df4461..891f021 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -859,8 +859,7 @@ void PipeReaderThread::execute()
delete pRequest;
pRequest = nullptr;
}
- if (aArguments.equalsL(RTL_CONSTASCII_STRINGPARAM("-tofront")) ||
- aCmdLineArgs->IsEmpty())
+ if (aCmdLineArgs->IsEmpty())
{
// no document was sent, just bring Office to front
ApplicationEvent* pAppEvent =
commit 9451e9a6ad3b95fd6c9c6ad1de92905c86143293
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 1 12:15:05 2016 +0200
Clean up
Change-Id: I607108e5ec26992ec4763c4de3e1f53b4fbe886d
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index 39940f9..2df4461 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;
}
}
commit 50461cff6aeaa6e142559b0a37b9c3110de7ff50
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Apr 1 12:09:40 2016 +0200
Rename ipc_ -> handler_
Change-Id: I9509af144143de9f6ec3fc6ac925be99727c9c68
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index 495ac41..39940f9 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -359,8 +359,8 @@ throw( RuntimeException, std::exception )
class PipeReaderThread: public salhelper::Thread {
public:
- PipeReaderThread(RequestHandler & ipc, osl::Pipe const & pipe):
- Thread("PipeReader"), ipc_(ipc), pipe_(pipe)
+ PipeReaderThread(RequestHandler & handler, osl::Pipe const & pipe):
+ Thread("PipeReader"), handler_(handler), pipe_(pipe)
{}
void close() { pipe_.close(); }
@@ -370,7 +370,7 @@ private:
void execute() override;
- RequestHandler & ipc_;
+ RequestHandler & handler_;
osl::Pipe pipe_;
};
@@ -644,16 +644,16 @@ void PipeReaderThread::execute()
// bootstrap, that dialogs event loop might get events that are dispatched by this thread
// we have to wait for cReady to be set by the real main loop.
// only requests that don't dispatch events may be processed before cReady is set.
- ipc_.cReady.wait();
+ handler_.cReady.wait();
// we might have decided to shutdown while we were sleeping
- if (!ipc_.pGlobal.is()) return;
+ if (!handler_.pGlobal.is()) return;
// only lock the mutex when processing starts, othewise we deadlock when the office goes
// down during wait
osl::ClearableMutexGuard aGuard( RequestHandler::GetMutex() );
- if ( ipc_.mState == RequestHandler::State::Downing )
+ if ( handler_.mState == RequestHandler::State::Downing )
{
break;
}
@@ -736,8 +736,8 @@ void PipeReaderThread::execute()
ProcessDocumentsRequest* pRequest = new ProcessDocumentsRequest(
aCmdLineArgs->getCwdUrl());
- ipc_.cProcessed.reset();
- pRequest->pcProcessed = &ipc_.cProcessed;
+ handler_.cProcessed.reset();
+ pRequest->pcProcessed = &handler_.cProcessed;
// Print requests are not dependent on the --invisible cmdline argument as they are
// loaded with the "hidden" flag! So they are always checked.
@@ -878,7 +878,7 @@ void PipeReaderThread::execute()
aGuard.clear();
// wait for processing to finish
if (bDocRequestSent)
- ipc_.cProcessed.wait();
+ handler_.cProcessed.wait();
// processing finished, inform the requesting end:
n = aStreamPipe.write(
PROCESSING_DONE, SAL_N_ELEMENTS(PROCESSING_DONE));
@@ -892,7 +892,7 @@ void PipeReaderThread::execute()
{
{
osl::MutexGuard aGuard( RequestHandler::GetMutex() );
- if ( ipc_.mState == RequestHandler::State::Downing )
+ if ( handler_.mState == RequestHandler::State::Downing )
{
break;
}
More information about the Libreoffice-commits
mailing list