summaryrefslogtreecommitdiff
path: root/connectivity/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2025-03-04 12:04:39 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2025-03-04 19:35:08 +0100
commit99f20f69dd9a5cdcee460135a3c8a2e0b5ba0d14 (patch)
tree20c92347d737f191c5e11c11d4716a455b57f2ef /connectivity/source
parent90351ca6b1d6483590878bdc55be2b446019ee7c (diff)
improve type safety in mysqlc::OResultSet
Change-Id: I44e7aafd7b9e7d426d511aab72ccd5f818305133 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182466 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source')
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx4
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx3
2 files changed, 4 insertions, 3 deletions
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx b/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
index 3197a8f81845..ac07b862dc9f 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
@@ -108,7 +108,7 @@ OResultSet::OResultSet(OConnection& rConn, OCommonStatement* pStmt, MYSQL_RES* p
: OResultSet_BASE(m_aMutex)
, OPropertySetHelper(OResultSet_BASE::rBHelper)
, m_pMysql(rConn.getMysqlConnection())
- , m_aStatement(css::uno::Reference(cppu::getXWeak(pStmt)))
+ , m_aStatement(pStmt)
, m_pResult(pResult)
, m_encoding(_encoding)
{
@@ -672,7 +672,7 @@ uno::Reference<uno::XInterface> SAL_CALL OResultSet::getStatement()
MutexGuard aGuard(m_aMutex);
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- return m_aStatement.get();
+ return cppu::getXWeak(m_aStatement.get().get());
}
sal_Bool SAL_CALL OResultSet::rowDeleted()
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx b/connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx
index bb2dc18fc9e2..baa65be07cc0 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx
@@ -37,6 +37,7 @@
#include <com/sun/star/util/XCancellable.hpp>
#include <cppuhelper/compbase12.hxx>
+#include <unotools/weakref.hxx>
namespace connectivity::mysqlc
{
@@ -62,7 +63,7 @@ class OResultSet final : public cppu::BaseMutex,
std::vector<DataFields> m_aRows;
std::vector<OUString> m_aFields;
MYSQL* m_pMysql = nullptr;
- css::uno::WeakReferenceHelper m_aStatement;
+ unotools::WeakReference<OCommonStatement> m_aStatement;
rtl::Reference<OResultSetMetaData> m_xMetaData;
MYSQL_RES* m_pResult;
rtl_TextEncoding m_encoding;