diff options
author | David Ostrovsky <david@ostrovsky.org> | 2016-02-04 17:10:42 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-02-05 07:57:30 +0000 |
commit | 3466423b8670a1de589126d2a9a55c1f95367a24 (patch) | |
tree | bfc73102d2bda2fb3f9ffb24a12528496ae9c49a /connectivity | |
parent | Avoid ambiguities among operator[] overloads (diff) | |
download | core-3466423b8670a1de589126d2a9a55c1f95367a24.tar.gz core-3466423b8670a1de589126d2a9a55c1f95367a24.zip |
tdf#74608: Ctor function for mork component implementation
Change-Id: I706e65777c3f7ec1af255d93ffa31925e75fb2b7
Reviewed-on: https://gerrit.libreoffice.org/22123
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/Library_mork.mk | 1 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx | 1 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MDriver.cxx | 30 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MDriver.hxx | 3 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MServices.cxx | 37 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/mork.component | 5 |
6 files changed, 9 insertions, 68 deletions
diff --git a/connectivity/Library_mork.mk b/connectivity/Library_mork.mk index dd655ca751cc..44f5ad794130 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 6c6efb57a7c7..51f01c32f41a 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 58da828842b6..dec0d42fe8a5 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 5346d0d7b3c0..b631c4412d47 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 63e80a153e2c..000000000000 --- 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 e6cc96391fc6..1eeb6affb894 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> |