[Libreoffice-commits] core.git: 2 commits - sc/Library_vbaobj.mk sc/source sc/util sd/Library_sd.mk sd/source sd/util solenv/bin

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sun Jul 26 15:10:54 UTC 2020


 sc/Library_vbaobj.mk                |    1 
 sc/source/ui/vba/service.cxx        |   42 ------------
 sc/source/ui/vba/service.hxx        |   43 ------------
 sc/source/ui/vba/vbaapplication.cxx |   14 +---
 sc/source/ui/vba/vbahyperlink.cxx   |   13 +--
 sc/source/ui/vba/vbarange.cxx       |   20 ++---
 sc/source/ui/vba/vbarange.hxx       |    5 -
 sc/source/ui/vba/vbawindow.cxx      |   13 +--
 sc/source/ui/vba/vbaworkbook.cxx    |   13 +--
 sc/source/ui/vba/vbaworksheet.cxx   |   12 +--
 sc/util/vbaobj.component            |   14 ++--
 sd/Library_sd.mk                    |    1 
 sd/source/ui/inc/facreg.hxx         |   44 ------------
 sd/source/ui/unoidl/facreg.cxx      |  123 ------------------------------------
 sd/source/ui/unoidl/unodoc.cxx      |   59 +++++++----------
 sd/util/sd.component                |    8 +-
 solenv/bin/native-code.py           |   14 +++-
 17 files changed, 85 insertions(+), 354 deletions(-)

New commits:
commit c6046e915df2496357a84736ad6a1962394a6378
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sun Jul 26 16:16:39 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Jul 26 17:10:24 2020 +0200

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

diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index 43b168be8d8c..9d399e8e3f5a 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -418,7 +418,6 @@ $(eval $(call gb_Library_add_exception_objects,sd,\
 	sd/source/ui/unoidl/SdUnoOutlineView \
 	sd/source/ui/unoidl/SdUnoSlideView \
 	sd/source/ui/unoidl/UnoDocumentSettings \
-	sd/source/ui/unoidl/facreg \
 	sd/source/ui/unoidl/randomnode \
 	sd/source/ui/unoidl/unocpres \
 	sd/source/ui/unoidl/unodoc \
diff --git a/sd/source/ui/inc/facreg.hxx b/sd/source/ui/inc/facreg.hxx
deleted file mode 100644
index aee3924d3d44..000000000000
--- a/sd/source/ui/inc/facreg.hxx
+++ /dev/null
@@ -1,44 +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 .
- */
-
-#ifndef INCLUDED_SD_SOURCE_UI_INC_FACREG_HXX
-#define INCLUDED_SD_SOURCE_UI_INC_FACREG_HXX
-
-#include <sal/config.h>
-#include <sfx2/sfxmodelfactory.hxx>
-
-namespace com::sun::star {
-    namespace lang { class XMultiServiceFactory; }
-}
-
-css::uno::Reference< css::uno::XInterface > SdDrawingDocument_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory > & _rxFactory, SfxModelFlags _nCreationFlags );
-/// @throws css::uno::RuntimeException
-OUString SdDrawingDocument_getImplementationName();
-/// @throws css::uno::RuntimeException
-css::uno::Sequence< OUString >SdDrawingDocument_getSupportedServiceNames();
-
-css::uno::Reference< css::uno::XInterface > SdPresentationDocument_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory > & _rxFactory, SfxModelFlags _nCreationFlags );
-/// @throws css::uno::RuntimeException
-OUString SdPresentationDocument_getImplementationName();
-/// @throws css::uno::RuntimeException
-css::uno::Sequence< OUString > SdPresentationDocument_getSupportedServiceNames();
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/unoidl/facreg.cxx b/sd/source/ui/unoidl/facreg.cxx
deleted file mode 100644
index 6fffe8a3bec5..000000000000
--- a/sd/source/ui/unoidl/facreg.cxx
+++ /dev/null
@@ -1,123 +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 <com/sun/star/lang/XSingleComponentFactory.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-
-#include <facreg.hxx>
-#include <sddll.hxx>
-
-#include <sfx2/sfxmodelfactory.hxx>
-#include <sal/types.h>
-
-#include <unordered_map>
-
-using namespace com::sun::star;
-
-// Declaration and initialization of a map from service names to locally
-// unique factory identifiers.
-
-namespace {
-
-enum FactoryId
-{
-    SdDrawingDocumentFactoryId,
-    SdPresentationDocumentFactoryId,
-};
-
-}
-
-typedef std::unordered_map<OUString, FactoryId> FactoryMap;
-
-namespace {
-FactoryMap const & GetFactoryMap()
-{
-    static FactoryMap aFactoryMap
-    {
-        { SdDrawingDocument_getImplementationName(), SdDrawingDocumentFactoryId },
-        { SdPresentationDocument_getImplementationName(), SdPresentationDocumentFactoryId }
-    };
-    return aFactoryMap;
-};
-} // end of anonymous namespace
-
-extern "C"
-{
-
-SAL_DLLPUBLIC_EXPORT void * sd_component_getFactory(
-    const char * pImplName,
-    void           * pServiceManager,
-    void           *  )
-{
-    void * pRet = nullptr;
-
-    if( pServiceManager )
-    {
-        uno::Reference< lang::XMultiServiceFactory > xMSF( static_cast< lang::XMultiServiceFactory * >( pServiceManager ) );
-
-        uno::Reference<lang::XSingleServiceFactory> xFactory;
-        uno::Reference<lang::XSingleComponentFactory> xComponentFactory;
-
-        const FactoryMap& rFactoryMap (GetFactoryMap());
-        OUString sImplementationName (OUString::createFromAscii(pImplName));
-        FactoryMap::const_iterator iFactory (rFactoryMap.find(sImplementationName));
-        if (iFactory != rFactoryMap.end())
-        {
-            switch (iFactory->second)
-            {
-                case SdDrawingDocumentFactoryId:
-                    xFactory = ::sfx2::createSfxModelFactory(
-                        xMSF,
-                        SdDrawingDocument_getImplementationName(),
-                        SdDrawingDocument_createInstance,
-                        SdDrawingDocument_getSupportedServiceNames());
-                    break;
-
-                case SdPresentationDocumentFactoryId:
-                    xFactory = ::sfx2::createSfxModelFactory(
-                        xMSF,
-                        SdPresentationDocument_getImplementationName(),
-                        SdPresentationDocument_createInstance,
-                        SdPresentationDocument_getSupportedServiceNames());
-                    break;
-
-                default:
-                    break;
-            }
-            if (xComponentFactory.is())
-            {
-                xComponentFactory->acquire();
-                pRet = xComponentFactory.get();
-            }
-            else if (xFactory.is())
-            {
-                xFactory->acquire();
-                pRet = xFactory.get();
-            }
-        }
-    }
-
-    if (pRet != nullptr)
-        SdDLL::Init();
-    return pRet;
-}
-
-} // end of extern "C"
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/unoidl/unodoc.cxx b/sd/source/ui/unoidl/unodoc.cxx
index bbc7fc1e6313..44eae1c2a46b 100644
--- a/sd/source/ui/unoidl/unodoc.cxx
+++ b/sd/source/ui/unoidl/unodoc.cxx
@@ -23,7 +23,6 @@
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 
 #include <sddll.hxx>
-#include <facreg.hxx>
 #include <DrawDocShell.hxx>
 #include <GraphicDocShell.hxx>
 #include <vcl/svapp.hxx>
@@ -32,53 +31,45 @@ using namespace ::com::sun::star;
 
 // com.sun.star.comp.Draw.DrawingDocument
 
