diff options
author | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2022-06-15 13:11:58 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2022-06-15 14:50:50 +0200 |
commit | f37c5f629ede0bcb706dba3dad3af3a528db4b74 (patch) | |
tree | 37790cb284fa09101d507316ed467d0c0a6376a5 /binaryurp | |
parent | 4a3510781f8355eb49d3fdbc44d0d4e27da1bb8e (diff) |
Revert "binaryurp: create instances with uno constructors"
This reverts commit 65fc5bd895948d73f3d1eec14a669ada3e3465f0.
Diffstat (limited to 'binaryurp')
-rw-r--r-- | binaryurp/source/binaryurp.component | 5 | ||||
-rw-r--r-- | binaryurp/source/bridgefactory.cxx | 39 | ||||
-rw-r--r-- | binaryurp/source/bridgefactory.hxx | 12 |
3 files changed, 46 insertions, 10 deletions
diff --git a/binaryurp/source/binaryurp.component b/binaryurp/source/binaryurp.component index e2581c76411e..1eff0c2c18d6 100644 --- a/binaryurp/source/binaryurp.component +++ b/binaryurp/source/binaryurp.component @@ -18,9 +18,8 @@ --> <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" - xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="com.sun.star.comp.bridge.BridgeFactory" - constructor="com_sun_star_comp_bridge_BridgeFactory_get_implementation"> + prefix="binaryurp" xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.bridge.BridgeFactory"> <service name="com.sun.star.bridge.BridgeFactory"/> </implementation> </component> diff --git a/binaryurp/source/bridgefactory.cxx b/binaryurp/source/bridgefactory.cxx index f653d40cc68c..6563b101f1df 100644 --- a/binaryurp/source/bridgefactory.cxx +++ b/binaryurp/source/bridgefactory.cxx @@ -43,6 +43,21 @@ 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<OUString>{ "com.sun.star.bridge.BridgeFactory" }; +} + void BridgeFactory::removeBridge( css::uno::Reference< css::bridge::XBridge > const & bridge) { @@ -70,7 +85,7 @@ BridgeFactory::~BridgeFactory() {} OUString BridgeFactory::getImplementationName() { - return "com.sun.star.comp.bridge.BridgeFactory"; + return static_getImplementationName(); } sal_Bool BridgeFactory::supportsService(OUString const & ServiceName) @@ -80,7 +95,7 @@ sal_Bool BridgeFactory::supportsService(OUString const & ServiceName) css::uno::Sequence< OUString > BridgeFactory::getSupportedServiceNames() { - return { "com.sun.star.bridge.BridgeFactory" }; + return static_getSupportedServiceNames(); } css::uno::Reference< css::bridge::XBridge > BridgeFactory::createBridge( @@ -183,11 +198,23 @@ void BridgeFactory::disposing() { } -extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* -com_sun_star_comp_bridge_BridgeFactory_get_implementation( - css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&) +namespace { + +static 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) { - return cppu::acquire(static_cast< cppu::OWeakObject * >(new binaryurp::BridgeFactory)); + return cppu::component_getFactoryHelper( + pImplName, pServiceManager, pRegistryKey, services); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binaryurp/source/bridgefactory.hxx b/binaryurp/source/bridgefactory.hxx index bbe2e39fd46a..1a83962ee6b7 100644 --- a/binaryurp/source/bridgefactory.hxx +++ b/binaryurp/source/bridgefactory.hxx @@ -57,6 +57,16 @@ 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); @@ -64,6 +74,7 @@ public: using BridgeFactoryBase::acquire; using BridgeFactoryBase::release; +private: BridgeFactory(const BridgeFactory&) = delete; BridgeFactory& operator=(const BridgeFactory&) = delete; @@ -71,7 +82,6 @@ public: virtual ~BridgeFactory() override; -private: virtual OUString SAL_CALL getImplementationName() override; virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override; |