diff options
Diffstat (limited to 'desktop/source/app/officeipcthread.cxx')
-rw-r--r-- | desktop/source/app/officeipcthread.cxx | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index 5bfd5ed80a23..031e027f9473 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -1310,6 +1310,12 @@ static void AddConversionsToDispatchList( } } +struct ConditionSetGuard +{ + osl::Condition* m_pCondition; + ConditionSetGuard(osl::Condition* pCondition) : m_pCondition(pCondition) {} + ~ConditionSetGuard() { if (m_pCondition) m_pCondition->set(); } +}; bool RequestHandler::ExecuteCmdLineRequests( ProcessDocumentsRequest& aRequest, bool noTerminate) @@ -1317,6 +1323,9 @@ bool RequestHandler::ExecuteCmdLineRequests( // protect the dispatch list osl::ClearableMutexGuard aGuard( GetMutex() ); + // ensure that Processed flag (if exists) is signaled in any outcome + ConditionSetGuard(aRequest.pcProcessed); + static std::vector<DispatchWatcher::DispatchRequest> aDispatchList; // Create dispatch list for dispatch watcher @@ -1334,7 +1343,13 @@ bool RequestHandler::ExecuteCmdLineRequests( if ( pGlobal.is() ) { if( ! pGlobal->AreRequestsEnabled() ) + { + // Either starting, or downing - do not process the request, just try to bring Office to front + ApplicationEvent* pAppEvent = + new ApplicationEvent(ApplicationEvent::Type::Appear); + ImplPostForeignAppEvent(pAppEvent); return bShutdown; + } pGlobal->mnPendingRequests += aDispatchList.size(); if ( !pGlobal->mpDispatchWatcher.is() ) @@ -1352,10 +1367,6 @@ bool RequestHandler::ExecuteCmdLineRequests( // Execute dispatch requests bShutdown = dispatchWatcher->executeDispatchRequests( aTempList, noTerminate); - - // set processed flag - if (aRequest.pcProcessed != nullptr) - aRequest.pcProcessed->set(); } return bShutdown; |