From 0e2d60f8565c2619807900244b3238ea23c4d962 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 3 May 2018 14:01:03 +0200 Subject: loplugin:useuniqueptr in OResultSet Change-Id: I8fb228a34710b73ed387458dab882e085125925b Reviewed-on: https://gerrit.libreoffice.org/53867 Tested-by: Jenkins Reviewed-by: Noel Grandin --- connectivity/source/drivers/file/FResultSet.cxx | 6 +++--- connectivity/source/inc/file/FResultSet.hxx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'connectivity') diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx index f2610657bf07..5d5abc50afb1 100644 --- a/connectivity/source/drivers/file/FResultSet.cxx +++ b/connectivity/source/drivers/file/FResultSet.cxx @@ -149,7 +149,7 @@ void OResultSet::disposing() m_pTable.clear(); m_pFileSet = nullptr; - DELETEZ(m_pSortIndex); + m_pSortIndex.reset(); if(m_aInsertRow.is()) m_aInsertRow->get().clear(); @@ -1147,7 +1147,7 @@ void OResultSet::sortRows() ++i; } - m_pSortIndex = new OSortIndex(eKeyType,m_aOrderbyAscending); + m_pSortIndex.reset(new OSortIndex(eKeyType,m_aOrderbyAscending)); while ( ExecuteRow( IResultSetHelper::NEXT, 1, false ) ) { @@ -1161,7 +1161,7 @@ void OResultSet::sortRows() // create sorted Keyset m_pFileSet = nullptr; m_pFileSet = m_pSortIndex->CreateKeySet(); - DELETEZ(m_pSortIndex); + m_pSortIndex.reset(); // now access to a sorted set is possible via Index } diff --git a/connectivity/source/inc/file/FResultSet.hxx b/connectivity/source/inc/file/FResultSet.hxx index fae15e2c3bf2..d223c0909d4e 100644 --- a/connectivity/source/inc/file/FResultSet.hxx +++ b/connectivity/source/inc/file/FResultSet.hxx @@ -86,7 +86,7 @@ namespace connectivity OKeySet::Vector::iterator m_aFileSetIter; - OSortIndex* m_pSortIndex; + std::unique_ptr m_pSortIndex; ::rtl::Reference m_xColumns; // this are the select columns ::rtl::Reference m_xParamColumns; rtl::Reference m_pTable; -- cgit