summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/odbc/OResultSet.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-05 08:57:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-05 11:30:12 +0200
commitb0e05f9ade9e93c569c6a62c59ac1819e615f27b (patch)
tree61cbf40294b73e5dbc92213c23f1d89dd8998092 /connectivity/source/drivers/odbc/OResultSet.cxx
parent1a637473b5aa6a43acb4d1f820044fba962cc6a4 (diff)
loplugin:useuniqueptr in basic..cppcanvas
Change-Id: Ib40241eb794607154ae52f8aa68fbf5ea5e944af Reviewed-on: https://gerrit.libreoffice.org/39551 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source/drivers/odbc/OResultSet.cxx')
-rw-r--r--connectivity/source/drivers/odbc/OResultSet.cxx14
1 files changed, 5 insertions, 9 deletions
diff --git a/connectivity/source/drivers/odbc/OResultSet.cxx b/connectivity/source/drivers/odbc/OResultSet.cxx
index 475d2fe286b4..203402eb5b35 100644
--- a/connectivity/source/drivers/odbc/OResultSet.cxx
+++ b/connectivity/source/drivers/odbc/OResultSet.cxx
@@ -104,8 +104,8 @@ OResultSet::OResultSet(SQLHANDLE _pStatementHandle ,OStatement_Base* pStmt) :
osl_atomic_increment( &m_refCount );
try
{
- m_pRowStatusArray = new SQLUSMALLINT[1]; // the default value
- setStmtOption<SQLUSMALLINT*, SQL_IS_POINTER>(SQL_ATTR_ROW_STATUS_PTR, m_pRowStatusArray);
+ m_pRowStatusArray.reset( new SQLUSMALLINT[1] ); // the default value
+ setStmtOption<SQLUSMALLINT*, SQL_IS_POINTER>(SQL_ATTR_ROW_STATUS_PTR, m_pRowStatusArray.get());
}
catch(const Exception&)
{ // we don't want our result destroy here
@@ -117,7 +117,7 @@ OResultSet::OResultSet(SQLHANDLE _pStatementHandle ,OStatement_Base* pStmt) :
SQLUINTEGER nValueLen = m_pStatement->getCursorProperties(nCurType,false);
if( (nValueLen & SQL_CA2_SENSITIVITY_DELETIONS) != SQL_CA2_SENSITIVITY_DELETIONS ||
(nValueLen & SQL_CA2_CRC_EXACT) != SQL_CA2_CRC_EXACT)
- m_pSkipDeletedSet = new OSkipDeletedSet(this);
+ m_pSkipDeletedSet.reset( new OSkipDeletedSet(this) );
}
catch(const Exception&)
{ // we don't want our result destroy here
@@ -164,8 +164,6 @@ OResultSet::OResultSet(SQLHANDLE _pStatementHandle ,OStatement_Base* pStmt) :
OResultSet::~OResultSet()
{
- delete [] m_pRowStatusArray;
- delete m_pSkipDeletedSet;
}
void OResultSet::construct()
@@ -1389,10 +1387,8 @@ void OResultSet::setFetchSize(sal_Int32 _par0)
if ( _par0 > 0 )
{
setStmtOption<SQLULEN, SQL_IS_UINTEGER>(SQL_ATTR_ROW_ARRAY_SIZE, _par0);
- delete [] m_pRowStatusArray;
-
- m_pRowStatusArray = new SQLUSMALLINT[_par0];
- setStmtOption<SQLUSMALLINT*, SQL_IS_POINTER>(SQL_ATTR_ROW_STATUS_PTR, m_pRowStatusArray);
+ m_pRowStatusArray.reset( new SQLUSMALLINT[_par0] );
+ setStmtOption<SQLUSMALLINT*, SQL_IS_POINTER>(SQL_ATTR_ROW_STATUS_PTR, m_pRowStatusArray.get());
}
}