connectivity/source/drivers/mysqlc/mysqlc_driver.cxx | 4 ++-- connectivity/source/drivers/mysqlc/mysqlc_driver.hxx | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-)
New commits: commit d4a878c726b2e4a92cc6946e9b9d474505e2f9f2 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Mar 4 13:32:15 2025 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Mar 4 20:30:09 2025 +0100 improve type safety in mysqlc::MysqlCDriver Change-Id: I3050e0e3b649a0e093750d9e51019d5e0b2cc730 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182476 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins diff --git a/connectivity/source/drivers/mysqlc/mysqlc_driver.cxx b/connectivity/source/drivers/mysqlc/mysqlc_driver.cxx index 54240b360c08..e8b1d5c0cf70 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_driver.cxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_driver.cxx @@ -41,7 +41,7 @@ void MysqlCDriver::disposing() // when driver will be destroyed so all our connections have to be destroyed as well for (auto const& connection : m_xConnections) { - Reference<XComponent> xComp(connection.get(), UNO_QUERY); + rtl::Reference<OConnection> xComp(connection); if (xComp.is()) { xComp->dispose(); @@ -89,7 +89,7 @@ Reference<XConnection> SAL_CALL MysqlCDriver::connect(const OUString& url, rtl::Reference<OConnection> pCon = new OConnection(*this); pCon->construct(url, info); - m_xConnections.push_back(WeakReferenceHelper(*pCon)); + m_xConnections.push_back(pCon); return pCon; } diff --git a/connectivity/source/drivers/mysqlc/mysqlc_driver.hxx b/connectivity/source/drivers/mysqlc/mysqlc_driver.hxx index 0ed02d0b18e5..5479132a4cf6 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_driver.hxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_driver.hxx @@ -30,8 +30,6 @@ namespace connectivity::mysqlc using css::uno::Reference; using css::uno::Sequence; -typedef std::vector<css::uno::WeakReferenceHelper> OWeakRefArray; - Reference<css::uno::XInterface> MysqlCDriver_CreateInstance(const Reference<css::lang::XMultiServiceFactory>& _rxFactory); @@ -46,7 +44,7 @@ class MysqlCDriver : public ODriver_BASE protected: Reference<css::lang::XMultiServiceFactory> m_xFactory; ::osl::Mutex m_aMutex; // mutex is need to control member access - 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 public: