| commit | b7c74a050bc0e1b5ac86dfe476d68a5029bada6e | [log] |
|---|---|---|
| author | Xisco Fauli <xiscofauli@libreoffice.org> | Wed Jul 10 13:26:10 2019 +0200 |
| committer | Xisco FaulĂ <xiscofauli@libreoffice.org> | Wed Jul 10 16:02:13 2019 +0200 |
| tree | b27f1f760ddf7b880f5cbd10b60f5fa795dcf227 | |
| parent | 97585591eea9fa7af20c051d2ffb95240ce3d8c6 [diff] |
tdf#123591: Firebird: take decimal places into account... when copying values from Calc to Base Change-Id: I5dc645e3e9b153f71f2027a205815aaf83c1d6d3 Reviewed-on: https://gerrit.libreoffice.org/75346 Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> Tested-by: Jenkins (cherry picked from commit fb52df57abe51a5923a49fb0818f4b58565dfc25) Reviewed-on: https://gerrit.libreoffice.org/75350 Reviewed-by: Xisco FaulĂ <xiscofauli@libreoffice.org>
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx index cf44aa4..737875e 100644 --- a/connectivity/source/drivers/firebird/PreparedStatement.cxx +++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
@@ -422,6 +422,13 @@ void SAL_CALL OPreparedStatement::setDouble(sal_Int32 nIndex, double nValue) XSQLVAR* pVar = m_pInSqlda->sqlvar + (nIndex - 1); int dType = (pVar->sqltype & ~1); // drop flag bit for now // take decimal places into account, later on they are removed in makeNumericString // minus because firebird stores scale as a negative number int nDecimalCount = -pVar->sqlscale; sal_Int64 nDecimalCountExp = pow10Integer(nDecimalCount); nValue = static_cast<double>(nValue * nDecimalCountExp); // Caller might try to set an integer type here. It makes sense to convert // it instead of throwing an error. switch(dType)