[Libreoffice-commits] core.git: 2 commits - filter/source reportdesign/Library_rptui.mk reportdesign/source reportdesign/util scaddins/source solenv/bin

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sat Jul 25 14:30:10 UTC 2020


 filter/source/odfflatxml/OdfFlatXml.cxx                      |   56 +--------
 filter/source/odfflatxml/odfflatxml.component                |    5 
 reportdesign/Library_rptui.mk                                |    1 
 reportdesign/source/ui/inc/DataProviderHandler.hxx           |    8 -
 reportdesign/source/ui/inc/DefaultInspection.hxx             |    8 -
 reportdesign/source/ui/inc/GeometryHandler.hxx               |    9 -
 reportdesign/source/ui/inc/ReportComponentHandler.hxx        |    9 -
 reportdesign/source/ui/inc/ReportController.hxx              |    7 -
 reportdesign/source/ui/inc/statusbarcontroller.hxx           |    7 -
 reportdesign/source/ui/inspection/DataProviderHandler.cxx    |   26 +---
 reportdesign/source/ui/inspection/DefaultInspection.cxx      |   27 +---
 reportdesign/source/ui/inspection/GeometryHandler.cxx        |   25 +---
 reportdesign/source/ui/inspection/ReportComponentHandler.cxx |   27 +---
 reportdesign/source/ui/misc/rptuiservices.cxx                |   64 -----------
 reportdesign/source/ui/misc/statusbarcontroller.cxx          |   24 +---
 reportdesign/source/ui/report/ReportController.cxx           |   28 +---
 reportdesign/util/rptui.component                            |   20 ++-
 scaddins/source/analysis/analysis.component                  |    2 
 solenv/bin/native-code.py                                    |    3 
 19 files changed, 79 insertions(+), 277 deletions(-)

New commits:
commit 685b520a5929ce1b0b7af1adbc4dc9462e222d3c
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Jul 25 11:06:30 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Jul 25 16:29:34 2020 +0200

    don't need prefix here anymore
    
    Change-Id: Ie3b6681cb4ae8c1138766db7b19cc473367bfbd7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99422
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/filter/source/odfflatxml/OdfFlatXml.cxx b/filter/source/odfflatxml/OdfFlatXml.cxx
index 3ac579fc087a..2846de1441ed 100644
--- a/filter/source/odfflatxml/OdfFlatXml.cxx
+++ b/filter/source/odfflatxml/OdfFlatXml.cxx
@@ -14,6 +14,7 @@
 #include <cppuhelper/supportsservice.hxx>
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
+#include <rtl/ref.hxx>
 
 #include <sax/tools/documenthandleradapter.hxx>
 
@@ -92,13 +93,6 @@ namespace filter::odfflatxml {
                         "com.sun.star.document.ExportFilter"};
             }
 
-            // UNO component helper methods
-
-            static OUString impl_getImplementationName();
-
-            static Sequence< OUString > impl_getSupportedServiceNames();
-
-            static Reference< XInterface > SAL_CALL impl_createInstance(const Reference< XMultiServiceFactory >& fact);
         };
 
         }
@@ -199,49 +193,13 @@ OdfFlatXml::exporter(const Sequence< PropertyValue >& sourceData,
     return true;
 }
 
