Kaydet (Commit) d48668ec authored tarafından Stephan Bergmann's avatar Stephan Bergmann

connectivity (Linux): loplugin:cstylecast

Change-Id: If2a3306360ea3db4476b09774e4f93c2c0dc4027
üst d7e5ee16
...@@ -614,7 +614,6 @@ OEvoabResultSet::OEvoabResultSet( OCommonStatement* pStmt, OEvoabConnection *pCo ...@@ -614,7 +614,6 @@ OEvoabResultSet::OEvoabResultSet( OCommonStatement* pStmt, OEvoabConnection *pCo
,::comphelper::OPropertyContainer( OResultSet_BASE::rBHelper ) ,::comphelper::OPropertyContainer( OResultSet_BASE::rBHelper )
,m_pStatement(pStmt) ,m_pStatement(pStmt)
,m_pConnection(pConnection) ,m_pConnection(pConnection)
,m_xMetaData(NULL)
,m_bWasNull(true) ,m_bWasNull(true)
,m_nFetchSize(0) ,m_nFetchSize(0)
,m_nResultSetType(ResultSetType::SCROLL_INSENSITIVE) ,m_nResultSetType(ResultSetType::SCROLL_INSENSITIVE)
...@@ -702,10 +701,9 @@ void OEvoabResultSet::construct( const QueryData& _rData ) ...@@ -702,10 +701,9 @@ void OEvoabResultSet::construct( const QueryData& _rData )
m_nIndex = -1; m_nIndex = -1;
// create our meta data (need the EBookQuery for this) // create our meta data (need the EBookQuery for this)
OEvoabResultSetMetaData* pMeta = new OEvoabResultSetMetaData( _rData.sTable ); m_xMetaData = new OEvoabResultSetMetaData( _rData.sTable );
m_xMetaData = pMeta;
pMeta->setEvoabFields( _rData.xSelectColumns ); m_xMetaData->setEvoabFields( _rData.xSelectColumns );
} }
...@@ -753,8 +751,7 @@ OUString SAL_CALL OEvoabResultSet::getString( sal_Int32 nColumnNum ) throw(SQLEx ...@@ -753,8 +751,7 @@ OUString SAL_CALL OEvoabResultSet::getString( sal_Int32 nColumnNum ) throw(SQLEx
OUString aResult; OUString aResult;
if ( m_xMetaData.is()) if ( m_xMetaData.is())
{ {
OEvoabResultSetMetaData *pMeta = (OEvoabResultSetMetaData *) m_xMetaData.get(); sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(nColumnNum);
sal_Int32 nFieldNumber = pMeta->fieldAtColumn(nColumnNum);
GValue aValue = { 0, { { 0 } } }; GValue aValue = { 0, { { 0 } } };
if ( getValue( getCur(), nFieldNumber, G_TYPE_STRING, &aValue, m_bWasNull ) ) if ( getValue( getCur(), nFieldNumber, G_TYPE_STRING, &aValue, m_bWasNull ) )
aResult = valueToOUString( aValue ); aResult = valueToOUString( aValue );
...@@ -770,8 +767,7 @@ sal_Bool SAL_CALL OEvoabResultSet::getBoolean( sal_Int32 nColumnNum ) throw(SQLE ...@@ -770,8 +767,7 @@ sal_Bool SAL_CALL OEvoabResultSet::getBoolean( sal_Int32 nColumnNum ) throw(SQLE
if ( m_xMetaData.is()) if ( m_xMetaData.is())
{ {
OEvoabResultSetMetaData *pMeta = (OEvoabResultSetMetaData *) m_xMetaData.get(); sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(nColumnNum);
sal_Int32 nFieldNumber = pMeta->fieldAtColumn(nColumnNum);
GValue aValue = { 0, { { 0 } } }; GValue aValue = { 0, { { 0 } } };
if ( getValue( getCur(), nFieldNumber, G_TYPE_BOOLEAN, &aValue, m_bWasNull ) ) if ( getValue( getCur(), nFieldNumber, G_TYPE_BOOLEAN, &aValue, m_bWasNull ) )
bResult = valueToBool( aValue ); bResult = valueToBool( aValue );
...@@ -891,7 +887,7 @@ Reference< XResultSetMetaData > SAL_CALL OEvoabResultSet::getMetaData( ) throw( ...@@ -891,7 +887,7 @@ Reference< XResultSetMetaData > SAL_CALL OEvoabResultSet::getMetaData( ) throw(
// the meta data should have been created at construction time // the meta data should have been created at construction time
ENSURE_OR_THROW( m_xMetaData.is(), "internal error: no meta data" ); ENSURE_OR_THROW( m_xMetaData.is(), "internal error: no meta data" );
return m_xMetaData; return m_xMetaData.get();
} }
// XResultSetMetaDataSupplier Interface Ends // XResultSetMetaDataSupplier Interface Ends
......
...@@ -87,7 +87,7 @@ namespace connectivity ...@@ -87,7 +87,7 @@ namespace connectivity
OCommonStatement* m_pStatement; OCommonStatement* m_pStatement;
OEvoabConnection* m_pConnection; OEvoabConnection* m_pConnection;
::com::sun::star::uno::WeakReferenceHelper m_aStatement; ::com::sun::star::uno::WeakReferenceHelper m_aStatement;
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > m_xMetaData; rtl::Reference<OEvoabResultSetMetaData> m_xMetaData;
::dbtools::WarningsContainer m_aWarnings; ::dbtools::WarningsContainer m_aWarnings;
bool m_bWasNull; bool m_bWasNull;
......
...@@ -770,7 +770,7 @@ sal_Bool SAL_CALL KabDatabaseMetaData::supportsBatchUpdates( ) throw(SQLExcepti ...@@ -770,7 +770,7 @@ sal_Bool SAL_CALL KabDatabaseMetaData::supportsBatchUpdates( ) throw(SQLExcepti
Reference< XConnection > SAL_CALL KabDatabaseMetaData::getConnection( ) throw(SQLException, RuntimeException, std::exception) Reference< XConnection > SAL_CALL KabDatabaseMetaData::getConnection( ) throw(SQLException, RuntimeException, std::exception)
{ {
return (Reference< XConnection >) m_xConnection.get(); return m_xConnection.get();
} }
Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getTableTypes( ) throw(SQLException, RuntimeException, std::exception) Reference< XResultSet > SAL_CALL KabDatabaseMetaData::getTableTypes( ) throw(SQLException, RuntimeException, std::exception)
......
...@@ -164,7 +164,7 @@ Reference< XConnection > SAL_CALL KabPreparedStatement::getConnection() throw(SQ ...@@ -164,7 +164,7 @@ Reference< XConnection > SAL_CALL KabPreparedStatement::getConnection() throw(SQ
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed); checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed);
return (Reference< XConnection >) m_pConnection; return m_pConnection;
} }
Reference< XResultSet > SAL_CALL KabPreparedStatement::executeQuery() throw(SQLException, RuntimeException, std::exception) Reference< XResultSet > SAL_CALL KabPreparedStatement::executeQuery() throw(SQLException, RuntimeException, std::exception)
......
...@@ -445,7 +445,7 @@ Reference< XConnection > SAL_CALL KabCommonStatement::getConnection( ) throw(SQ ...@@ -445,7 +445,7 @@ Reference< XConnection > SAL_CALL KabCommonStatement::getConnection( ) throw(SQ
checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed); checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed);
// just return our connection here // just return our connection here
return (Reference< XConnection >) m_pConnection; return m_pConnection;
} }
sal_Int32 SAL_CALL KabCommonStatement::executeUpdate( const OUString& ) throw(SQLException, RuntimeException, std::exception) sal_Int32 SAL_CALL KabCommonStatement::executeUpdate( const OUString& ) throw(SQLException, RuntimeException, std::exception)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment