Commits

Anonymous committed 202279d

masterfix OOO330: #i10000# solve merge problem / WaE

  • Participants
  • Parent commits dcba636

Comments (0)

Files changed (1)

desktop/source/app/app.cxx

     std::auto_ptr<SvtLanguageOptions> pLanguageOptions;
     std::auto_ptr<SvtPathOptions> pPathOptions;
 
+    Reference< ::com::sun::star::task::XRestartManager > xRestartManager;
 	sal_Bool bRestartRequested( sal_False );
 	sal_Bool bUseSystemFileDialog(sal_True);
     int		 nAcquireCount( 0 );
         impl_checkRecoveryState(bCrashed, bExistsRecoveryData, bExistsSessionData);
         RTL_LOGFILE_CONTEXT_TRACE( aLog, "} impl_checkRecoveryState" );
 
-		Reference< ::com::sun::star::task::XRestartManager > xRestartManager;
 		{
 			::comphelper::ComponentContext aContext( xSMgr );
 			xRestartManager.set( aContext.getSingleton( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.OfficeRestartManager" ) ) ), UNO_QUERY );
         // call Application::Execute to process messages in vcl message loop
         RTL_LOGFILE_PRODUCT_TRACE( "PERFORMANCE - enter Application::Execute()" );
 
-        Reference< ::com::sun::star::task::XRestartManager > xRestartManager;
 		try
 		{
 			// The JavaContext contains an interaction handler which is used when
 			com::sun::star::uno::ContextLayer layer2(
 				new svt::JavaContext( com::sun::star::uno::getCurrentContext() ) );
 
-            ::comphelper::ComponentContext aContext( xSMgr );
-            xRestartManager.set( aContext.getSingleton( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.OfficeRestartManager" ) ) ), UNO_QUERY );
-            if ( !xRestartManager.is() || !xRestartManager->isRestartRequested( sal_True ) )
+            // check whether the shutdown is caused by restart just before entering the Execute
+            bRestartRequested = bRestartRequested || ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) );
+
+            if ( !bRestartRequested )
             {
                 // if this run of the office is triggered by restart, some additional actions should be done
                 DoRestartActionsIfNecessary( !pCmdLineArgs->IsInvisible() && !pCmdLineArgs->IsNoQuickstart() );
 			OfficeIPCThread::SetDowning();
 			FatalError( MakeStartupErrorMessage(exAnyCfg.Message) );
 		}
-
-        // check whether the shutdown is caused by restart
-        sal_Bool bRestartRequested = ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) );
-        if ( bRestartRequested )
-            SetRestartState();
 	}
     
+    if ( bRestartRequested )
+        SetRestartState();
+
 	if (xGlobalBroadcaster.is())
     {
         css::document::EventObject aEvent;