connectivity/source/drivers/ado/ADriver.cxx | 5 ++--- connectivity/source/drivers/macab/MacabConnection.hxx | 2 -- connectivity/source/inc/ado/ADriver.hxx | 6 +++++- 3 files changed, 7 insertions(+), 6 deletions(-)
New commits: commit 67df353008c0f240fa14d1e941cc7a1062335ec2 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Wed Mar 5 12:55:07 2025 +0200 Commit: Noel Grandin <noelgran...@gmail.com> CommitDate: Wed Mar 5 14:47:08 2025 +0100 improve type-safety in ado::ODriver Change-Id: Ic93722a2e4b8348011316c2ee1ecd3addf6fdd2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182534 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins diff --git a/connectivity/source/drivers/ado/ADriver.cxx b/connectivity/source/drivers/ado/ADriver.cxx index 69b4aa79d1e3..a998664fdd86 100644 --- a/connectivity/source/drivers/ado/ADriver.cxx +++ b/connectivity/source/drivers/ado/ADriver.cxx @@ -63,7 +63,7 @@ void ODriver::disposing() for (auto& rxConnection : m_xConnections) { - Reference< XComponent > xComp(rxConnection.get(), UNO_QUERY); + rtl::Reference< OConnection > xComp(rxConnection.get()); if (xComp.is()) xComp->dispose(); } @@ -96,8 +96,7 @@ Reference< XConnection > SAL_CALL ODriver::connect( const OUString& url, const S // we need to wrap the connection as the construct call might throw rtl::Reference<OConnection> pCon(new OConnection(this)); pCon->construct(url,info); - OConnection* pPtr = pCon.get(); - m_xConnections.push_back(WeakReferenceHelper(*pPtr)); + m_xConnections.push_back(pCon); return pCon; } diff --git a/connectivity/source/inc/ado/ADriver.hxx b/connectivity/source/inc/ado/ADriver.hxx index 8542e03f6d60..1e13b97e2647 100644 --- a/connectivity/source/inc/ado/ADriver.hxx +++ b/connectivity/source/inc/ado/ADriver.hxx @@ -23,12 +23,15 @@ #include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <cppuhelper/compbase.hxx> +#include <unotools/weakref.hxx> #include <connectivity/CommonTools.hxx> namespace com::sun::star::uno { class XComponentContext; } namespace connectivity::ado { + class OConnection; + typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver, css::sdbcx::XDataDefinitionSupplier, css::lang::XServiceInfo @@ -37,7 +40,8 @@ namespace connectivity::ado { ::osl::Mutex m_aMutex; - connectivity::OWeakRefArray m_xConnections; // vector containing a list + std::vector<unotools::WeakReference<OConnection>> + m_xConnections; // vector containing a list // of all the Connection objects // for this Driver css::uno::Reference< css::uno::XComponentContext > m_xContext; commit df7b3a53bd266d1c47da8490299f57a403b83860 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Mar 5 12:52:59 2025 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Mar 5 14:46:57 2025 +0100 remove unused typedef Change-Id: I6954a70e9ca3498ef38164a7415e19ac3ade524a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182533 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/connectivity/source/drivers/macab/MacabConnection.hxx b/connectivity/source/drivers/macab/MacabConnection.hxx index dc2bfa34f5fd..4e750f09d7db 100644 --- a/connectivity/source/drivers/macab/MacabConnection.hxx +++ b/connectivity/source/drivers/macab/MacabConnection.hxx @@ -38,8 +38,6 @@ namespace connectivity::macab class MacabDriver; class MacabAddressBook; - typedef std::vector< css::uno::WeakReferenceHelper > OWeakRefArray; - typedef connectivity::OMetaConnection MacabConnection_BASE; class MacabConnection : public MacabConnection_BASE