diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-28 10:49:19 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-06-03 09:59:59 +0200 |
commit | a8a35e54f506ae22a0ac8f80aa824813260de000 (patch) | |
tree | a4b9e98346c9c579536557f0256abb08908fa5e8 /sfx2 | |
parent | 515701a1ff18d04ede235bef862c465adf41062f (diff) |
fdo#46808, Convert frame::AppDispatchProvider to new style
The service already existed, it just needed an IDL file.
Change-Id: I9553c8e7c4922f2106bc13034e0cc35669b28b7e
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appuno.cxx | 49 | ||||
-rw-r--r-- | sfx2/util/sfx.component | 1 |
2 files changed, 49 insertions, 1 deletions
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index e7e045d556a8..7f65d0febbed 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -1990,7 +1990,54 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, com::sun::star::uno::An #endif } -SFX_IMPL_XSERVICEINFO( SfxAppDispatchProvider, "com.sun.star.frame.DispatchProvider", "com.sun.star.comp.sfx2.AppDispatchProvider" ) \ + /* XServiceInfo */ +OUString SAL_CALL SfxAppDispatchProvider::getImplementationName() throw( css::uno::RuntimeException ) +{ + return impl_getStaticImplementationName(); +} + +/* XServiceInfo */ +sal_Bool SAL_CALL SfxAppDispatchProvider::supportsService( const OUString& sServiceName ) throw( css::uno::RuntimeException ) +{ + css::uno::Sequence< OUString > seqServiceNames = getSupportedServiceNames(); + const OUString* pArray = seqServiceNames.getConstArray(); + for ( sal_Int32 nCounter=0; nCounter<seqServiceNames.getLength(); nCounter++ ) + { + if ( pArray[nCounter] == sServiceName ) + { + return sal_True; + } + } + return sal_False; +} + +/* XServiceInfo */ +css::uno::Sequence< OUString > SAL_CALL SfxAppDispatchProvider::getSupportedServiceNames() throw( css::uno::RuntimeException ) +{ + return impl_getStaticSupportedServiceNames(); +} + +/* Helper for XServiceInfo */ +css::uno::Sequence< OUString > SfxAppDispatchProvider::impl_getStaticSupportedServiceNames() +{ + css::uno::Sequence< OUString > seqServiceNames( 2 ); + seqServiceNames.getArray()[0] = "com.sun.star.frame.DispatchProvider"; + seqServiceNames.getArray()[1] = "com.sun.star.frame.AppDispatchProvider"; + return seqServiceNames; +} + +/* Helper for XServiceInfo */ +OUString SfxAppDispatchProvider::impl_getStaticImplementationName() +{ + return OUString::createFromAscii( "com.sun.star.comp.sfx2.AppDispatchProvider" ); +} + +/* Helper for registry */ +css::uno::Reference< css::uno::XInterface > SAL_CALL SfxAppDispatchProvider::impl_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ) throw( css::uno::Exception ) +{ + return css::uno::Reference< css::uno::XInterface >( *new SfxAppDispatchProvider( xServiceManager ) ); +} + SFX_IMPL_SINGLEFACTORY( SfxAppDispatchProvider ); void SAL_CALL SfxAppDispatchProvider::initialize( const uno::Sequence<uno::Any>& aArguments ) throw (uno::Exception, uno::RuntimeException) diff --git a/sfx2/util/sfx.component b/sfx2/util/sfx.component index 567e10a6ed80..05c8c3bbf76e 100644 --- a/sfx2/util/sfx.component +++ b/sfx2/util/sfx.component @@ -41,6 +41,7 @@ </implementation> <implementation name="com.sun.star.comp.sfx2.AppDispatchProvider"> <service name="com.sun.star.frame.ProtocolHandler"/> + <service name="com.sun.star.frame.AppDispatchProvider"/> </implementation> <implementation name="com.sun.star.comp.sfx2.ApplicationDialogLibraryContainer"> <service name="com.sun.star.script.ApplicationDialogLibraryContainer"/> |