summaryrefslogtreecommitdiffstats
path: root/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-16 15:23:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-17 08:25:47 +0200
commitccb2a1f650bc505f8a4f1abebf8ce4f9396562a8 (patch)
tree2ee2fd4f300ae95cf23bade1f242e02f9b276c07 /connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx
parentloplugin:staticvar in avmedia..connectivity (diff)
downloadcore-ccb2a1f650bc505f8a4f1abebf8ce4f9396562a8.tar.gz
core-ccb2a1f650bc505f8a4f1abebf8ce4f9396562a8.zip
clang-tidy readability-redundant-smartptr-get
redundant get() call on smart pointer Change-Id: Icb5a03bbc15e79a30d3d135a507d22914d15c2bd Reviewed-on: https://gerrit.libreoffice.org/61837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx')
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx34
1 files changed, 14 insertions, 20 deletions
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx
index b4a2844ce6f4..05204fe652a0 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx
@@ -108,7 +108,7 @@ Reference<XResultSetMetaData> SAL_CALL OPreparedStatement::getMetaData()
{
MYSQL_RES* pRes = mysql_stmt_result_metadata(m_pStmt);
// TODO warning or error if no meta data.
- m_xMetaData = new OResultSetMetaData(*m_xConnection.get(), pRes);
+ m_xMetaData = new OResultSetMetaData(*m_xConnection, pRes);
}
return m_xMetaData;
}
@@ -135,19 +135,17 @@ sal_Bool SAL_CALL OPreparedStatement::execute()
if (!m_binds.empty() && mysql_stmt_bind_param(m_pStmt, m_binds.data()))
{
- MYSQL* pMysql = m_xConnection.get()->getMysqlConnection();
+ MYSQL* pMysql = m_xConnection->getMysqlConnection();
mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_stmt_error(m_pStmt), mysql_errno(pMysql),
- *this,
- m_xConnection.get()->getConnectionEncoding());
+ *this, m_xConnection->getConnectionEncoding());
}
int nFail = mysql_stmt_execute(m_pStmt);
if (nFail != 0)
{
- MYSQL* pMysql = m_xConnection.get()->getMysqlConnection();
+ MYSQL* pMysql = m_xConnection->getMysqlConnection();
mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_stmt_error(m_pStmt), mysql_errno(pMysql),
- *this,
- m_xConnection.get()->getConnectionEncoding());
+ *this, m_xConnection->getConnectionEncoding());
}
return !nFail;
@@ -160,20 +158,18 @@ sal_Int32 SAL_CALL OPreparedStatement::executeUpdate()
if (!m_binds.empty() && mysql_stmt_bind_param(m_pStmt, m_binds.data()))
{
- MYSQL* pMysql = m_xConnection.get()->getMysqlConnection();
+ MYSQL* pMysql = m_xConnection->getMysqlConnection();
mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_stmt_error(m_pStmt), mysql_errno(pMysql),
- *this,
- m_xConnection.get()->getConnectionEncoding());
+ *this, m_xConnection->getConnectionEncoding());
}
int nFail = mysql_stmt_execute(m_pStmt);
if (nFail != 0)
{
- MYSQL* pMysql = m_xConnection.get()->getMysqlConnection();
+ MYSQL* pMysql = m_xConnection->getMysqlConnection();
mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_stmt_error(m_pStmt), mysql_errno(pMysql),
- *this,
- m_xConnection.get()->getConnectionEncoding());
+ *this, m_xConnection->getConnectionEncoding());
}
sal_Int32 affectedRows = mysql_stmt_affected_rows(m_pStmt);
@@ -210,24 +206,22 @@ Reference<XResultSet> SAL_CALL OPreparedStatement::executeQuery()
if (!m_binds.empty() && mysql_stmt_bind_param(m_pStmt, m_binds.data()))
{
- MYSQL* pMysql = m_xConnection.get()->getMysqlConnection();
+ MYSQL* pMysql = m_xConnection->getMysqlConnection();
mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_stmt_error(m_pStmt), mysql_errno(pMysql),
- *this,
- m_xConnection.get()->getConnectionEncoding());
+ *this, m_xConnection->getConnectionEncoding());
}
int nFail = mysql_stmt_execute(m_pStmt);
if (nFail != 0)
{
- MYSQL* pMysql = m_xConnection.get()->getMysqlConnection();
+ MYSQL* pMysql = m_xConnection->getMysqlConnection();
mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_stmt_error(m_pStmt), mysql_errno(pMysql),
- *this,
- m_xConnection.get()->getConnectionEncoding());
+ *this, m_xConnection->getConnectionEncoding());
}
Reference<XResultSet> xResultSet;
- xResultSet = new OPreparedResultSet(*m_xConnection.get(), this, m_pStmt);
+ xResultSet = new OPreparedResultSet(*m_xConnection, this, m_pStmt);
return xResultSet;
}