From c19853cd874b0a8b628e808c7d7680360cfe4d2b Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sun, 25 Nov 2012 13:00:41 +0100 Subject: OfficeRestartManager clean-up Change-Id: I21c6d9d2b23512e76cf46ebdbc765da780f8ec5c --- desktop/source/app/app.cxx | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'desktop') diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index aa7083700b9a..205965adc8a7 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -66,7 +67,6 @@ #include #include -#include #include #include #include @@ -1445,8 +1445,10 @@ int Desktop::Main() Reference< XMultiServiceFactory > xSMgr = ::comphelper::getProcessServiceFactory(); + Reference< XRestartManager > xRestartManager( + OfficeRestartManager::get(comphelper::getProcessComponentContext())); + Reference< XDesktop > xDesktop; - Reference< ::com::sun::star::task::XRestartManager > xRestartManager; try { RegisterServices(); @@ -1555,14 +1557,6 @@ int Desktop::Main() if ( bAbort ) return EXIT_FAILURE; - { - ::comphelper::ComponentContext aContext( xSMgr ); - xRestartManager.set( aContext.getSingleton( ::rtl::OUString( "com.sun.star.task.OfficeRestartManager" ) ), UNO_QUERY ); - } - - // check whether the shutdown is caused by restart - pExecGlobals->bRestartRequested = ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) ); - if (inst_fin == UserInstall::Created) { Migration::migrateSettingsIfNecessary(); @@ -1587,14 +1581,6 @@ int Desktop::Main() impl_checkRecoveryState(bCrashed, bExistsRecoveryData, bExistsSessionData); RTL_LOGFILE_CONTEXT_TRACE( aLog, "} impl_checkRecoveryState" ); - { - ::comphelper::ComponentContext aContext( xSMgr ); - xRestartManager.set( aContext.getSingleton( ::rtl::OUString( "com.sun.star.task.OfficeRestartManager" ) ), UNO_QUERY ); - } - - // check whether the shutdown is caused by restart - pExecGlobals->bRestartRequested = ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) ); - if ( rCmdLineArgs.IsHeadless() ) { // Ensure that we use not the system file dialogs as @@ -1605,6 +1591,8 @@ int Desktop::Main() aMiscOptions.SetUseSystemFileDialog( sal_False ); } + pExecGlobals->bRestartRequested = xRestartManager->isRestartRequested( + true); if ( !pExecGlobals->bRestartRequested ) { if ((!rCmdLineArgs.WantsToLoadDocument() && !rCmdLineArgs.IsInvisible() && !rCmdLineArgs.IsHeadless() && !rCmdLineArgs.IsQuickstart()) && @@ -1706,7 +1694,8 @@ int Desktop::Main() new svt::JavaContext( com::sun::star::uno::getCurrentContext() ) ); // check whether the shutdown is caused by restart just before entering the Execute - pExecGlobals->bRestartRequested = pExecGlobals->bRestartRequested || ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) ); + pExecGlobals->bRestartRequested = pExecGlobals->bRestartRequested || + xRestartManager->isRestartRequested(true); if ( !pExecGlobals->bRestartRequested ) { -- cgit