framework/inc/dispatch/mailtodispatcher.hxx             |   10 +--
 framework/inc/recording/dispatchrecordersupplier.hxx    |   13 +---
 framework/inc/services.h                                |    8 --
 framework/inc/services/mediatypedetectionhelper.hxx     |   27 +--------
 framework/inc/uielement/fontmenucontroller.hxx          |   10 +--
 framework/inc/uielement/fontsizemenucontroller.hxx      |   10 +--
 framework/inc/uielement/footermenucontroller.hxx        |   15 +----
 framework/inc/uielement/headermenucontroller.hxx        |   10 +--
 framework/inc/uielement/macrosmenucontroller.hxx        |   10 +--
 framework/source/dispatch/mailtodispatcher.cxx          |   36 +++++++-----
 framework/source/recording/dispatchrecordersupplier.cxx |   45 ++++++++--------
 framework/source/register/registertemp.cxx              |    8 --
 framework/source/services/mediatypedetectionhelper.cxx  |   35 ++++++++----
 framework/source/uielement/fontmenucontroller.cxx       |   28 +++++++--
 framework/source/uielement/fontsizemenucontroller.cxx   |   26 +++++++--
 framework/source/uielement/footermenucontroller.cxx     |   28 ++++++++-
 framework/source/uielement/headermenucontroller.cxx     |   28 +++++++--
 framework/source/uielement/macrosmenucontroller.cxx     |   30 ++++++++--
 framework/util/fwk.component                            |   24 +++++---
 19 files changed, 230 insertions(+), 171 deletions(-)

New commits:
commit 1a90b1aa64866950cf9ad7032a8240b0c072e671
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Wed Jul 8 18:13:39 2020 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Jul 8 21:12:50 2020 +0200

    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.gran...@collabora.co.uk>

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;
diff --git a/framework/source/dispatch/mailtodispatcher.cxx 
b/framework/source/dispatch/mailtodispatcher.cxx
index a29a8a1413dd..2425fdce5dab 100644
--- a/framework/source/dispatch/mailtodispatcher.cxx
+++ b/framework/source/dispatch/mailtodispatcher.cxx
@@ -30,20 +30,21 @@ namespace framework{
 
 // XInterface, XTypeProvider, XServiceInfo
 
-DEFINE_XSERVICEINFO_MULTISERVICE_2(MailToDispatcher                   ,
-                                 ::cppu::OWeakObject                ,
-                                 SERVICENAME_PROTOCOLHANDLER        ,
-                                 IMPLEMENTATIONNAME_MAILTODISPATCHER)
-
-DEFINE_INIT_SERVICE(MailToDispatcher,
-                    {
-                        /*Attention
-                            I think we don't need any mutex or lock here ... 
because we are called by our own static method impl_createInstance()
-                            to create a new instance of this class by our own 
supported service factory.
-                            see macro DEFINE_XSERVICEINFO_MULTISERVICE and 
"impl_initService()" for further information!
-                        */
-                    }
-                   )
+OUString SAL_CALL MailToDispatcher::getImplementationName()
+{
+    return "com.sun.star.comp.framework.MailToDispatcher";
+}
+
+sal_Bool SAL_CALL MailToDispatcher::supportsService( const OUString& 
sServiceName )
+{
+    return cppu::supportsService(this, sServiceName);
+}
+
+css::uno::Sequence< OUString > SAL_CALL 
MailToDispatcher::getSupportedServiceNames()
+{
+    return { SERVICENAME_PROTOCOLHANDLER };
+}
+
 
 /**
     @short      standard ctor
@@ -219,4 +220,11 @@ void SAL_CALL MailToDispatcher::removeStatusListener( 
const css::uno::Reference<
 
 } //  namespace framework
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+framework_MailToDispatcher_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> 
const& )
+{
+    return cppu::acquire(new framework::MailToDispatcher(context));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/recording/dispatchrecordersupplier.cxx 
b/framework/source/recording/dispatchrecordersupplier.cxx
index 1abbb05350b8..1d31fdd1c57d 100644
--- a/framework/source/recording/dispatchrecordersupplier.cxx
+++ b/framework/source/recording/dispatchrecordersupplier.cxx
@@ -26,31 +26,25 @@
 
 namespace framework{
 
-//  XInterface, XTypeProvider
+// XInterface, XTypeProvider, XServiceInfo
 
-DEFINE_XSERVICEINFO_MULTISERVICE(
-    DispatchRecorderSupplier,
-    ::cppu::OWeakObject,
-    "com.sun.star.frame.DispatchRecorderSupplier",
-    IMPLEMENTATIONNAME_DISPATCHRECORDERSUPPLIER)
+OUString SAL_CALL DispatchRecorderSupplier::getImplementationName()
+{
+    return "com.sun.star.comp.framework.DispatchRecorderSupplier";
+}
 
-DEFINE_INIT_SERVICE(
-    DispatchRecorderSupplier,
-    {
-        /*Attention
-            I think we don't need any mutex or lock here ... because we are 
called by our own static method impl_createInstance()
-            to create a new instance of this class by our own supported 
service factory.
-            see macro DEFINE_XSERVICEINFO_MULTISERVICE and 
"impl_initService()" for further information!
-        */
-    }
-)
+sal_Bool SAL_CALL DispatchRecorderSupplier::supportsService( const OUString& 
sServiceName )
+{
+    return cppu::supportsService(this, sServiceName);
+}
 
