[Libreoffice-commits] core.git: connectivity/Library_mork.mk connectivity/source

David Ostrovsky david at ostrovsky.org
Fri Feb 5 07:57:50 UTC 2016


 connectivity/Library_mork.mk                                 |    1 
 connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx |    1 
 connectivity/source/drivers/mork/MDriver.cxx                 |   30 +-------
 connectivity/source/drivers/mork/MDriver.hxx                 |    3 
 connectivity/source/drivers/mork/MServices.cxx               |   37 -----------
 connectivity/source/drivers/mork/mork.component              |    5 -
 6 files changed, 9 insertions(+), 68 deletions(-)

New commits:
commit 3466423b8670a1de589126d2a9a55c1f95367a24
Author: David Ostrovsky <david at ostrovsky.org>
Date:   Thu Feb 4 17:10:42 2016 +0100

    tdf#74608: Ctor function for mork component implementation
    
    Change-Id: I706e65777c3f7ec1af255d93ffa31925e75fb2b7
    Reviewed-on: https://gerrit.libreoffice.org/22123
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/connectivity/Library_mork.mk b/connectivity/Library_mork.mk
index dd655ca..44f5ad7 100644
--- a/connectivity/Library_mork.mk
+++ b/connectivity/Library_mork.mk
@@ -55,7 +55,6 @@ $(eval $(call gb_Library_add_exception_objects,mork, \
     connectivity/source/drivers/mork/MResultSetMetaData \
     connectivity/source/drivers/mork/MPreparedStatement \
     connectivity/source/drivers/mork/MQueryHelper \
-    connectivity/source/drivers/mork/MServices \
     connectivity/source/drivers/mork/MTable \
     connectivity/source/drivers/mork/MTables \
 ))
diff --git a/connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx b/connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx
index 6c6efb5..51f01c3 100644
--- a/connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx
+++ b/connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx
@@ -29,7 +29,6 @@ static ::osl::Mutex m_aMetaMutex;
 #include <com/sun/star/beans/XPropertySetInfo.hpp>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <com/sun/star/sdb/ErrorCondition.hpp>
-#include <comphelper/processfactory.hxx>
 
 #include "MorkParser.hxx"
 
diff --git a/connectivity/source/drivers/mork/MDriver.cxx b/connectivity/source/drivers/mork/MDriver.cxx
index 58da828..dec0d42 100644
--- a/connectivity/source/drivers/mork/MDriver.cxx
+++ b/connectivity/source/drivers/mork/MDriver.cxx
@@ -19,15 +19,11 @@
 
 using namespace connectivity::mork;
 
-namespace connectivity
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_sdbc_MorkDriver_get_implementation(
+    css::uno::XComponentContext* context,
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    namespace mork
-    {
-        css::uno::Reference< css::uno::XInterface > create(css::uno::Reference< css::uno::XComponentContext > const & context)
-        {
-            return static_cast< cppu::OWeakObject * >(new MorkDriver(context));
-        }
-    }
+    return cppu::acquire(new MorkDriver(context));
 }
 
 MorkDriver::MorkDriver(css::uno::Reference< css::uno::XComponentContext > const context):
@@ -37,24 +33,10 @@ MorkDriver::MorkDriver(css::uno::Reference< css::uno::XComponentContext > const
     SAL_INFO("connectivity.mork", "=> MorkDriver::MorkDriver()" );
 }
 
-// static ServiceInfo
-
-OUString MorkDriver::getImplementationName_Static(  ) throw(css::uno::RuntimeException)
-{
-    return OUString(MORK_DRIVER_IMPL_NAME);
-}
-
-
-css::uno::Sequence< OUString > MorkDriver::getSupportedServiceNames_Static(  ) throw (css::uno::RuntimeException)
-{
-    css::uno::Sequence< OUString > aSNS { "com.sun.star.sdbc.Driver" };
-    return aSNS;
-}
-
 OUString SAL_CALL MorkDriver::getImplementationName()
     throw (css::uno::RuntimeException, std::exception)
 {
-    return getImplementationName_Static();
+    return OUString(MORK_DRIVER_IMPL_NAME);
 }
 
 sal_Bool SAL_CALL MorkDriver::supportsService(const OUString& serviceName)
@@ -66,7 +48,7 @@ sal_Bool SAL_CALL MorkDriver::supportsService(const OUString& serviceName)
 css::uno::Sequence< OUString > MorkDriver::getSupportedServiceNames()
     throw (css::uno::RuntimeException, std::exception)
 {
-    return getSupportedServiceNames_Static();
+    return { "com.sun.star.sdbc.Driver" };
 }
 
 css::uno::Reference< css::sdbc::XConnection > MorkDriver::connect(
diff --git a/connectivity/source/drivers/mork/MDriver.hxx b/connectivity/source/drivers/mork/MDriver.hxx
index 5346d0d..b631c44 100644
--- a/connectivity/source/drivers/mork/MDriver.hxx
+++ b/connectivity/source/drivers/mork/MDriver.hxx
@@ -42,9 +42,6 @@ namespace com { namespace sun { namespace star {
 namespace connectivity { namespace mork {
 class ProfileAccess;
 
-css::uno::Reference< css::uno::XInterface > SAL_CALL
-create(css::uno::Reference< css::uno::XComponentContext > const &);
-
 class MorkDriver:
     public cppu::WeakImplHelper< css::lang::XServiceInfo, css::sdbc::XDriver >
 {
diff --git a/connectivity/source/drivers/mork/MServices.cxx b/connectivity/source/drivers/mork/MServices.cxx
deleted file mode 100644
index 63e80a1..0000000
--- a/connectivity/source/drivers/mork/MServices.cxx
+++ /dev/null
@@ -1,37 +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/.
- */
-
-#include <sal/config.h>
-
-#include <cppuhelper/factory.hxx>
-#include <cppuhelper/implementationentry.hxx>
-#include <sal/types.h>
-
-#include "MDriver.hxx"
-
-namespace {
-
-static cppu::ImplementationEntry const services[] = {
-    { &connectivity::mork::create,
-      &connectivity::mork::MorkDriver::getImplementationName_Static,
-      &connectivity::mork::MorkDriver::getSupportedServiceNames_Static,
-      &cppu::createSingleComponentFactory, nullptr, 0 },
-    { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
-};
-
-}
-
-extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL mork_component_getFactory(
-    char const * pImplName, void * pServiceManager, void * pRegistryKey)
-{
-    return cppu::component_getFactoryHelper(
-        pImplName, pServiceManager, pRegistryKey, services);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mork/mork.component b/connectivity/source/drivers/mork/mork.component
index e6cc963..1eeb6af 100644
--- a/connectivity/source/drivers/mork/mork.component
+++ b/connectivity/source/drivers/mork/mork.component
@@ -9,8 +9,9 @@
 -->
 
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
-    prefix="mork" xmlns="http://openoffice.org/2010/uno-components">
-  <implementation name="com.sun.star.comp.sdbc.MorkDriver">
+    xmlns="http://openoffice.org/2010/uno-components">
+  <implementation name="com.sun.star.comp.sdbc.MorkDriver"
+      constructor="com_sun_star_comp_sdbc_MorkDriver_get_implementation">
     <service name="com.sun.star.sdbc.Driver"/>
   </implementation>
 </component>


More information about the Libreoffice-commits mailing list