-OUString SdDrawingDocument_getImplementationName()
-{
-    return "com.sun.star.comp.Draw.DrawingDocument";
-}
-
-uno::Sequence< OUString > SdDrawingDocument_getSupportedServiceNames()
-{
-    return { "com.sun.star.drawing.DrawingDocument", "com.sun.star.drawing.DrawingDocumentFactory" };
-}
-
-uno::Reference< uno::XInterface > SdDrawingDocument_createInstance(
-                const uno::Reference< lang::XMultiServiceFactory > &, SfxModelFlags _nCreationFlags )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+sd_DrawingDocument_get_implementation(
+    css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const& args)
 {
     SolarMutexGuard aGuard;
 
     SdDLL::Init();
 
-    SfxObjectShell* pShell = new ::sd::GraphicDocShell( _nCreationFlags );
-    return uno::Reference< uno::XInterface >( pShell->GetModel() );
+    css::uno::Reference<css::uno::XInterface> xInterface = sfx2::createSfxModelInstance(args,
+        [&](SfxModelFlags _nCreationFlags)
+        {
+            SfxObjectShell* pShell = new ::sd::GraphicDocShell( _nCreationFlags );
+            return uno::Reference< uno::XInterface >( pShell->GetModel() );
+        });
+    xInterface->acquire();
+    return xInterface.get();
 }
 
-// com.sun.star.comp.Draw.PresentationDocument
 
-OUString SdPresentationDocument_getImplementationName()
-{
-    return "com.sun.star.comp.Draw.PresentationDocument";
-}
-
-uno::Sequence< OUString > SdPresentationDocument_getSupportedServiceNames()
-{
-    return  uno::Sequence<OUString>{
-       "com.sun.star.drawing.DrawingDocumentFactory",
-       "com.sun.star.presentation.PresentationDocument"
-    };
-}
+// com.sun.star.comp.Draw.PresentationDocument
 
