From 9be078ae0d4cc4e4c01952bb42c9bb5943bbde86 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 4 Jul 2020 09:12:35 +0200 Subject: binaryurp: create instances with uno constructors See tdf#74608 for motivation Change-Id: Ide39715f83b0183f560e16fa69fcb3112496936d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97933 Tested-by: Jenkins Reviewed-by: Noel Grandin --- binaryurp/source/binaryurp.component | 5 +++-- binaryurp/source/bridgefactory.cxx | 39 ++++++------------------------------ binaryurp/source/bridgefactory.hxx | 12 +---------- 3 files changed, 10 insertions(+), 46 deletions(-) (limited to 'binaryurp') diff --git a/binaryurp/source/binaryurp.component b/binaryurp/source/binaryurp.component index 1eff0c2c18d6..e2581c76411e 100644 --- a/binaryurp/source/binaryurp.component +++ b/binaryurp/source/binaryurp.component @@ -18,8 +18,9 @@ --> - + xmlns="http://openoffice.org/2010/uno-components"> + diff --git a/binaryurp/source/bridgefactory.cxx b/binaryurp/source/bridgefactory.cxx index ff8eff8b6927..fc1f8b071362 100644 --- a/binaryurp/source/bridgefactory.cxx +++ b/binaryurp/source/bridgefactory.cxx @@ -43,21 +43,6 @@ namespace binaryurp { -css::uno::Reference< css::uno::XInterface > BridgeFactory::static_create( - css::uno::Reference< css::uno::XComponentContext > const & /*xContext*/) -{ - return static_cast< cppu::OWeakObject * >(new BridgeFactory); -} - -OUString BridgeFactory::static_getImplementationName() { - return "com.sun.star.comp.bridge.BridgeFactory"; -} - -css::uno::Sequence< OUString > -BridgeFactory::static_getSupportedServiceNames() { - return css::uno::Sequence{ "com.sun.star.bridge.BridgeFactory" }; -} - void BridgeFactory::removeBridge( css::uno::Reference< css::bridge::XBridge > const & bridge) { @@ -85,7 +70,7 @@ BridgeFactory::~BridgeFactory() {} OUString BridgeFactory::getImplementationName() { - return static_getImplementationName(); + return "com.sun.star.comp.bridge.BridgeFactory"; } sal_Bool BridgeFactory::supportsService(OUString const & ServiceName) @@ -95,7 +80,7 @@ sal_Bool BridgeFactory::supportsService(OUString const & ServiceName) css::uno::Sequence< OUString > BridgeFactory::getSupportedServiceNames() { - return static_getSupportedServiceNames(); + return { "com.sun.star.bridge.BridgeFactory" }; } css::uno::Reference< css::bridge::XBridge > BridgeFactory::createBridge( @@ -198,23 +183,11 @@ void BridgeFactory::disposing() { } -namespace { - -cppu::ImplementationEntry const services[] = { - { &binaryurp::BridgeFactory::static_create, - &binaryurp::BridgeFactory::static_getImplementationName, - &binaryurp::BridgeFactory::static_getSupportedServiceNames, - &cppu::createOneInstanceComponentFactory, nullptr, 0 }, - { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } -}; - -} - -extern "C" SAL_DLLPUBLIC_EXPORT void * binaryurp_component_getFactory( - char const * pImplName, void * pServiceManager, void * pRegistryKey) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +com_sun_star_comp_bridge_BridgeFactory_get_implementation( + css::uno::XComponentContext* , css::uno::Sequence const&) { - return cppu::component_getFactoryHelper( - pImplName, pServiceManager, pRegistryKey, services); + return cppu::acquire(static_cast< cppu::OWeakObject * >(new binaryurp::BridgeFactory)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binaryurp/source/bridgefactory.hxx b/binaryurp/source/bridgefactory.hxx index 5e49610eeb42..1470dc2c28bd 100644 --- a/binaryurp/source/bridgefactory.hxx +++ b/binaryurp/source/bridgefactory.hxx @@ -54,16 +54,6 @@ typedef class BridgeFactory : private cppu::BaseMutex, public BridgeFactoryBase { public: - static com::sun::star::uno::Reference< com::sun::star::uno::XInterface > - SAL_CALL static_create( - com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > - const & xContext); - - static OUString SAL_CALL static_getImplementationName(); - - static com::sun::star::uno::Sequence< OUString > SAL_CALL - static_getSupportedServiceNames(); - void removeBridge( com::sun::star::uno::Reference< com::sun::star::bridge::XBridge > const & bridge); @@ -71,7 +61,6 @@ public: using BridgeFactoryBase::acquire; using BridgeFactoryBase::release; -private: BridgeFactory(const BridgeFactory&) = delete; BridgeFactory& operator=(const BridgeFactory&) = delete; @@ -79,6 +68,7 @@ private: virtual ~BridgeFactory() override; +private: virtual OUString SAL_CALL getImplementationName() override; virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override; -- cgit