Kaydet (Commit) 34eb5546 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Turn static s_bInEnableRequests into an ExecuteCmdLineRequests arg

Change-Id: Idb0b252d986bc866409928f4a126f55608c6347c
üst ee31139b
......@@ -2407,7 +2407,7 @@ void Desktop::OpenClients()
}
// Process request
if ( OfficeIPCThread::ExecuteCmdLineRequests( aRequest ) )
if ( OfficeIPCThread::ExecuteCmdLineRequests(aRequest, false) )
{
// Don't do anything if we have successfully called terminate at desktop:
return;
......@@ -2481,7 +2481,7 @@ void Desktop::OpenDefault()
ProcessDocumentsRequest aRequest(rArgs.getCwdUrl());
aRequest.aOpenList.push_back(aName);
OfficeIPCThread::ExecuteCmdLineRequests( aRequest );
OfficeIPCThread::ExecuteCmdLineRequests(aRequest, false);
}
......@@ -2604,7 +2604,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent )
std::vector<OUString> const & data(rAppEvent.GetStringsData());
docsRequest.aOpenList.insert(
docsRequest.aOpenList.end(), data.begin(), data.end());
OfficeIPCThread::ExecuteCmdLineRequests(docsRequest);
OfficeIPCThread::ExecuteCmdLineRequests(docsRequest, false);
}
}
break;
......@@ -2621,7 +2621,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent )
std::vector<OUString> const & data(rAppEvent.GetStringsData());
docsRequest.aPrintList.insert(
docsRequest.aPrintList.end(), data.begin(), data.end());
OfficeIPCThread::ExecuteCmdLineRequests(docsRequest);
OfficeIPCThread::ExecuteCmdLineRequests(docsRequest, false);
}
}
break;
......
......@@ -296,7 +296,7 @@ IMPL_STATIC_LINK_TYPED( ProcessEventsClass_Impl, ProcessDocumentsEvent, void*, p
{
// Documents requests are processed by the OfficeIPCThread implementation
ProcessDocumentsRequest* pDocsRequest = static_cast<ProcessDocumentsRequest*>(pEvent);
OfficeIPCThread::ExecuteCmdLineRequests( *pDocsRequest );
OfficeIPCThread::ExecuteCmdLineRequests(*pDocsRequest, false);
delete pDocsRequest;
}
......@@ -394,8 +394,6 @@ void OfficeIPCThread::SetDowning()
pGlobalOfficeIPCThread->mState = State::Downing;
}
static bool s_bInEnableRequests = false;
void OfficeIPCThread::EnableRequests()
{
// switch between just queueing the requests and executing them
......@@ -403,15 +401,13 @@ void OfficeIPCThread::EnableRequests()
if ( pGlobalOfficeIPCThread.is() )
{
s_bInEnableRequests = true;
if (pGlobalOfficeIPCThread->mState != State::Downing) {
pGlobalOfficeIPCThread->mState = State::RequestsEnabled;
}
// hit the compiler over the head
ProcessDocumentsRequest aEmptyReq = ProcessDocumentsRequest( boost::optional< OUString >() );
// trigger already queued requests
OfficeIPCThread::ExecuteCmdLineRequests( aEmptyReq );
s_bInEnableRequests = false;
OfficeIPCThread::ExecuteCmdLineRequests(aEmptyReq, true);
}
}
......@@ -1047,7 +1043,8 @@ static void AddConversionsToDispatchList(
}
bool OfficeIPCThread::ExecuteCmdLineRequests( ProcessDocumentsRequest& aRequest )
bool OfficeIPCThread::ExecuteCmdLineRequests(
ProcessDocumentsRequest& aRequest, bool noTerminate)
{
// protect the dispatch list
osl::ClearableMutexGuard aGuard( GetMutex() );
......@@ -1084,7 +1081,7 @@ bool OfficeIPCThread::ExecuteCmdLineRequests( ProcessDocumentsRequest& aRequest
aGuard.clear();
// Execute dispatch requests
bShutdown = pGlobalOfficeIPCThread->mpDispatchWatcher->executeDispatchRequests( aTempList, s_bInEnableRequests );
bShutdown = pGlobalOfficeIPCThread->mpDispatchWatcher->executeDispatchRequests( aTempList, noTerminate);
// set processed flag
if (aRequest.pcProcessed != nullptr)
......
......@@ -110,7 +110,8 @@ class OfficeIPCThread : public salhelper::Thread
static void EnableRequests();
static bool AreRequestsPending();
static void RequestsCompleted();
static bool ExecuteCmdLineRequests( ProcessDocumentsRequest& );
static bool ExecuteCmdLineRequests(
ProcessDocumentsRequest&, bool noTerminate);
// return sal_False if second office
static Status EnableOfficeIPCThread();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment