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