diff options
author | Noel Grandin <noel@peralex.com> | 2012-10-18 10:58:02 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-29 17:32:55 +0100 |
commit | 39c556da3180bc507d9fae5e26bcdf81ea193938 (patch) | |
tree | 4d4e1e6ae7571db9c14a0df0cc015f73f27db33c /framework | |
parent | 7f4e5c8c6f293782fa772c7cf6ad7f8e5992db8b (diff) |
fdo#46808, Create new-style frame::AutoRecovery service
The service already existed, it just did not have an IDL file.
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/services.h | 1 | ||||
-rw-r--r-- | framework/source/services/autorecovery.cxx | 2 | ||||
-rw-r--r-- | framework/source/services/sessionlistener.cxx | 11 |
3 files changed, 7 insertions, 7 deletions
diff --git a/framework/inc/services.h b/framework/inc/services.h index da5ade37193e..ccb8bfb0e2b1 100644 --- a/framework/inc/services.h +++ b/framework/inc/services.h @@ -75,7 +75,6 @@ namespace framework{ #define SERVICENAME_TOOLBARFACTORY DECLARE_ASCII("com.sun.star.ui.ToolBarFactory" ) #define SERVICENAME_TOOLBARCONTROLLERFACTORY DECLARE_ASCII("com.sun.star.frame.ToolBarControllerFactory" ) #define SERVICENAME_LICENSE SERVICENAME_JOB -#define SERVICENAME_AUTORECOVERY DECLARE_ASCII("com.sun.star.frame.AutoRecovery" ) #define SERVICENAME_STATUSBARFACTORY DECLARE_ASCII("com.sun.star.ui.StatusBarFactory" ) #define SERVICENAME_UICATEGORYDESCRIPTION DECLARE_ASCII("com.sun.star.ui.UICategoryDescription" ) #define SERVICENAME_STATUSBARCONTROLLERFACTORY DECLARE_ASCII("com.sun.star.frame.StatusbarControllerFactory" ) diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index d6928eb28533..893c935eb542 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -427,7 +427,7 @@ DEFINE_XTYPEPROVIDER_6(AutoRecovery , //----------------------------------------------- DEFINE_XSERVICEINFO_ONEINSTANCESERVICE(AutoRecovery , ::cppu::OWeakObject , - SERVICENAME_AUTORECOVERY , + DECLARE_ASCII("com.sun.star.frame.AutoRecovery"), IMPLEMENTATIONNAME_AUTORECOVERY) //----------------------------------------------- diff --git a/framework/source/services/sessionlistener.cxx b/framework/source/services/sessionlistener.cxx index abe3761ec46d..5b573c6b8e93 100644 --- a/framework/source/services/sessionlistener.cxx +++ b/framework/source/services/sessionlistener.cxx @@ -45,6 +45,7 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/PropertyState.hpp> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/frame/AutoRecovery.hpp> #include <com/sun/star/frame/XFramesSupplier.hpp> #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> @@ -144,8 +145,8 @@ void SessionListener::StoreSession( sal_Bool bAsync ) // on stop event m_rSessionManager->saveDone(this); in case of asynchronous call // in case of synchronous call the caller should do saveDone() call himself! - css::uno::Reference< XDispatch > xDispatch(m_xSMGR->createInstance(SERVICENAME_AUTORECOVERY), UNO_QUERY_THROW); - css::uno::Reference< XURLTransformer > xURLTransformer(URLTransformer::create(::comphelper::getComponentContext(m_xSMGR))); + css::uno::Reference< XDispatch > xDispatch = css::frame::AutoRecovery::create( ::comphelper::getComponentContext(m_xSMGR) ); + css::uno::Reference< XURLTransformer > xURLTransformer = URLTransformer::create( ::comphelper::getComponentContext(m_xSMGR) ); URL aURL; aURL.Complete = OUString("vnd.sun.star.autorecovery:/doSessionSave"); xURLTransformer->parseStrict(aURL); @@ -177,8 +178,8 @@ void SessionListener::QuitSessionQuietly() // xd->dispatch("vnd.sun.star.autorecovery:/doSessionQuietQuit, async=false // it is done synchronously to avoid conflict with normal quit process - css::uno::Reference< XDispatch > xDispatch(m_xSMGR->createInstance(SERVICENAME_AUTORECOVERY), UNO_QUERY_THROW); - css::uno::Reference< XURLTransformer > xURLTransformer(URLTransformer::create(::comphelper::getComponentContext(m_xSMGR))); + css::uno::Reference< XDispatch > xDispatch = css::frame::AutoRecovery::create( ::comphelper::getComponentContext(m_xSMGR) ); + css::uno::Reference< XURLTransformer > xURLTransformer = URLTransformer::create( ::comphelper::getComponentContext(m_xSMGR) ); URL aURL; aURL.Complete = OUString("vnd.sun.star.autorecovery:/doSessionQuietQuit"); xURLTransformer->parseStrict(aURL); @@ -257,7 +258,7 @@ sal_Bool SAL_CALL SessionListener::doRestore() ResetableGuard aGuard(m_aLock); m_bRestored = sal_False; try { - css::uno::Reference< XDispatch > xDispatch(m_xSMGR->createInstance(SERVICENAME_AUTORECOVERY), UNO_QUERY_THROW); + css::uno::Reference< XDispatch > xDispatch = css::frame::AutoRecovery::create( ::comphelper::getComponentContext(m_xSMGR) ); URL aURL; aURL.Complete = OUString("vnd.sun.star.autorecovery:/doSessionRestore"); |