-uno::Reference< uno::XInterface > SdPresentationDocument_createInstance(
-                const uno::Reference< lang::XMultiServiceFactory > &, SfxModelFlags _nCreationFlags )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+sd_PresentationDocument_get_implementation(
+    css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const& args)
 {
     SolarMutexGuard aGuard;
 
     SdDLL::Init();
 
-    SfxObjectShell* pShell =
-        new ::sd::DrawDocShell(
-            _nCreationFlags, false, DocumentType::Impress );
-    return uno::Reference< uno::XInterface >( pShell->GetModel() );
+    css::uno::Reference<css::uno::XInterface> xInterface = sfx2::createSfxModelInstance(args,
+        [&](SfxModelFlags _nCreationFlags)
+        {
+            SfxObjectShell* pShell =
+                new ::sd::DrawDocShell(
+                    _nCreationFlags, false, DocumentType::Impress );
+            return pShell->GetModel();
+        });
+    xInterface->acquire();
+    return xInterface.get();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/util/sd.component b/sd/util/sd.component
index fb70297d12f9..f1937a04873a 100644
--- a/sd/util/sd.component
+++ b/sd/util/sd.component
@@ -18,8 +18,9 @@
  -->
 
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
-    prefix="sd" xmlns="http://openoffice.org/2010/uno-components">
-  <implementation name="com.sun.star.comp.Draw.DrawingDocument">
+    xmlns="http://openoffice.org/2010/uno-components">
+  <implementation name="com.sun.star.comp.Draw.DrawingDocument"
+    constructor="sd_DrawingDocument_get_implementation">
     <service name="com.sun.star.drawing.DrawingDocument"/>
     <service name="com.sun.star.drawing.DrawingDocumentFactory"/>
   </implementation>
@@ -27,7 +28,8 @@
       constructor="com_sun_star_comp_Draw_DrawingModule_get_implementation">
     <service name="com.sun.star.drawing.ModuleDispatcher"/>
   </implementation>
-  <implementation name="com.sun.star.comp.Draw.PresentationDocument">
+  <implementation name="com.sun.star.comp.Draw.PresentationDocument"
+    constructor="sd_PresentationDocument_get_implementation">
     <service name="com.sun.star.drawing.DrawingDocumentFactory"/>
     <service name="com.sun.star.presentation.PresentationDocument"/>
   </implementation>
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 5b08c22339ab..c524d04f5046 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -559,7 +559,6 @@ calc_constructor_list = [
     ]
 
 draw_factory_list = [
-    ("libsdlo.a", "sd_component_getFactory"),
     ]
 
 draw_constructor_list = [
@@ -592,6 +591,19 @@ draw_constructor_list = [
     "filter_SVGFilter_get_implementation",
     "filter_SVGWriter_get_implementation",
 # sd/util/sd.component
+    "sd_DrawingDocument_get_implementation",
+    "com_sun_star_comp_Draw_DrawingModule_get_implementation",
+    "sd_PresentationDocument_get_implementation",
+    "com_sun_star_comp_Draw_PresenterHelper_get_implementation",
+    "com_sun_star_comp_Draw_PresenterPreviewCache_get_implementation",
+    "com_sun_star_comp_Draw_PresenterTextView_get_implementation",
+    "com_sun_star_comp_Draw_SlideRenderer_get_implementation",
+    "com_sun_star_comp_Draw_SlideSorter_get_implementation",
+    "com_sun_star_comp_Draw_framework_configuration_Configuration_get_implementation",
+    "com_sun_star_comp_draw_SdHtmlOptionsDialog_get_implementation",
+    "com_sun_star_comp_sd_InsertSlideController_get_implementation",
+    "com_sun_star_comp_sd_SlideLayoutController_get_implementation",
+    "com_sun_star_comp_sd_DisplayModeController_get_implementation",
     "RandomAnimationNode_get_implementation",
     "com_sun_star_comp_Draw_framework_BasicPaneFactory_get_implementation",
     "com_sun_star_comp_Draw_framework_BasicToolBarFactory_get_implementation",
commit 31b8db1d143b25400e307030f9672a556e69573a
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sun Jul 26 14:25:08 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Jul 26 17:10:17 2020 +0200

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

diff --git a/sc/Library_vbaobj.mk b/sc/Library_vbaobj.mk
index 9fa0628d3d92..1f62462d67bd 100644
--- a/sc/Library_vbaobj.mk
+++ b/sc/Library_vbaobj.mk
@@ -56,7 +56,6 @@ $(eval $(call gb_Library_use_libraries,vbaobj,\
 
 $(eval $(call gb_Library_add_exception_objects,vbaobj,\
 	sc/source/ui/vba/excelvbahelper \
-	sc/source/ui/vba/service \
 	sc/source/ui/vba/vbaapplication \
 	sc/source/ui/vba/vbaassistant \
 	sc/source/ui/vba/vbaaxes \
diff --git a/sc/source/ui/vba/service.cxx b/sc/source/ui/vba/service.cxx
deleted file mode 100644
index dab8e9d4db62..000000000000
--- a/sc/source/ui/vba/service.cxx
+++ /dev/null
@@ -1,42 +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 <comphelper/servicedecl.hxx>
-
-#include "service.hxx"
-
-// component exports
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-
-namespace sdecl = comphelper::service_decl;
-
-extern "C"
-{
-    SAL_DLLPUBLIC_EXPORT void * vbaobj_component_getFactory(
-        const char * pImplName, void *, void *)
-    {
-    void* pRet = sdecl::component_getFactoryHelper(
-            pImplName, {&range::serviceDecl, &workbook::serviceDecl, &worksheet::serviceDecl, &window::serviceDecl, &hyperlink::serviceDecl, &application::serviceDecl} );
-    return pRet;
-    }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/service.hxx b/sc/source/ui/vba/service.hxx
deleted file mode 100644
index 06b8e68ba0f1..000000000000
--- a/sc/source/ui/vba/service.hxx
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
-/*
- * 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/.
- */
-
-#ifndef INCLUDED_SC_SOURCE_UI_VBA_SERVICE_HXX
-#define INCLUDED_SC_SOURCE_UI_VBA_SERVICE_HXX
-
-#include <sal/config.h>
-
-namespace comphelper::service_decl { class ServiceDecl; }
-
-namespace application {
-extern comphelper::service_decl::ServiceDecl const serviceDecl;
-}
-
-namespace hyperlink {
-extern comphelper::service_decl::ServiceDecl const serviceDecl;
-}
-
-namespace range {
-extern comphelper::service_decl::ServiceDecl const serviceDecl;
-}
-
-namespace window {
-extern comphelper::service_decl::ServiceDecl const serviceDecl;
-}
-
-namespace workbook {
-extern comphelper::service_decl::ServiceDecl const serviceDecl;
-}
-
-namespace worksheet {
-extern comphelper::service_decl::ServiceDecl const serviceDecl;
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index 93b32a408d5b..bb59a92c0ebb 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -35,7 +35,6 @@
 #include <ooo/vba/office/MsoShapeType.hpp>
 #include <ooo/vba/office/MsoAutoShapeType.hpp>
 
-#include "service.hxx"
 #include "vbaapplication.hxx"
 #include "vbaworkbooks.hxx"
 #include "vbaworkbook.hxx"
@@ -1480,16 +1479,15 @@ ScVbaApplication::getServiceNames()
     return aServiceNames;
 }
 
-namespace application
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+Calc_ScVbaApplication_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& )
 {
-namespace sdecl = comphelper::service_decl;
-sdecl::vba_service_class_<ScVbaApplication, sdecl::with_args<false> > const serviceImpl;
-sdecl::ServiceDecl const serviceDecl(
-    serviceImpl,
-    "ScVbaApplication",
-    "ooo.vba.excel.Application" );
+    return cppu::acquire(new ScVbaApplication(context));
 }
 
+
 // ScVbaApplicationOutgoingConnectionPoint
 
 ScVbaApplicationOutgoingConnectionPoint::ScVbaApplicationOutgoingConnectionPoint( ScVbaApplication* pApp ) :
diff --git a/sc/source/ui/vba/vbahyperlink.cxx b/sc/source/ui/vba/vbahyperlink.cxx
index 9dc88cdd06cb..74a512bb6bda 100644
--- a/sc/source/ui/vba/vbahyperlink.cxx
+++ b/sc/source/ui/vba/vbahyperlink.cxx
@@ -19,7 +19,6 @@
 
 #include <sal/config.h>
 
-#include "service.hxx"
 #include "vbahyperlink.hxx"
 #include <vbahelper/helperdecl.hxx>
 #include <com/sun/star/beans/XPropertySet.hpp>
@@ -227,14 +226,12 @@ void ScVbaHyperlink::setUrlComponents( const UrlComponents& rUrlComp )
     mxTextField->setPropertyValue("URL", uno::Any( aUrl.makeStringAndClear() ) );
 }
 
-namespace hyperlink
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+Calc_ScVbaHyperlink_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& args)
 {
-namespace sdecl = comphelper::service_decl;
-sdecl::vba_service_class_<ScVbaHyperlink, sdecl::with_args<true> > const serviceImpl;
-sdecl::ServiceDecl const serviceDecl(
-    serviceImpl,
-    "ScVbaHyperlink",
-    "ooo.vba.excel.Hyperlink" );
+    return cppu::acquire(new ScVbaHyperlink(args, context));
 }
 
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 6f5c5a5d892a..1ea6f81d4055 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -123,7 +123,6 @@
 #include <unonames.hxx>
 
 #include "excelvbahelper.hxx"
-#include "service.hxx"
 #include "vbaapplication.hxx"
 #include "vbafont.hxx"
 #include "vbacomment.hxx"
@@ -5618,11 +5617,7 @@ ScVbaRange::getServiceImplName()
 uno::Sequence< OUString >
 ScVbaRange::getServiceNames()
 {
-    static uno::Sequence< OUString > const aServiceNames
-    {
-        "ooo.vba.excel.Range"
-    };
-    return aServiceNames;
+    return { "ooo.vba.excel.Range" };
 }
 
 sal_Bool SAL_CALL
@@ -5641,14 +5636,13 @@ ScVbaRange::hasError()
     return dResult > 0.0;
 }
 
-namespace range
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+Calc_ScVbaRange_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& args)
 {
-namespace sdecl = comphelper::service_decl;
-sdecl::vba_service_class_<ScVbaRange, sdecl::with_args<true> > const serviceImpl;
-sdecl::ServiceDecl const serviceDecl(
-    serviceImpl,
-    "SvVbaRange",
-    "ooo.vba.excel.Range" );
+    return cppu::acquire(new ScVbaRange(args, context));
 }
 
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbarange.hxx b/sc/source/ui/vba/vbarange.hxx
index 54b699a3b25e..5c28acf6f245 100644
--- a/sc/source/ui/vba/vbarange.hxx
+++ b/sc/source/ui/vba/vbarange.hxx
@@ -34,6 +34,7 @@ namespace com::sun::star::sheet { class XSheetCellRangeContainer; }
 namespace com::sun::star::table { class XCell; }
 namespace com::sun::star::table { class XCellRange; }
 namespace com::sun::star::table { struct CellRangeAddress; }
+namespace com::sun::star::lang { class XServiceInfo; }
 namespace ooo::vba { class XCollection; }
 namespace ooo::vba::excel { class XComment; }
 namespace ooo::vba::excel { class XFont; }
@@ -45,8 +46,6 @@ class ScDocShell;
 class ScDocument;
 class ScRangeList;
 
-typedef ScVbaFormat< ov::excel::XRange > ScVbaRange_BASE;
-
 class ArrayVisitor
 {
 public:
@@ -69,6 +68,8 @@ public:
     virtual const css::uno::Any& getValue() const = 0;
 };
 
+typedef ScVbaFormat< ov::excel::XRange > ScVbaRange_BASE;
+
 class ScVbaRange : public ScVbaRange_BASE
 {
     css::uno::Reference< ov::XCollection > m_Areas;
diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx
index d7dda7c89f0d..6f9d5291db61 100644
--- a/sc/source/ui/vba/vbawindow.cxx
+++ b/sc/source/ui/vba/vbawindow.cxx
@@ -18,7 +18,6 @@
  */
 #include <vbahelper/helperdecl.hxx>
 #include "excelvbahelper.hxx"
-#include "service.hxx"
 #include "vbawindow.hxx"
 #include "vbaworksheets.hxx"
 #include "vbaworksheet.hxx"
@@ -889,14 +888,12 @@ ScVbaWindow::getServiceNames()
     };
     return aServiceNames;
 }
-namespace window
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+Calc_ScVbaWindow_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& args)
 {
-namespace sdecl = comphelper::service_decl;
-sdecl::vba_service_class_<ScVbaWindow, sdecl::with_args<true> > const serviceImpl;
-sdecl::ServiceDecl const serviceDecl(
-    serviceImpl,
-    "ScVbaWindow",
-    "ooo.vba.excel.Window" );
+    return cppu::acquire(new ScVbaWindow(args, context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx
index 7665a226ef9b..b41a7ed72b01 100644
--- a/sc/source/ui/vba/vbaworkbook.cxx
+++ b/sc/source/ui/vba/vbaworkbook.cxx
@@ -29,7 +29,6 @@
 #include <ooo/vba/excel/XlFileFormat.hpp>
 #include <ooo/vba/excel/XApplication.hpp>
 
-#include "service.hxx"
 #include "vbaworksheet.hxx"
 #include "vbaworksheets.hxx"
 #include "vbaworkbook.hxx"
@@ -417,14 +416,12 @@ ScVbaWorkbook::getSomething(const uno::Sequence<sal_Int8 >& rId )
     return 0;
 }
 
-namespace workbook
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+Calc_ScVbaWorkbook_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& args)
 {
-namespace sdecl = comphelper::service_decl;
-sdecl::vba_service_class_<ScVbaWorkbook, sdecl::with_args<true> > const serviceImpl;
-sdecl::ServiceDecl const serviceDecl(
-    serviceImpl,
-    "ScVbaWorkbook",
-    "ooo.vba.excel.Workbook" );
+    return cppu::acquire(new ScVbaWorkbook(args, context));
 }
 
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx
index e39c36412bf9..afb977df2152 100644
--- a/sc/source/ui/vba/vbaworksheet.cxx
+++ b/sc/source/ui/vba/vbaworksheet.cxx
@@ -61,7 +61,6 @@
 
 #include <tabprotection.hxx>
 #include "excelvbahelper.hxx"
-#include "service.hxx"
 #include "vbaoutline.hxx"
 #include "vbarange.hxx"
 #include "vbacomments.hxx"
@@ -1050,14 +1049,11 @@ ScVbaWorksheet::getSomething(const uno::Sequence<sal_Int8 > & rId)
     return 0;
 }
 
-namespace worksheet
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+Calc_ScVbaWorksheet_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& args)
 {
-namespace sdecl = comphelper::service_decl;
-sdecl::vba_service_class_<ScVbaWorksheet, sdecl::with_args<true> > const serviceImpl;
-sdecl::ServiceDecl const serviceDecl(
-    serviceImpl,
-    "ScVbaWorksheet",
-    "ooo.vba.excel.Worksheet" );
+    return cppu::acquire(new ScVbaWorksheet(args, context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/util/vbaobj.component b/sc/util/vbaobj.component
index 4e250aafe41f..5ce466babe0c 100644
--- a/sc/util/vbaobj.component
+++ b/sc/util/vbaobj.component
@@ -18,8 +18,8 @@
  -->
 
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
-    prefix="vbaobj" xmlns="http://openoffice.org/2010/uno-components">
-  <implementation name="ScVbaApplication">
+    xmlns="http://openoffice.org/2010/uno-components">
+  <implementation name="ScVbaApplication" constructor="Calc_ScVbaApplication_get_implementation">
     <service name="ooo.vba.excel.Application"/>
   </implementation>
   <implementation name="ScVbaEventsHelper"
@@ -30,23 +30,23 @@
       constructor="ScVbaGlobals_get_implementation">
     <service name="ooo.vba.excel.Globals"/>
   </implementation>
-  <implementation name="ScVbaHyperlink">
+  <implementation name="ScVbaHyperlink" constructor="Calc_ScVbaHyperlink_get_implementation">
     <service name="ooo.vba.excel.Hyperlink"/>
   </implementation>
   <implementation name="ScVbaTextFrame"
       constructor="ScVbaTextFrame_get_implementation">
     <service name="ooo.vba.excel.TextFrame"/>
   </implementation>
-  <implementation name="ScVbaWindow">
+  <implementation name="ScVbaWindow" constructor="Calc_ScVbaWindow_get_implementation">
     <service name="ooo.vba.excel.Window"/>
   </implementation>
-  <implementation name="ScVbaWorkbook">
+  <implementation name="ScVbaWorkbook" constructor="Calc_ScVbaWorkbook_get_implementation">
     <service name="ooo.vba.excel.Workbook"/>
   </implementation>
-  <implementation name="ScVbaWorksheet">
+  <implementation name="ScVbaWorksheet" constructor="Calc_ScVbaWorksheet_get_implementation">
     <service name="ooo.vba.excel.Worksheet"/>
   </implementation>
-  <implementation name="SvVbaRange">
+  <implementation name="SvVbaRange" constructor="Calc_ScVbaRange_get_implementation">
     <service name="ooo.vba.excel.Range"/>
   </implementation>
 </component>


More information about the Libreoffice-commits mailing list