summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-02-16 08:55:13 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-02-17 11:41:55 +0100
commit6ec7f2b22bc9e31c330dcef229f7ecfe98724a5e (patch)
tree0667883f360d024208ede10e193586f332c8dcfd /connectivity/source/drivers
parentd3476d27ab77160dcd737194fc13081ee297db16 (diff)
loplugin:referencecasting in connectivity
Change-Id: I4b91c3e4a225323235ea37d77f0f96600bf412be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110969 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source/drivers')
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx4
-rw-r--r--connectivity/source/drivers/file/FPreparedStatement.cxx8
-rw-r--r--connectivity/source/drivers/file/FResultSet.cxx7
-rw-r--r--connectivity/source/drivers/file/FStatement.cxx2
-rw-r--r--connectivity/source/drivers/firebird/DatabaseMetaData.cxx2
-rw-r--r--connectivity/source/drivers/firebird/PreparedStatement.cxx2
-rw-r--r--connectivity/source/drivers/firebird/Statement.cxx2
-rw-r--r--connectivity/source/drivers/jdbc/JStatement.cxx2
-rw-r--r--connectivity/source/drivers/jdbc/PreparedStatement.cxx2
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx2
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_statement.cxx2
-rw-r--r--connectivity/source/drivers/odbc/OPreparedStatement.cxx2
-rw-r--r--connectivity/source/drivers/odbc/OStatement.cxx2
13 files changed, 19 insertions, 20 deletions
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index fece1bf7fb21..113fc5b5c41d 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -1635,7 +1635,7 @@ bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, const OValueRefRow& pOrgRo
::comphelper::UStringMixEqual aCase(isCaseSensitive());
- Reference<XIndexAccess> xColumns = m_xColumns.get();
+ Reference<XIndexAccess> xColumns = m_xColumns;
// first search a key that exist already in the table
for (sal_Int32 i = 0; i < nColumnCount; ++i)
{
@@ -2499,7 +2499,7 @@ void ODbaseTable::copyData(ODbaseTable* _pNewTable,sal_Int32 _nPos)
}
}
}
- bOk = _pNewTable->InsertRow(*aInsertRow,_pNewTable->m_xColumns.get());
+ bOk = _pNewTable->InsertRow(*aInsertRow,_pNewTable->m_xColumns);
SAL_WARN_IF(!bOk, "connectivity.drivers", "Row could not be inserted!");
}
else
diff --git a/connectivity/source/drivers/file/FPreparedStatement.cxx b/connectivity/source/drivers/file/FPreparedStatement.cxx
index fc5b81923cb4..4550f2053e80 100644
--- a/connectivity/source/drivers/file/FPreparedStatement.cxx
+++ b/connectivity/source/drivers/file/FPreparedStatement.cxx
@@ -100,7 +100,7 @@ rtl::Reference<OResultSet> OPreparedStatement::makeResultSet()
closeResultSet();
rtl::Reference<OResultSet> xResultSet(createResultSet());
- m_xResultSet = xResultSet.get();
+ m_xResultSet = xResultSet;
initializeResultSet(xResultSet.get());
initResultSet(xResultSet.get());
return xResultSet;
@@ -133,7 +133,7 @@ Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData( )
if(!m_xMetaData.is())
m_xMetaData = new OResultSetMetaData(m_aSQLIterator.getSelectColumns(),m_aSQLIterator.getTables().begin()->first,m_pTable.get());
- return m_xMetaData.get();
+ return m_xMetaData;
}
@@ -189,7 +189,7 @@ Reference< XConnection > SAL_CALL OPreparedStatement::getConnection( )
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
- return Reference< XConnection >(m_pConnection.get());
+ return m_pConnection;
}
@@ -198,7 +198,7 @@ Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery( )
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
- return makeResultSet().get();
+ return makeResultSet();
}
diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx
index 5cf5d1ae862d..48aa7da9c737 100644
--- a/connectivity/source/drivers/file/FResultSet.cxx
+++ b/connectivity/source/drivers/file/FResultSet.cxx
@@ -133,9 +133,8 @@ void OResultSet::disposing()
m_xColumns = nullptr;
m_xColsIdx.clear();
- Reference<XComponent> xComp = m_pTable.get();
- if ( xComp.is() )
- xComp->removeEventListener(this);
+ if ( m_pTable.is() )
+ m_pTable->removeEventListener(this);
m_pTable.clear();
m_pFileSet = nullptr;
@@ -1585,7 +1584,7 @@ bool OResultSet::isRowDeleted() const
void SAL_CALL OResultSet::disposing( const EventObject& Source )
{
- Reference<XPropertySet> xProp = m_pTable.get();
+ Reference<XPropertySet> xProp = m_pTable;
if(m_pTable.is() && Source.Source == xProp)
{
m_pTable.clear();
diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx
index 08c4f7fdd844..a78f7a096955 100644
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ b/connectivity/source/drivers/file/FStatement.cxx
@@ -263,7 +263,7 @@ Reference< XResultSet > SAL_CALL OStatement::executeQuery( const OUString& sql )
Reference< XConnection > SAL_CALL OStatement::getConnection( )
{
- return Reference< XConnection >(m_pConnection.get());
+ return m_pConnection;
}
sal_Int32 SAL_CALL OStatement::executeUpdate( const OUString& sql )
diff --git a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
index 15e89f86859d..1abc21d9accc 100644
--- a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
+++ b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
@@ -771,7 +771,7 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsBatchUpdates()
uno::Reference< XConnection > SAL_CALL ODatabaseMetaData::getConnection()
{
- return uno::Reference<XConnection>(m_pConnection.get());
+ return m_pConnection;
}
// here follow all methods which return a resultset
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index 3f7859d1dba7..94485f7dc3cb 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
@@ -277,7 +277,7 @@ Reference< XConnection > SAL_CALL OPreparedStatement::getConnection()
MutexGuard aGuard( m_aMutex );
checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
- return Reference<XConnection>(m_pConnection.get());
+ return m_pConnection;
}
sal_Bool SAL_CALL OPreparedStatement::execute()
diff --git a/connectivity/source/drivers/firebird/Statement.cxx b/connectivity/source/drivers/firebird/Statement.cxx
index 418c66a7d0cd..5305761cfd3a 100644
--- a/connectivity/source/drivers/firebird/Statement.cxx
+++ b/connectivity/source/drivers/firebird/Statement.cxx
@@ -148,7 +148,7 @@ uno::Reference< XConnection > SAL_CALL OStatement::getConnection()
MutexGuard aGuard(m_aMutex);
checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
- return uno::Reference<XConnection>(m_pConnection.get());
+ return m_pConnection;
}
Any SAL_CALL OStatement::queryInterface( const Type & rType )
diff --git a/connectivity/source/drivers/jdbc/JStatement.cxx b/connectivity/source/drivers/jdbc/JStatement.cxx
index 147e09c0f362..fddd02a33a1a 100644
--- a/connectivity/source/drivers/jdbc/JStatement.cxx
+++ b/connectivity/source/drivers/jdbc/JStatement.cxx
@@ -279,7 +279,7 @@ Reference< XConnection > SAL_CALL java_sql_Statement_Base::getConnection( )
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
- return Reference< XConnection >(m_pConnection.get());
+ return m_pConnection;
}
diff --git a/connectivity/source/drivers/jdbc/PreparedStatement.cxx b/connectivity/source/drivers/jdbc/PreparedStatement.cxx
index 083f1917e72a..c57dd20a983f 100644
--- a/connectivity/source/drivers/jdbc/PreparedStatement.cxx
+++ b/connectivity/source/drivers/jdbc/PreparedStatement.cxx
@@ -143,7 +143,7 @@ void SAL_CALL java_sql_PreparedStatement::setString( sal_Int32 parameterIndex, c
css::uno::Reference< css::sdbc::XConnection > SAL_CALL java_sql_PreparedStatement::getConnection( )
{
- return Reference< XConnection >(m_pConnection.get());
+ return m_pConnection;
}
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx
index 2b344843deb2..e268c2fdba78 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx
@@ -193,7 +193,7 @@ Reference<XConnection> SAL_CALL OPreparedStatement::getConnection()
MutexGuard aGuard(m_aMutex);
checkDisposed(OPreparedStatement::rBHelper.bDisposed);
- return m_xConnection.get();
+ return m_xConnection;
}
Reference<XResultSet> SAL_CALL OPreparedStatement::executeQuery()
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
index 5e07982773ce..e5428ee34f9e 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
@@ -165,7 +165,7 @@ Reference<XConnection> SAL_CALL OStatement::getConnection()
checkDisposed(rBHelper.bDisposed);
// just return our connection here
- return m_xConnection.get();
+ return m_xConnection;
}
sal_Int32 SAL_CALL OStatement::getUpdateCount() { return m_nAffectedRows; }
diff --git a/connectivity/source/drivers/odbc/OPreparedStatement.cxx b/connectivity/source/drivers/odbc/OPreparedStatement.cxx
index 65cfbf5e7b5f..724e481ddc9b 100644
--- a/connectivity/source/drivers/odbc/OPreparedStatement.cxx
+++ b/connectivity/source/drivers/odbc/OPreparedStatement.cxx
@@ -227,7 +227,7 @@ Reference< XConnection > SAL_CALL OPreparedStatement::getConnection( )
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
- return Reference< XConnection >(m_pConnection.get());
+ return m_pConnection;
}
diff --git a/connectivity/source/drivers/odbc/OStatement.cxx b/connectivity/source/drivers/odbc/OStatement.cxx
index dc693b964d56..33b4af624de9 100644
--- a/connectivity/source/drivers/odbc/OStatement.cxx
+++ b/connectivity/source/drivers/odbc/OStatement.cxx
@@ -449,7 +449,7 @@ Reference< XConnection > SAL_CALL OStatement_Base::getConnection( )
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
- return Reference< XConnection >(m_pConnection.get());
+ return m_pConnection;
}