summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-03-11 15:47:18 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-03-11 16:41:59 +0100
commit34eb5546a1f8824c275337644d6db1c344e596fc (patch)
tree6e3cf70bdb617a3d5419c892266d4bff2c8926e9 /desktop
parentee31139b64eb9517619578bb02b3261b85d635ae (diff)
Turn static s_bInEnableRequests into an ExecuteCmdLineRequests arg
Change-Id: Idb0b252d986bc866409928f4a126f55608c6347c
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/app.cxx8
-rw-r--r--desktop/source/app/officeipcthread.cxx13
-rw-r--r--desktop/source/app/officeipcthread.hxx3
3 files changed, 11 insertions, 13 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index a7d97de23140..3166b34a13c4 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -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;
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index 00d0147edc08..6c94f62d5356 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -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)
diff --git a/desktop/source/app/officeipcthread.hxx b/desktop/source/app/officeipcthread.hxx
index 13af93747bfe..1319d39c4af6 100644
--- a/desktop/source/app/officeipcthread.hxx
+++ b/desktop/source/app/officeipcthread.hxx
@@ -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();