Kaydet (Commit) 3466423b authored tarafından David Ostrovsky's avatar David Ostrovsky Kaydeden (comit) Stephan Bergmann

tdf#74608: Ctor function for mork component implementation

Change-Id: I706e65777c3f7ec1af255d93ffa31925e75fb2b7
Reviewed-on: https://gerrit.libreoffice.org/22123Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst a8f3ad1a
......@@ -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 \
))
......
......@@ -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"
......
......@@ -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(
......
......@@ -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 >
{
......
/* -*- 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: */
......@@ -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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment