diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-07-08 18:13:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-07-08 21:12:50 +0200 |
commit | 1a90b1aa64866950cf9ad7032a8240b0c072e671 (patch) | |
tree | d631076faab6a50ca801c5bb39145a2a6b0705da /framework/inc | |
parent | 224160656d549b5b1891edd1b3cee251b754e69b (diff) |
framework: create instances with uno constructors
See tdf#74608 for motivation
Change-Id: I6237016000dc05eacb14e59815b53cd44fbfce0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98384
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework/inc')
-rw-r--r-- | framework/inc/dispatch/mailtodispatcher.hxx | 10 | ||||
-rw-r--r-- | framework/inc/recording/dispatchrecordersupplier.hxx | 13 | ||||
-rw-r--r-- | framework/inc/services.h | 8 | ||||
-rw-r--r-- | framework/inc/services/mediatypedetectionhelper.hxx | 27 | ||||
-rw-r--r-- | framework/inc/uielement/fontmenucontroller.hxx | 10 | ||||
-rw-r--r-- | framework/inc/uielement/fontsizemenucontroller.hxx | 10 | ||||
-rw-r--r-- | framework/inc/uielement/footermenucontroller.hxx | 15 | ||||
-rw-r--r-- | framework/inc/uielement/headermenucontroller.hxx | 10 | ||||
-rw-r--r-- | framework/inc/uielement/macrosmenucontroller.hxx | 10 |
9 files changed, 34 insertions, 79 deletions
diff --git a/framework/inc/dispatch/mailtodispatcher.hxx b/framework/inc/dispatch/mailtodispatcher.hxx index a830822cde81..e76fadfb6b2b 100644 --- a/framework/inc/dispatch/mailtodispatcher.hxx +++ b/framework/inc/dispatch/mailtodispatcher.hxx @@ -61,12 +61,10 @@ class MailToDispatcher final : public ::cppu::WeakImplHelper< MailToDispatcher( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); virtual ~MailToDispatcher( ) override; - // XInterface, XTypeProvider, XServiceInfo - DECLARE_XSERVICEINFO_NOFACTORY - /* Helper for registry */ - /// @throws css::uno::Exception - static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); - static css::uno::Reference< css::lang::XSingleServiceFactory > impl_createFactory ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); + /* interface XServiceInfo */ + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; // XDispatchProvider virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch ( const css::util::URL& aURL , diff --git a/framework/inc/recording/dispatchrecordersupplier.hxx b/framework/inc/recording/dispatchrecordersupplier.hxx index b8eb844dbd1d..83517137df98 100644 --- a/framework/inc/recording/dispatchrecordersupplier.hxx +++ b/framework/inc/recording/dispatchrecordersupplier.hxx @@ -59,13 +59,10 @@ class DispatchRecorderSupplier final : public ::cppu::WeakImplHelper< public: - // XInterface, XTypeProvider, XServiceInfo - - DECLARE_XSERVICEINFO_NOFACTORY - /* Helper for registry */ - /// @throws css::uno::Exception - static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); - static css::uno::Reference< css::lang::XSingleServiceFactory > impl_createFactory ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); + /* interface XServiceInfo */ + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; // XDispatchRecorderSupplier @@ -79,7 +76,7 @@ class DispatchRecorderSupplier final : public ::cppu::WeakImplHelper< public: - DispatchRecorderSupplier( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); + DispatchRecorderSupplier(); virtual ~DispatchRecorderSupplier() override; }; // class DispatchRecorderSupplier diff --git a/framework/inc/services.h b/framework/inc/services.h index 78c2e6899332..10460a93aeca 100644 --- a/framework/inc/services.h +++ b/framework/inc/services.h @@ -35,15 +35,7 @@ namespace framework{ // used implementationnames by framework -#define IMPLEMENTATIONNAME_MEDIATYPEDETECTIONHELPER "com.sun.star.comp.framework.MediaTypeDetectionHelper" #define IMPLEMENTATIONNAME_QUICKLAUNCHER "com.sun.star.comp.desktop.QuickstartWrapper" -#define IMPLEMENTATIONNAME_DISPATCHRECORDERSUPPLIER "com.sun.star.comp.framework.DispatchRecorderSupplier" -#define IMPLEMENTATIONNAME_MAILTODISPATCHER "com.sun.star.comp.framework.MailToDispatcher" -#define IMPLEMENTATIONNAME_MACROSMENUCONTROLLER "com.sun.star.comp.framework.MacrosMenuController" -#define IMPLEMENTATIONNAME_FONTMENUCONTROLLER "com.sun.star.comp.framework.FontMenuController" -#define IMPLEMENTATIONNAME_FONTSIZEMENUCONTROLLER "com.sun.star.comp.framework.FontSizeMenuController" -#define IMPLEMENTATIONNAME_HEADERMENUCONTROLLER "com.sun.star.comp.framework.HeaderMenuController" -#define IMPLEMENTATIONNAME_FOOTERMENUCONTROLLER "com.sun.star.comp.framework.FooterMenuController" #define IMPLEMENTATIONNAME_FWK_TASKCREATOR "com.sun.star.comp.framework.TaskCreator" #define IMPLEMENTATIONNAME_LANGUAGESELECTIONMENUCONTROLLER "com.sun.star.comp.framework.LanguageSelectionMenuController" diff --git a/framework/inc/services/mediatypedetectionhelper.hxx b/framework/inc/services/mediatypedetectionhelper.hxx index 8dd5653011e0..0f1e9d5753a5 100644 --- a/framework/inc/services/mediatypedetectionhelper.hxx +++ b/framework/inc/services/mediatypedetectionhelper.hxx @@ -47,30 +47,13 @@ class MediaTypeDetectionHelper final : public ::cppu::WeakImplHelper< css::util: public: - // constructor / destructor - - /*-**************************************************************************************************** - @short standard ctor - @descr These initialize a new instance of this class with all needed information for work. - @param "xFactory", reference to factory which has created our owner(!). We can use these to create new uno-services. - *//*-*****************************************************************************************************/ - - MediaTypeDetectionHelper( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); - - /*-**************************************************************************************************** - @short standard destructor - @descr This method destruct an instance of this class and clear some member. - *//*-*****************************************************************************************************/ - + MediaTypeDetectionHelper(); virtual ~MediaTypeDetectionHelper() override; - // XInterface, XTypeProvider, XServiceInfo - - DECLARE_XSERVICEINFO_NOFACTORY - /* Helper for registry */ - /// @throws css::uno::Exception - static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); - static css::uno::Reference< css::lang::XSingleServiceFactory > impl_createFactory ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); + /* interface XServiceInfo */ + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; // XStringMapping diff --git a/framework/inc/uielement/fontmenucontroller.hxx b/framework/inc/uielement/fontmenucontroller.hxx index ef8231f18c8e..5a9959f1daa7 100644 --- a/framework/inc/uielement/fontmenucontroller.hxx +++ b/framework/inc/uielement/fontmenucontroller.hxx @@ -38,12 +38,10 @@ namespace framework FontMenuController( const css::uno::Reference< css::uno::XComponentContext >& xContext ); virtual ~FontMenuController() override; - // XServiceInfo - DECLARE_XSERVICEINFO_NOFACTORY - /* Helper for registry */ - /// @throws css::uno::Exception - static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); - static css::uno::Reference< css::lang::XSingleServiceFactory > impl_createFactory ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); + /* interface XServiceInfo */ + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; // XPopupMenuController virtual void SAL_CALL updatePopupMenu() override; diff --git a/framework/inc/uielement/fontsizemenucontroller.hxx b/framework/inc/uielement/fontsizemenucontroller.hxx index 36a960099910..7cf338318d81 100644 --- a/framework/inc/uielement/fontsizemenucontroller.hxx +++ b/framework/inc/uielement/fontsizemenucontroller.hxx @@ -42,12 +42,10 @@ namespace framework FontSizeMenuController( const css::uno::Reference< css::uno::XComponentContext >& xContext ); virtual ~FontSizeMenuController() override; - // XServiceInfo - DECLARE_XSERVICEINFO_NOFACTORY - /* Helper for registry */ - /// @throws css::uno::Exception - static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); - static css::uno::Reference< css::lang::XSingleServiceFactory > impl_createFactory ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); + /* interface XServiceInfo */ + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; // XPopupMenuController virtual void SAL_CALL updatePopupMenu() override; diff --git a/framework/inc/uielement/footermenucontroller.hxx b/framework/inc/uielement/footermenucontroller.hxx index 732524a5e071..5cf3388667dc 100644 --- a/framework/inc/uielement/footermenucontroller.hxx +++ b/framework/inc/uielement/footermenucontroller.hxx @@ -30,17 +30,10 @@ namespace framework FooterMenuController( const css::uno::Reference< css::uno::XComponentContext >& xContext ); virtual ~FooterMenuController() override; - // XServiceInfo - virtual OUString SAL_CALL getImplementationName ( ) override; - virtual sal_Bool SAL_CALL supportsService ( const OUString& sServiceName ) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames ( ) override; - /* Helper for XServiceInfo */ - static css::uno::Sequence< OUString > impl_getStaticSupportedServiceNames( ); - static OUString impl_getStaticImplementationName ( ); - /* Helper for registry */ - /// @throws css::uno::Exception - static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); - static css::uno::Reference< css::lang::XSingleServiceFactory > impl_createFactory ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); + /* interface XServiceInfo */ + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; }; } diff --git a/framework/inc/uielement/headermenucontroller.hxx b/framework/inc/uielement/headermenucontroller.hxx index b92cb9755b1d..f4bb30fe8a68 100644 --- a/framework/inc/uielement/headermenucontroller.hxx +++ b/framework/inc/uielement/headermenucontroller.hxx @@ -37,12 +37,10 @@ namespace framework HeaderMenuController( const css::uno::Reference< css::uno::XComponentContext >& xContext, bool _bFooter = false ); virtual ~HeaderMenuController() override; - // XServiceInfo - DECLARE_XSERVICEINFO_NOFACTORY - /* Helper for registry */ - /// @throws css::uno::Exception - static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); - static css::uno::Reference< css::lang::XSingleServiceFactory > impl_createFactory ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); + /* interface XServiceInfo */ + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; // XPopupMenuController virtual void SAL_CALL updatePopupMenu() override; diff --git a/framework/inc/uielement/macrosmenucontroller.hxx b/framework/inc/uielement/macrosmenucontroller.hxx index c5fbd18f62ac..fd84d45f072f 100644 --- a/framework/inc/uielement/macrosmenucontroller.hxx +++ b/framework/inc/uielement/macrosmenucontroller.hxx @@ -37,12 +37,10 @@ namespace framework MacrosMenuController( const css::uno::Reference< css::uno::XComponentContext >& xContext ); virtual ~MacrosMenuController() override; - // XServiceInfo - DECLARE_XSERVICEINFO_NOFACTORY - /* Helper for registry */ - /// @throws css::uno::Exception - static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); - static css::uno::Reference< css::lang::XSingleServiceFactory > impl_createFactory ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); + /* interface XServiceInfo */ + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; // XStatusListener virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override; |