diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-09-14 20:11:04 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-09-15 06:27:30 +0200 |
commit | 1091e04fbd04b18a9fff3e0ead004fa4c843caf5 (patch) | |
tree | 2c93044ab6bbd2abe77b10516a56dda506d8eca5 /include | |
parent | e6be4ec010bd5e9fc15a423ad3c5ec39b07f305e (diff) |
Simplify use of connectivity::OConnectionWrapper
Make it use cppu::WeakComponentImplHelper, because all its derived
classes used that template. In the derived classes, switch to use
of cppu::ImplInheritanceHelper. That simplifies the hierarchy, and
doesn't require to re-implement many basic methods.
Change-Id: I40ec05a471af4437098586d20540f9a815677952
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173370
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'include')
-rw-r--r-- | include/connectivity/ConnectionWrapper.hxx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/include/connectivity/ConnectionWrapper.hxx b/include/connectivity/ConnectionWrapper.hxx index 8eac6a7b96a2..7e6ab35163f9 100644 --- a/include/connectivity/ConnectionWrapper.hxx +++ b/include/connectivity/ConnectionWrapper.hxx @@ -20,7 +20,10 @@ #ifndef INCLUDED_CONNECTIVITY_CONNECTIONWRAPPER_HXX #define INCLUDED_CONNECTIVITY_CONNECTIONWRAPPER_HXX -#include <cppuhelper/implbase2.hxx> +#include <sal/config.h> + +#include <cppuhelper/basemutex.hxx> +#include <cppuhelper/compbase.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> #include <connectivity/CommonTools.hxx> @@ -37,11 +40,12 @@ namespace connectivity //= OConnectionWrapper - wraps all methods to the real connection from the driver //= but when disposed it doesn't dispose the real connection - typedef ::cppu::ImplHelper2< css::lang::XServiceInfo, + typedef cppu::WeakComponentImplHelper<css::lang::XServiceInfo, css::lang::XUnoTunnel > OConnection_BASE; - class OOO_DLLPUBLIC_DBTOOLS OConnectionWrapper : public OConnection_BASE + class OOO_DLLPUBLIC_DBTOOLS OConnectionWrapper : public cppu::BaseMutex, + public OConnection_BASE { protected: css::uno::Reference< css::uno::XAggregation > m_xProxyConnection; @@ -51,12 +55,10 @@ namespace connectivity css::uno::Reference< css::lang::XServiceInfo > m_xServiceInfo; virtual ~OConnectionWrapper(); - void setDelegation(css::uno::Reference< css::uno::XAggregation >& _rxProxyConnection,oslInterlockedCount& _rRefCount); + void setDelegation(css::uno::Reference< css::uno::XAggregation >& _rxProxyConnection); void setDelegation(const css::uno::Reference< css::sdbc::XConnection >& _xConnection - ,const css::uno::Reference< css::uno::XComponentContext>& _rxContext - ,oslInterlockedCount& _rRefCount); - // must be called from derived classes - void disposing(); + ,const css::uno::Reference< css::uno::XComponentContext>& _rxContext); + virtual void SAL_CALL disposing() override; public: OConnectionWrapper( ); |