-
-OUString OdfFlatXml::impl_getImplementationName()
-{
-    return "com.sun.star.comp.filter.OdfFlatXml";
-}
-
-Sequence< OUString > OdfFlatXml::impl_getSupportedServiceNames()
-{
-    return { "com.sun.star.document.ImportFilter", "com.sun.star.document.ExportFilter" };
-}
-
-Reference< XInterface > SAL_CALL OdfFlatXml::impl_createInstance(const Reference< XMultiServiceFactory >& fact)
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+filter_OdfFlatXml_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
 {
-    return Reference<XInterface> (static_cast<OWeakObject *>(new OdfFlatXml( comphelper::getComponentContext(fact) )));
-
-}
-
-extern "C" SAL_DLLPUBLIC_EXPORT void*
-odfflatxml_component_getFactory( const char* pImplementationName,
-                      void* pServiceManager,
-                      void* /* pRegistryKey */ )
-{
-    if ((!pImplementationName) || (!pServiceManager))
-        return nullptr;
-
-    css::uno::Reference< css::lang::XMultiServiceFactory >
-        xSMGR = static_cast< css::lang::XMultiServiceFactory* >(pServiceManager);
-    css::uno::Reference< css::lang::XSingleServiceFactory > xFactory;
-    OUString sImplName = OUString::createFromAscii(pImplementationName);
-
-    if (OdfFlatXml::impl_getImplementationName() == sImplName)
-        xFactory = cppu::createOneInstanceFactory( xSMGR,
-                                                   OdfFlatXml::impl_getImplementationName(),
-                                                   OdfFlatXml::impl_createInstance,
-                                                   OdfFlatXml::impl_getSupportedServiceNames() );
-
-    if (xFactory.is())
-    {
-        xFactory->acquire();
-        return xFactory.get();
-    }
-
-    return nullptr;
+    static rtl::Reference<OdfFlatXml> g_Instance(new OdfFlatXml(context));
+    g_Instance->acquire();
+    return static_cast<cppu::OWeakObject*>(g_Instance.get());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/odfflatxml/odfflatxml.component b/filter/source/odfflatxml/odfflatxml.component
index 7fc938227d7e..273ff4582d54 100644
--- a/filter/source/odfflatxml/odfflatxml.component
+++ b/filter/source/odfflatxml/odfflatxml.component
@@ -8,8 +8,9 @@
  *
 -->
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
-    prefix="odfflatxml" xmlns="http://openoffice.org/2010/uno-components">
-  <implementation name="com.sun.star.comp.filter.OdfFlatXml">
+    xmlns="http://openoffice.org/2010/uno-components">
+  <implementation name="com.sun.star.comp.filter.OdfFlatXml"
+    constructor="filter_OdfFlatXml_get_implementation">
     <service name="com.sun.star.document.ImportFilter"/>
     <service name="com.sun.star.document.ExportFilter"/>
   </implementation>
diff --git a/scaddins/source/analysis/analysis.component b/scaddins/source/analysis/analysis.component
index 0eff15b7e9f0..4f287f727ce8 100644
--- a/scaddins/source/analysis/analysis.component
+++ b/scaddins/source/analysis/analysis.component
@@ -18,7 +18,7 @@
  -->
 
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
-    prefix="analysis" xmlns="http://openoffice.org/2010/uno-components">
+    xmlns="http://openoffice.org/2010/uno-components">
   <implementation name="com.sun.star.sheet.addin.AnalysisImpl"
     constructor="scaddins_AnalysisAddIn_get_implementation">
     <service name="com.sun.star.sheet.AddIn"/>
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index f6e50d096366..e0ef388dd818 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -24,7 +24,6 @@ core_factory_list = [
     ("libsmlo.a", "sm_component_getFactory"),
     ("libucb1.a", "ucb_component_getFactory"),
     ("libxstor.a", "xstor_component_getFactory"),
-    ("libodfflatxmllo.a", "odfflatxml_component_getFactory"),
     ("libvcllo.a", "vcl_component_getFactory"),
     ("libsvtlo.a", "svt_component_getFactory"),
     ]
@@ -146,6 +145,8 @@ core_constructor_list = [
     "filter_FrameLoaderFactory_get_implementation",
     "filter_FilterFactory_get_implementation",
     "filter_ContentHandlerFactory_get_implementation",
+# filter/source/odfflatxml/odfflatxml.component
+    "filter_OdfFlatXml_get_implementation",
 # filter/source/pdf/pdffilter.component
     "filter_PdfDecomposer_get_implementation",
     "filter_PDFExportInteractionHandler_get_implementation",
commit 8785f14a325c6be471f45cd7df04e3384174ce26
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Jul 25 11:35:32 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Jul 25 16:29:15 2020 +0200

    reportdesign/ui: create instances with uno constructors
    
    See tdf#74608 for motivation.
    
    Change-Id: I622baf4f956cf55ef279b6b659bb477b46d392a4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99425
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/reportdesign/Library_rptui.mk b/reportdesign/Library_rptui.mk
index f04d8a1521f2..ea98fb830b50 100644
--- a/reportdesign/Library_rptui.mk
+++ b/reportdesign/Library_rptui.mk
@@ -68,7 +68,6 @@ $(eval $(call gb_Library_add_exception_objects,rptui,\
     reportdesign/source/ui/inspection/ReportComponentHandler \
     reportdesign/source/ui/misc/ColorListener \
     reportdesign/source/ui/misc/FunctionHelper \
-    reportdesign/source/ui/misc/rptuiservices \
     reportdesign/source/ui/misc/RptUndo \
     reportdesign/source/ui/misc/statusbarcontroller \
     reportdesign/source/ui/misc/UITools \
diff --git a/reportdesign/source/ui/inc/DataProviderHandler.hxx b/reportdesign/source/ui/inc/DataProviderHandler.hxx
index 657f900b7b69..05dd693a9e80 100644
--- a/reportdesign/source/ui/inc/DataProviderHandler.hxx
+++ b/reportdesign/source/ui/inc/DataProviderHandler.hxx
@@ -48,14 +48,6 @@ namespace rptui
         public DataProviderHandler_Base
     {
     public:
-        // XServiceInfo - static versions
-        /// @throws css::uno::RuntimeException
-        static OUString getImplementationName_Static(  );
-        /// @throws css::uno::RuntimeException
-        static css::uno::Sequence< OUString > getSupportedServiceNames_static(  );
-        static css::uno::Reference< css::uno::XInterface >
-                        create(const css::uno::Reference< css::uno::XComponentContext >&);
-
         explicit DataProviderHandler(css::uno::Reference< css::uno::XComponentContext > const & context);
     private:
 
diff --git a/reportdesign/source/ui/inc/DefaultInspection.hxx b/reportdesign/source/ui/inc/DefaultInspection.hxx
index e740112e5c7b..3f32725c584f 100644
--- a/reportdesign/source/ui/inc/DefaultInspection.hxx
+++ b/reportdesign/source/ui/inc/DefaultInspection.hxx
@@ -77,14 +77,6 @@ namespace rptui
         void    createWithHelpSection( sal_Int32 _nMinHelpTextLines, sal_Int32 _nMaxHelpTextLines );
 
     public:
-        // XServiceInfo - static versions
-        /// @throws css::uno::RuntimeException
-        static OUString getImplementationName_Static(  );
-        /// @throws css::uno::RuntimeException
-        static css::uno::Sequence< OUString > getSupportedServiceNames_static(  );
-        static css::uno::Reference< css::uno::XInterface >
-                        create(const css::uno::Reference< css::uno::XComponentContext >&);
-
         DefaultComponentInspectorModel( const css::uno::Reference< css::uno::XComponentContext >& _rxContext);
     };
 
diff --git a/reportdesign/source/ui/inc/GeometryHandler.hxx b/reportdesign/source/ui/inc/GeometryHandler.hxx
index d4520e210348..5c9e103c2903 100644
--- a/reportdesign/source/ui/inc/GeometryHandler.hxx
+++ b/reportdesign/source/ui/inc/GeometryHandler.hxx
@@ -236,15 +236,6 @@ namespace rptui
         // XPropertyChangeListener
         virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent& evt) override;
 
-    public:
-        // XServiceInfo - static versions
-        /// @throws css::uno::RuntimeException
-        static OUString getImplementationName_Static(  );
-        /// @throws css::uno::RuntimeException
-        static css::uno::Sequence< OUString > getSupportedServiceNames_static(  );
-        static css::uno::Reference< css::uno::XInterface >
-                        create(const css::uno::Reference< css::uno::XComponentContext >&);
-
     public:
         explicit GeometryHandler(css::uno::Reference< css::uno::XComponentContext > const & context);
 
diff --git a/reportdesign/source/ui/inc/ReportComponentHandler.hxx b/reportdesign/source/ui/inc/ReportComponentHandler.hxx
index 3a329c58d2eb..fdf4ad0e6226 100644
--- a/reportdesign/source/ui/inc/ReportComponentHandler.hxx
+++ b/reportdesign/source/ui/inc/ReportComponentHandler.hxx
@@ -41,15 +41,6 @@ namespace rptui
         private ::cppu::BaseMutex,
         public ReportComponentHandler_Base
     {
-    public:
-        // XServiceInfo - static versions
-        /// @throws css::uno::RuntimeException
-        static OUString getImplementationName_Static(  );
-        /// @throws css::uno::RuntimeException
-        static css::uno::Sequence< OUString > getSupportedServiceNames_static(  );
-        static css::uno::Reference< css::uno::XInterface >
-                        create(const css::uno::Reference< css::uno::XComponentContext >&);
-
     public:
         explicit ReportComponentHandler(css::uno::Reference< css::uno::XComponentContext > const & context);
 
diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx
index a6fc9f155039..06ee94c3bd49 100644
--- a/reportdesign/source/ui/inc/ReportController.hxx
+++ b/reportdesign/source/ui/inc/ReportController.hxx
@@ -346,13 +346,6 @@ namespace rptui
         // XServiceInfo
         virtual OUString SAL_CALL getImplementationName() override;
         virtual css::uno::Sequence< OUString> SAL_CALL getSupportedServiceNames() override;
-        // need by registration
-        /// @throws css::uno::RuntimeException
-        static OUString getImplementationName_Static();
-        /// @throws css::uno::RuntimeException
-        static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
-        static css::uno::Reference< css::uno::XInterface >
-            create(css::uno::Reference< css::uno::XComponentContext > const & xContext);
 
         // css::container::XContainerListener
         virtual void SAL_CALL elementInserted(const css::container::ContainerEvent& Event) override;
diff --git a/reportdesign/source/ui/inc/statusbarcontroller.hxx b/reportdesign/source/ui/inc/statusbarcontroller.hxx
index be539ec25e3c..13bfb7706ab6 100644
--- a/reportdesign/source/ui/inc/statusbarcontroller.hxx
+++ b/reportdesign/source/ui/inc/statusbarcontroller.hxx
@@ -37,13 +37,6 @@ namespace rptui
     public:
         OStatusbarController(const css::uno::Reference< css::uno::XComponentContext >& _rxORB);
 
-        /// @throws css::uno::RuntimeException
-        static OUString getImplementationName_Static();
-        /// @throws css::uno::RuntimeException
-        static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
-        static css::uno::Reference< css::uno::XInterface >
-            create(css::uno::Reference< css::uno::XComponentContext > const & xContext);
-
     private:
         void SAL_CALL dispose() override;
         // XInterface
diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
index a41703aaf4c2..fabb755a2be0 100644
--- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx
+++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
@@ -64,7 +64,7 @@ DataProviderHandler::DataProviderHandler(uno::Reference< uno::XComponentContext
 
 OUString SAL_CALL DataProviderHandler::getImplementationName(  )
 {
-    return getImplementationName_Static();
+    return "com.sun.star.comp.report.DataProviderHandler";
 }
 
 sal_Bool SAL_CALL DataProviderHandler::supportsService( const OUString& ServiceName )
@@ -74,24 +74,9 @@ sal_Bool SAL_CALL DataProviderHandler::supportsService( const OUString& ServiceN
 
 uno::Sequence< OUString > SAL_CALL DataProviderHandler::getSupportedServiceNames(  )
 {
-    return getSupportedServiceNames_static();
+    return { "com.sun.star.report.inspection.DataProviderHandler" };
 }
 
-OUString DataProviderHandler::getImplementationName_Static(  )
-{
-    return "com.sun.star.comp.report.DataProviderHandler";
-}
-
-uno::Sequence< OUString > DataProviderHandler::getSupportedServiceNames_static(  )
-{
-    uno::Sequence< OUString > aSupported { "com.sun.star.report.inspection.DataProviderHandler" };
-    return aSupported;
-}
-
-uno::Reference< uno::XInterface > DataProviderHandler::create( const uno::Reference< uno::XComponentContext >& _rxContext )
-{
-    return *(new DataProviderHandler( _rxContext ));
-}
 // override WeakComponentImplHelperBase::disposing()
 // This function is called upon disposing the component,
 // if your component needs special work when it becomes
@@ -513,4 +498,11 @@ bool DataProviderHandler::impl_dialogChartType_nothrow( ::osl::ClearableMutexGua
 } // namespace rptui
 
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+reportdesign_DataProviderHandler_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
+{
+    return cppu::acquire(new rptui::DataProviderHandler(context));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/reportdesign/source/ui/inspection/DefaultInspection.cxx b/reportdesign/source/ui/inspection/DefaultInspection.cxx
index e7346e4c3603..5ab49d95ae01 100644
--- a/reportdesign/source/ui/inspection/DefaultInspection.cxx
+++ b/reportdesign/source/ui/inspection/DefaultInspection.cxx
@@ -61,7 +61,7 @@ namespace rptui
 
     OUString SAL_CALL DefaultComponentInspectorModel::getImplementationName(  )
     {
-        return getImplementationName_Static();
+        return "com.sun.star.comp.report.DefaultComponentInspectorModel";
     }
 
     sal_Bool SAL_CALL DefaultComponentInspectorModel::supportsService( const OUString& ServiceName )
@@ -71,26 +71,9 @@ namespace rptui
 
     Sequence< OUString > SAL_CALL DefaultComponentInspectorModel::getSupportedServiceNames(  )
     {
-        return getSupportedServiceNames_static();
+        return { "com.sun.star.report.inspection.DefaultComponentInspectorModel" };
     }
 
-    OUString DefaultComponentInspectorModel::getImplementationName_Static(  )
-    {
-        return "com.sun.star.comp.report.DefaultComponentInspectorModel";
-    }
-
-    Sequence< OUString > DefaultComponentInspectorModel::getSupportedServiceNames_static(  )
-    {
-        Sequence< OUString > aSupported { "com.sun.star.report.inspection.DefaultComponentInspectorModel" };
-        return aSupported;
-    }
-
-    Reference< XInterface > DefaultComponentInspectorModel::create( const Reference< XComponentContext >& _rxContext )
-    {
-        return *(new DefaultComponentInspectorModel( _rxContext ));
-    }
-
-
     Sequence< Any > SAL_CALL DefaultComponentInspectorModel::getHandlerFactories()
     {
         // service names for all our handlers
@@ -221,5 +204,11 @@ namespace rptui
 
 } // namespace rptui
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+reportdesign_DefaultComponentInspectorModel_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
+{
+    return cppu::acquire(new rptui::DefaultComponentInspectorModel(context));
+}
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index d5b9748e25c6..4a6de7fda696 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -218,7 +218,7 @@ GeometryHandler::~GeometryHandler()
 
 OUString SAL_CALL GeometryHandler::getImplementationName(  )
 {
-    return getImplementationName_Static();
+    return "com.sun.star.comp.report.GeometryHandler";
 }
 
 sal_Bool SAL_CALL GeometryHandler::supportsService( const OUString& ServiceName )
@@ -228,24 +228,9 @@ sal_Bool SAL_CALL GeometryHandler::supportsService( const OUString& ServiceName
 
 uno::Sequence< OUString > SAL_CALL GeometryHandler::getSupportedServiceNames(  )
 {
-    return getSupportedServiceNames_static();
-}
-
-OUString GeometryHandler::getImplementationName_Static(  )
-{
-    return "com.sun.star.comp.report.GeometryHandler";
-}
-
-uno::Sequence< OUString > GeometryHandler::getSupportedServiceNames_static(  )
-{
-    uno::Sequence< OUString > aSupported { "com.sun.star.report.inspection.GeometryHandler" };
-    return aSupported;
+    return { "com.sun.star.report.inspection.GeometryHandler" };
 }
 
-uno::Reference< uno::XInterface > GeometryHandler::create( const uno::Reference< uno::XComponentContext >& _rxContext )
-{
-    return *(new GeometryHandler( _rxContext ));
-}
 // override WeakComponentImplHelperBase::disposing()
 // This function is called upon disposing the component,
 // if your component needs special work when it becomes
@@ -2216,5 +2201,11 @@ void SAL_CALL GeometryHandler::propertyChange(const beans::PropertyChangeEvent&
 
 } // namespace rptui
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+reportdesign_GeometryHandler_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
+{
+    return cppu::acquire(new rptui::GeometryHandler(context));
+}
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/reportdesign/source/ui/inspection/ReportComponentHandler.cxx b/reportdesign/source/ui/inspection/ReportComponentHandler.cxx
index ece8e8d23865..3e4fe9ae6884 100644
--- a/reportdesign/source/ui/inspection/ReportComponentHandler.cxx
+++ b/reportdesign/source/ui/inspection/ReportComponentHandler.cxx
@@ -46,7 +46,7 @@ ReportComponentHandler::ReportComponentHandler(uno::Reference< uno::XComponentCo
 
 OUString SAL_CALL ReportComponentHandler::getImplementationName(  )
 {
-    return getImplementationName_Static();
+    return "com.sun.star.comp.report.ReportComponentHandler";
 }
 
 sal_Bool SAL_CALL ReportComponentHandler::supportsService( const OUString& ServiceName )
@@ -56,24 +56,9 @@ sal_Bool SAL_CALL ReportComponentHandler::supportsService( const OUString& Servi
 
 uno::Sequence< OUString > SAL_CALL ReportComponentHandler::getSupportedServiceNames(  )
 {
-    return getSupportedServiceNames_static();
-}
-
-OUString ReportComponentHandler::getImplementationName_Static(  )
-{
-    return "com.sun.star.comp.report.ReportComponentHandler";
-}
-
-uno::Sequence< OUString > ReportComponentHandler::getSupportedServiceNames_static(  )
-{
-    uno::Sequence< OUString > aSupported { "com.sun.star.report.inspection.ReportComponentHandler" };
-    return aSupported;
+    return { "com.sun.star.report.inspection.ReportComponentHandler" };
 }
 
-uno::Reference< uno::XInterface > ReportComponentHandler::create( const uno::Reference< uno::XComponentContext >& _rxContext )
-{
-    return *(new ReportComponentHandler( _rxContext ));
-}
 // override WeakComponentImplHelperBase::disposing()
 // This function is called upon disposing the component,
 // if your component needs special work when it becomes
@@ -203,4 +188,12 @@ sal_Bool SAL_CALL ReportComponentHandler::suspend(sal_Bool Suspend)
 } // namespace rptui
 
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+reportdesign_ReportComponentHandler_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
+{
+    return cppu::acquire(new rptui::ReportComponentHandler(context));
+}
+
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/reportdesign/source/ui/misc/rptuiservices.cxx b/reportdesign/source/ui/misc/rptuiservices.cxx
deleted file mode 100644
index 622d45add21d..000000000000
--- a/reportdesign/source/ui/misc/rptuiservices.cxx
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#include <cppuhelper/factory.hxx>
-#include <cppuhelper/implementationentry.hxx>
-#include <ReportController.hxx>
-#include <statusbarcontroller.hxx>
-#include <DefaultInspection.hxx>
-#include <ReportComponentHandler.hxx>
-#include <GeometryHandler.hxx>
-#include <DataProviderHandler.hxx>
-
-/********************************************************************************************/
-
-using namespace ::rptui;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::registry;
-
-
-// registry functions
-namespace
-{
-
-cppu::ImplementationEntry const entries[] = {
-    { &OReportController::create, &OReportController::getImplementationName_Static, &OReportController::getSupportedServiceNames_Static,
-        &cppu::createSingleComponentFactory, nullptr, 0 },
-    { &OStatusbarController::create, &OStatusbarController::getImplementationName_Static, &OStatusbarController::getSupportedServiceNames_Static,
-        &cppu::createSingleComponentFactory, nullptr, 0 },
-    { &DefaultComponentInspectorModel::create, &DefaultComponentInspectorModel::getImplementationName_Static, &DefaultComponentInspectorModel::getSupportedServiceNames_static,
-        &cppu::createSingleComponentFactory, nullptr, 0 },
-    { &ReportComponentHandler::create, &ReportComponentHandler::getImplementationName_Static, &ReportComponentHandler::getSupportedServiceNames_static,
-        &cppu::createSingleComponentFactory, nullptr, 0 },
-    { &GeometryHandler::create, &GeometryHandler::getImplementationName_Static, &GeometryHandler::getSupportedServiceNames_static,
-        &cppu::createSingleComponentFactory, nullptr, 0 },
-    { &DataProviderHandler::create, &DataProviderHandler::getImplementationName_Static, &DataProviderHandler::getSupportedServiceNames_static,
-        &cppu::createSingleComponentFactory, nullptr, 0 },
-    { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
-};
-}
-
-extern "C" SAL_DLLPUBLIC_EXPORT void * rptui_component_getFactory(
-    char const * implName, void * serviceManager, void * registryKey)
-{
-    return cppu::component_getFactoryHelper(
-        implName, serviceManager, registryKey, entries);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/reportdesign/source/ui/misc/statusbarcontroller.cxx b/reportdesign/source/ui/misc/statusbarcontroller.cxx
index bae4a793a6b7..0c1313137759 100644
--- a/reportdesign/source/ui/misc/statusbarcontroller.cxx
+++ b/reportdesign/source/ui/misc/statusbarcontroller.cxx
@@ -44,21 +44,10 @@ namespace rptui
     using namespace ::com::sun::star::util;
 
 OUString SAL_CALL OStatusbarController::getImplementationName()
-{
-    return getImplementationName_Static();
-}
-
-OUString OStatusbarController::getImplementationName_Static()
 {
     return "com.sun.star.report.comp.StatusbarController";
 }
 
-Sequence< OUString> OStatusbarController::getSupportedServiceNames_Static()
-{
-    Sequence<OUString> aSupported { "com.sun.star.frame.StatusbarController" };
-    return aSupported;
-}
-
 sal_Bool SAL_CALL OStatusbarController::supportsService( const OUString& ServiceName )
 {
     return cppu::supportsService(this, ServiceName);
@@ -66,13 +55,9 @@ sal_Bool SAL_CALL OStatusbarController::supportsService( const OUString& Service
 
 Sequence< OUString> SAL_CALL OStatusbarController::getSupportedServiceNames()
 {
-    return getSupportedServiceNames_Static();
+    return { "com.sun.star.frame.StatusbarController" };
 }
 
-Reference< XInterface > OStatusbarController::create(Reference< XComponentContext > const & xContext)
-{
-    return *(new OStatusbarController(xContext));
-}
 IMPLEMENT_FORWARD_XINTERFACE2(OStatusbarController, ::svt::StatusbarController,OStatusbarController_BASE)
 
 OStatusbarController::OStatusbarController(const Reference< XComponentContext >& rxContext)
@@ -226,5 +211,12 @@ void SAL_CALL OStatusbarController::dispose()
 
 } // rptui
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+reportdesign_OStatusbarController_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
+{
+    return cppu::acquire(new rptui::OStatusbarController(context));
+}
+
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 087724e5f851..a66636c6bf91 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -233,30 +233,13 @@ static void lcl_getReportControlFormat(const Sequence< PropertyValue >& aArgs,
 }
 
 OUString SAL_CALL OReportController::getImplementationName()
-{
-    return getImplementationName_Static();
-}
-
-
-OUString OReportController::getImplementationName_Static()
 {
     return "com.sun.star.report.comp.ReportDesign";
 }
 
-Sequence< OUString> OReportController::getSupportedServiceNames_Static()
-{
-    Sequence<OUString> aSupported { "com.sun.star.sdb.ReportDesign" };
-    return aSupported;
-}
-
 Sequence< OUString> SAL_CALL OReportController::getSupportedServiceNames()
 {
-    return getSupportedServiceNames_Static();
-}
-
-Reference< XInterface > OReportController::create(Reference< XComponentContext > const & xContext)
-{
-    return *(new OReportController(xContext));
+    return { "com.sun.star.sdb.ReportDesign" };
 }
 
 #define PROPERTY_ID_ZOOMVALUE   1
@@ -4362,4 +4345,13 @@ void OReportController::addUndoAction( std::unique_ptr<SfxUndoAction> i_pAction
     InvalidateFeature( SID_UNDO );
     InvalidateFeature( SID_REDO );
 }
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+reportdesign_OReportController_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
+{
+    return cppu::acquire(new OReportController(context));
+}
+
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/reportdesign/util/rptui.component b/reportdesign/util/rptui.component
index bb7d4a5dd842..0e094f3c1f70 100644
--- a/reportdesign/util/rptui.component
+++ b/reportdesign/util/rptui.component
@@ -18,23 +18,29 @@
  -->
 
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
-    prefix="rptui" xmlns="http://openoffice.org/2010/uno-components">
-  <implementation name="com.sun.star.comp.report.DataProviderHandler">
+    xmlns="http://openoffice.org/2010/uno-components">
+  <implementation name="com.sun.star.comp.report.DataProviderHandler"
+    constructor="reportdesign_DataProviderHandler_get_implementation">
     <service name="com.sun.star.report.inspection.DataProviderHandler"/>
   </implementation>
-  <implementation name="com.sun.star.comp.report.DefaultComponentInspectorModel">
+  <implementation name="com.sun.star.comp.report.DefaultComponentInspectorModel"
+    constructor="reportdesign_DefaultComponentInspectorModel_get_implementation">
     <service name="com.sun.star.report.inspection.DefaultComponentInspectorModel"/>
   </implementation>
-  <implementation name="com.sun.star.comp.report.GeometryHandler">
+  <implementation name="com.sun.star.comp.report.GeometryHandler"
+    constructor="reportdesign_GeometryHandler_get_implementation">
     <service name="com.sun.star.report.inspection.GeometryHandler"/>
   </implementation>
-  <implementation name="com.sun.star.comp.report.ReportComponentHandler">
+  <implementation name="com.sun.star.comp.report.ReportComponentHandler"
+    constructor="reportdesign_ReportComponentHandler_get_implementation">
     <service name="com.sun.star.report.inspection.ReportComponentHandler"/>
   </implementation>
-  <implementation name="com.sun.star.report.comp.ReportDesign">
+  <implementation name="com.sun.star.report.comp.ReportDesign"
+    constructor="reportdesign_OReportController_get_implementation">
     <service name="com.sun.star.sdb.ReportDesign"/>
   </implementation>
-  <implementation name="com.sun.star.report.comp.StatusbarController">
+  <implementation name="com.sun.star.report.comp.StatusbarController"
+    constructor="reportdesign_OStatusbarController_get_implementation">
     <service name="com.sun.star.frame.StatusbarController"/>
   </implementation>
 </component>


More information about the Libreoffice-commits mailing list