diff options
author | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2013-08-29 09:49:37 +0100 |
---|---|---|
committer | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2013-08-29 10:07:41 +0100 |
commit | e218242ebd8bbf5dbd5a995a6881cbdd2ee106e1 (patch) | |
tree | ce7fb0da7acfa0f772be249f71c21f4dd4dd75df /connectivity/source | |
parent | 6e3913b5dd6450b2f1b1115b6430393e98f1cdc2 (diff) |
Pass by reference instead of value, fix template parameters. (firebird-sdbc)
We will also want to pass structs etc. into setValue hence we should pass
by reference.
Change-Id: Ia8aa02ca14414003c33cd8d070510759091b5ec9
Diffstat (limited to 'connectivity/source')
-rw-r--r-- | connectivity/source/drivers/firebird/PreparedStatement.cxx | 6 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/PreparedStatement.hxx | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx index fdbb0a4e34f0..0a753db7e073 100644 --- a/connectivity/source/drivers/firebird/PreparedStatement.cxx +++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx @@ -331,7 +331,7 @@ void SAL_CALL OPreparedStatement::setBoolean(sal_Int32 nIndex, sal_Bool x) } template <typename T> -void OPreparedStatement::setValue(sal_Int32 nIndex, T nValue, ISC_SHORT nType) +void OPreparedStatement::setValue(sal_Int32 nIndex, T& nValue, ISC_SHORT nType) throw(SQLException) { MutexGuard aGuard( m_pConnection->getMutex() ); @@ -380,13 +380,13 @@ void SAL_CALL OPreparedStatement::setLong(sal_Int32 nIndex, sal_Int64 nValue) void SAL_CALL OPreparedStatement::setFloat(sal_Int32 nIndex, float nValue) throw(SQLException, RuntimeException) { - setValue< sal_Int64 >(nIndex, nValue, SQL_FLOAT); + setValue< float >(nIndex, nValue, SQL_FLOAT); } void SAL_CALL OPreparedStatement::setDouble(sal_Int32 nIndex, double nValue) throw(SQLException, RuntimeException) { - setValue< sal_Int64 >(nIndex, nValue, SQL_DOUBLE); // TODO: SQL_D_FLOAT? + setValue< double >(nIndex, nValue, SQL_DOUBLE); // TODO: SQL_D_FLOAT? } // ------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/firebird/PreparedStatement.hxx b/connectivity/source/drivers/firebird/PreparedStatement.hxx index 5392a93d6a52..c32be80d9644 100644 --- a/connectivity/source/drivers/firebird/PreparedStatement.hxx +++ b/connectivity/source/drivers/firebird/PreparedStatement.hxx @@ -78,7 +78,7 @@ namespace connectivity * Set a numeric value in the input SQLDA. If the destination * parameter is not of nType then an Exception will be thrown. */ - template <typename T> void setValue(sal_Int32 nIndex, T nValue, ISC_SHORT nType) + template <typename T> void setValue(sal_Int32 nIndex, T& nValue, ISC_SHORT nType) throw(::com::sun::star::sdbc::SQLException); void setParameterNull(sal_Int32 nParameterIndex, bool bSetNull = true); |