From e218242ebd8bbf5dbd5a995a6881cbdd2ee106e1 Mon Sep 17 00:00:00 2001 From: "Andrzej J.R. Hunt" Date: Thu, 29 Aug 2013 09:49:37 +0100 Subject: 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 --- connectivity/source/drivers/firebird/PreparedStatement.cxx | 6 +++--- connectivity/source/drivers/firebird/PreparedStatement.hxx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'connectivity/source') 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 -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 void setValue(sal_Int32 nIndex, T nValue, ISC_SHORT nType) + template void setValue(sal_Int32 nIndex, T& nValue, ISC_SHORT nType) throw(::com::sun::star::sdbc::SQLException); void setParameterNull(sal_Int32 nParameterIndex, bool bSetNull = true); -- cgit