diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-11-25 13:00:41 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-11-25 13:09:36 +0100 |
commit | c19853cd874b0a8b628e808c7d7680360cfe4d2b (patch) | |
tree | 2738d79aef85a4f82e0dbae73e4e4a5a7bd58b35 /desktop | |
parent | 8ca933ae8af6656b2f23fe3a2fa17b2034d5c615 (diff) |
OfficeRestartManager clean-up
Change-Id: I21c6d9d2b23512e76cf46ebdbc765da780f8ec5c
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/app.cxx | 27 |
1 files changed, 8 insertions, 19 deletions
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 <com/sun/star/configuration/backend/BackendSetupException.hpp> #include <com/sun/star/configuration/backend/BackendAccessException.hpp> #include <com/sun/star/task/JobExecutor.hpp> +#include <com/sun/star/task/OfficeRestartManager.hpp> #include <com/sun/star/task/XRestartManager.hpp> #include <com/sun/star/document/XEventListener.hpp> #include <com/sun/star/frame/UICommandDescription.hpp> @@ -66,7 +67,6 @@ #include <toolkit/unohlp.hxx> #include <comphelper/processfactory.hxx> -#include <comphelper/componentcontext.hxx> #include <unotools/configmgr.hxx> #include <unotools/confignode.hxx> #include <unotools/moduleoptions.hxx> @@ -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 ) { |