-/**
-    @short  standard constructor to create instance
-    @descr  Because an instance will be initialized by her interface methods
-            it's not necessary to do anything here.
- */
-DispatchRecorderSupplier::DispatchRecorderSupplier( const css::uno::Reference< 
css::lang::XMultiServiceFactory >& )
+css::uno::Sequence< OUString > SAL_CALL 
DispatchRecorderSupplier::getSupportedServiceNames()
+{
+    return { "com.sun.star.frame.DispatchRecorderSupplier" };
+}
+
+
+DispatchRecorderSupplier::DispatchRecorderSupplier()
 {
 }
 
@@ -157,4 +151,11 @@ void SAL_CALL DispatchRecorderSupplier::dispatchAndRecord( 
const css::util::URL&
 
 }   // namespace framework
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+framework_DispatchRecorderSupplier_get_implementation(
+    css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const& )
+{
+    return cppu::acquire(new framework::DispatchRecorderSupplier());
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/register/registertemp.cxx 
b/framework/source/register/registertemp.cxx
index 642898fcdea0..3f848f474cc6 100644
--- a/framework/source/register/registertemp.cxx
+++ b/framework/source/register/registertemp.cxx
@@ -56,15 +56,7 @@
 #include <jobs/shelljob.hxx>
 
 COMPONENTGETFACTORY ( fwk,
-                        IFFACTORY( ::framework::MediaTypeDetectionHelper       
         )
-                        IFFACTORY( ::framework::MailToDispatcher               
         )   else
                         IFFACTORY( ::framework::DispatchRecorder               
         )   else
-                        IFFACTORY( ::framework::DispatchRecorderSupplier       
         )   else
-                        IFFACTORY( ::framework::FontMenuController             
         )   else
-                        IFFACTORY( ::framework::MacrosMenuController           
         )   else
-                        IFFACTORY( ::framework::FontSizeMenuController         
         )   else
-                        IFFACTORY( ::framework::FooterMenuController           
         )   else
-                        IFFACTORY( ::framework::HeaderMenuController           
         )   else
                         IFFACTORY( 
::framework::LanguageSelectionMenuController         )
                     )
 
diff --git a/framework/source/services/mediatypedetectionhelper.cxx 
b/framework/source/services/mediatypedetectionhelper.cxx
index ac8a1f2ea52d..d936b36a4004 100644
--- a/framework/source/services/mediatypedetectionhelper.cxx
+++ b/framework/source/services/mediatypedetectionhelper.cxx
@@ -28,7 +28,7 @@ using namespace ::com::sun::star;
 
 //  constructor
 
-MediaTypeDetectionHelper::MediaTypeDetectionHelper( const uno::Reference< 
lang::XMultiServiceFactory >&  )
+MediaTypeDetectionHelper::MediaTypeDetectionHelper()
 {
 }
 
@@ -38,16 +38,23 @@ MediaTypeDetectionHelper::~MediaTypeDetectionHelper()
 {
 }
 
-DEFINE_XSERVICEINFO_ONEINSTANCESERVICE  (   MediaTypeDetectionHelper
-                                        , ::cppu::OWeakObject
-                                        , 
"com.sun.star.frame.MediaTypeDetectionHelper"
-                                        , 
IMPLEMENTATIONNAME_MEDIATYPEDETECTIONHELPER
-                                    )
+// XInterface, XTypeProvider, XServiceInfo
+
+OUString SAL_CALL MediaTypeDetectionHelper::getImplementationName()
+{
+    return "com.sun.star.comp.framework.MediaTypeDetectionHelper";
+}
+
+sal_Bool SAL_CALL MediaTypeDetectionHelper::supportsService( const OUString& 
sServiceName )
+{
+    return cppu::supportsService(this, sServiceName);
+}
+
+css::uno::Sequence< OUString > SAL_CALL 
MediaTypeDetectionHelper::getSupportedServiceNames()
+{
+    return { "com.sun.star.frame.MediaTypeDetectionHelper" };
+}
 
-DEFINE_INIT_SERVICE                 (   MediaTypeDetectionHelper,
-                                        {
-                                        }
-                                    )
 
 //   XStringMapping
 
@@ -72,4 +79,12 @@ sal_Bool SAL_CALL 
MediaTypeDetectionHelper::mapStrings(uno::Sequence< OUString >
 
 }   // namespace framework
 
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+framework_MediaTypeDetectionHelper_get_implementation(
+    css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const& )
+{
+    return cppu::acquire(new framework::MediaTypeDetectionHelper());
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/uielement/fontmenucontroller.cxx 
b/framework/source/uielement/fontmenucontroller.cxx
index 70c0043aede5..d72932ebe7ad 100644
--- a/framework/source/uielement/fontmenucontroller.cxx
+++ b/framework/source/uielement/fontmenucontroller.cxx
@@ -55,13 +55,22 @@ static bool lcl_I18nCompareString(const OUString& rStr1, 
const OUString& rStr2)
 namespace framework
 {
 
-DEFINE_XSERVICEINFO_MULTISERVICE_2      (   FontMenuController                 
     ,
-                                            OWeakObject                        
     ,
-                                            SERVICENAME_POPUPMENUCONTROLLER    
     ,
-                                            
IMPLEMENTATIONNAME_FONTMENUCONTROLLER
-                                        )
+// XInterface, XTypeProvider, XServiceInfo
 
-DEFINE_INIT_SERVICE                     (   FontMenuController, {} )
+OUString SAL_CALL FontMenuController::getImplementationName()
+{
+    return "com.sun.star.comp.framework.FontMenuController";
+}
+
+sal_Bool SAL_CALL FontMenuController::supportsService( const OUString& 
sServiceName )
+{
+    return cppu::supportsService(this, sServiceName);
+}
+
+css::uno::Sequence< OUString > SAL_CALL 
FontMenuController::getSupportedServiceNames()
+{
+    return { SERVICENAME_POPUPMENUCONTROLLER };
+}
 
 FontMenuController::FontMenuController( const css::uno::Reference< 
css::uno::XComponentContext >& xContext ) :
     svt::PopupMenuControllerBase( xContext )
@@ -214,4 +223,11 @@ void SAL_CALL FontMenuController::updatePopupMenu()
 
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+framework_FontMenuController_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> 
const& )
+{
+    return cppu::acquire(new framework::FontMenuController(context));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/uielement/fontsizemenucontroller.cxx 
b/framework/source/uielement/fontsizemenucontroller.cxx
index 79259c2e5e98..b50dedaef24d 100644
--- a/framework/source/uielement/fontsizemenucontroller.cxx
+++ b/framework/source/uielement/fontsizemenucontroller.cxx
@@ -48,13 +48,20 @@ using namespace com::sun::star::view;
 namespace framework
 {
 
-DEFINE_XSERVICEINFO_MULTISERVICE_2      (   FontSizeMenuController             
         ,
-                                            OWeakObject                        
         ,
-                                            SERVICENAME_POPUPMENUCONTROLLER    
         ,
-                                            
IMPLEMENTATIONNAME_FONTSIZEMENUCONTROLLER
-                                        )
+OUString SAL_CALL FontSizeMenuController::getImplementationName()
+{
+    return "com.sun.star.comp.framework.FontSizeMenuController";
+}
+
+sal_Bool SAL_CALL FontSizeMenuController::supportsService( const OUString& 
sServiceName )
+{
+    return cppu::supportsService(this, sServiceName);
+}
 
-DEFINE_INIT_SERVICE                     (   FontSizeMenuController, {} )
+css::uno::Sequence< OUString > SAL_CALL 
FontSizeMenuController::getSupportedServiceNames()
+{
+    return { SERVICENAME_POPUPMENUCONTROLLER };
+}
 
 FontSizeMenuController::FontSizeMenuController( const css::uno::Reference< 
css::uno::XComponentContext >& xContext ) :
     svt::PopupMenuControllerBase( xContext )
@@ -307,4 +314,11 @@ void SAL_CALL FontSizeMenuController::updatePopupMenu()
 }
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+framework_FontSizeMenuController_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> 
const& )
+{
+    return cppu::acquire(new framework::FontSizeMenuController(context));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/uielement/footermenucontroller.cxx 
b/framework/source/uielement/footermenucontroller.cxx
index aef746a434ec..cf88443deb65 100644
--- a/framework/source/uielement/footermenucontroller.cxx
+++ b/framework/source/uielement/footermenucontroller.cxx
@@ -35,11 +35,22 @@ using namespace com::sun::star::container;
 namespace framework
 {
 
-DEFINE_XSERVICEINFO_MULTISERVICE_2      (   FooterMenuController               
     ,
-                                            OWeakObject                        
     ,
-                                            SERVICENAME_POPUPMENUCONTROLLER    
     ,
-                                            
IMPLEMENTATIONNAME_FOOTERMENUCONTROLLER
-                                        )
+// XInterface, XTypeProvider, XServiceInfo
+
+OUString SAL_CALL FooterMenuController::getImplementationName()
+{
+    return "com.sun.star.comp.framework.FooterMenuController";
+}
+
+sal_Bool SAL_CALL FooterMenuController::supportsService( const OUString& 
sServiceName )
+{
+    return cppu::supportsService(this, sServiceName);
+}
+
+css::uno::Sequence< OUString > SAL_CALL 
FooterMenuController::getSupportedServiceNames()
+{
+    return { SERVICENAME_POPUPMENUCONTROLLER };
+}
 
 FooterMenuController::FooterMenuController( const css::uno::Reference< 
css::uno::XComponentContext >& xContext ) :
     HeaderMenuController( xContext,true )
@@ -51,4 +62,11 @@ FooterMenuController::~FooterMenuController()
 }
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+framework_FooterMenuController_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> 
const& )
+{
+    return cppu::acquire(new framework::FooterMenuController(context));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/uielement/headermenucontroller.cxx 
b/framework/source/uielement/headermenucontroller.cxx
index 7e74ef99f506..aeaea78dc099 100644
--- a/framework/source/uielement/headermenucontroller.cxx
+++ b/framework/source/uielement/headermenucontroller.cxx
@@ -49,13 +49,22 @@ const sal_uInt16 ALL_MENUITEM_ID = 1;
 namespace framework
 {
 
-DEFINE_XSERVICEINFO_MULTISERVICE_2      (   HeaderMenuController               
     ,
-                                            OWeakObject                        
     ,
-                                            SERVICENAME_POPUPMENUCONTROLLER    
     ,
-                                            
IMPLEMENTATIONNAME_HEADERMENUCONTROLLER
-                                        )
+// XInterface, XTypeProvider, XServiceInfo
 
-DEFINE_INIT_SERVICE                     (   HeaderMenuController, {} )
+OUString SAL_CALL HeaderMenuController::getImplementationName()
+{
+    return "com.sun.star.comp.framework.HeaderMenuController";
+}
+
+sal_Bool SAL_CALL HeaderMenuController::supportsService( const OUString& 
sServiceName )
+{
+    return cppu::supportsService(this, sServiceName);
+}
+
+css::uno::Sequence< OUString > SAL_CALL 
HeaderMenuController::getSupportedServiceNames()
+{
+    return { SERVICENAME_POPUPMENUCONTROLLER };
+}
 
 HeaderMenuController::HeaderMenuController( const css::uno::Reference< 
css::uno::XComponentContext >& xContext, bool _bFooter ) :
     svt::PopupMenuControllerBase( xContext )
@@ -225,4 +234,11 @@ void SAL_CALL HeaderMenuController::updatePopupMenu()
 
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+framework_HeaderMenuController_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> 
const& )
+{
+    return cppu::acquire(new framework::HeaderMenuController(context));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/uielement/macrosmenucontroller.cxx 
b/framework/source/uielement/macrosmenucontroller.cxx
index f776a0b06bb0..73b78340fb59 100644
--- a/framework/source/uielement/macrosmenucontroller.cxx
+++ b/framework/source/uielement/macrosmenucontroller.cxx
@@ -37,14 +37,23 @@ using namespace com::sun::star::container;
 
 namespace framework
 {
-class
-DEFINE_XSERVICEINFO_MULTISERVICE_2      (   MacrosMenuController               
     ,
-                                            OWeakObject                        
     ,
-                                            SERVICENAME_POPUPMENUCONTROLLER    
     ,
-                                            
IMPLEMENTATIONNAME_MACROSMENUCONTROLLER
-                                        )
 
-DEFINE_INIT_SERVICE                     (   MacrosMenuController, {} )
+// XInterface, XTypeProvider, XServiceInfo
+
+OUString SAL_CALL MacrosMenuController::getImplementationName()
+{
+    return "com.sun.star.comp.framework.MacrosMenuController";
+}
+
+sal_Bool SAL_CALL MacrosMenuController::supportsService( const OUString& 
sServiceName )
+{
+    return cppu::supportsService(this, sServiceName);
+}
+
+css::uno::Sequence< OUString > SAL_CALL 
MacrosMenuController::getSupportedServiceNames()
+{
+    return { SERVICENAME_POPUPMENUCONTROLLER };
+}
 
 MacrosMenuController::MacrosMenuController( const css::uno::Reference< 
css::uno::XComponentContext >& xContext ) :
     svt::PopupMenuControllerBase( xContext ),
@@ -155,4 +164,11 @@ void MacrosMenuController::addScriptItems( PopupMenu* 
pPopupMenu, sal_uInt16 sta
 
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+framework_MacrosMenuController_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> 
const& )
+{
+    return cppu::acquire(new framework::MacrosMenuController(context));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index 166bc9aaee8c..24ab6d67b51a 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -218,28 +218,36 @@
   <implementation name="com.sun.star.comp.framework.DispatchRecorder">
     <service name="com.sun.star.frame.DispatchRecorder"/>
   </implementation>
-  <implementation name="com.sun.star.comp.framework.DispatchRecorderSupplier">
+  <implementation name="com.sun.star.comp.framework.DispatchRecorderSupplier"
+    constructor="framework_DispatchRecorderSupplier_get_implementation">
     <service name="com.sun.star.frame.DispatchRecorderSupplier"/>
   </implementation>
-  <implementation name="com.sun.star.comp.framework.FontMenuController">
+  <implementation name="com.sun.star.comp.framework.FontMenuController"
+    constructor="framework_FontMenuController_get_implementation">
     <service name="com.sun.star.frame.PopupMenuController"/>
   </implementation>
-  <implementation name="com.sun.star.comp.framework.FontSizeMenuController">
+  <implementation name="com.sun.star.comp.framework.FontSizeMenuController"
+    constructor="framework_FontSizeMenuController_get_implementation">
     <service name="com.sun.star.frame.PopupMenuController"/>
   </implementation>
-  <implementation name="com.sun.star.comp.framework.FooterMenuController">
+  <implementation name="com.sun.star.comp.framework.FooterMenuController"
+    constructor="framework_FooterMenuController_get_implementation">
     <service name="com.sun.star.frame.PopupMenuController"/>
   </implementation>
-  <implementation name="com.sun.star.comp.framework.HeaderMenuController">
+  <implementation name="com.sun.star.comp.framework.HeaderMenuController"
+    constructor="framework_HeaderMenuController_get_implementation">
     <service name="com.sun.star.frame.PopupMenuController"/>
   </implementation>
-  <implementation name="com.sun.star.comp.framework.MacrosMenuController">
+  <implementation name="com.sun.star.comp.framework.MacrosMenuController"
+    constructor="framework_MacrosMenuController_get_implementation">
     <service name="com.sun.star.frame.PopupMenuController"/>
   </implementation>
-  <implementation name="com.sun.star.comp.framework.MailToDispatcher">
+  <implementation name="com.sun.star.comp.framework.MailToDispatcher"
+    constructor="framework_MailToDispatcher_get_implementation">
     <service name="com.sun.star.frame.ProtocolHandler"/>
   </implementation>
-  <implementation name="com.sun.star.comp.framework.MediaTypeDetectionHelper">
+  <implementation name="com.sun.star.comp.framework.MediaTypeDetectionHelper"
+    constructor="framework_MediaTypeDetectionHelper_get_implementation">
     <service name="com.sun.star.frame.MediaTypeDetectionHelper"/>
   </implementation>
   <implementation name="com.sun.star.comp.framework.NewMenuController"
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to