[Libreoffice-commits] core.git: 4 commits - connectivity/source dbaccess/source
Lionel Elie Mamane
lionel at mamane.lu
Wed Aug 14 08:41:00 PDT 2013
connectivity/source/commontools/FValue.cxx | 22 ++++++++++++++++++----
connectivity/source/commontools/dbtools.cxx | 18 +++++++++++++++---
connectivity/source/commontools/parameters.cxx | 1 +
dbaccess/source/core/api/RowSet.cxx | 4 ----
4 files changed, 34 insertions(+), 11 deletions(-)
New commits:
commit 9a9ee66f0d9dd126ed31db096b77f9c67355411b
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date: Wed Aug 14 17:36:50 2013 +0200
fixup handling of unsigned values
that overflow their signed counterpart type
Change-Id: I7d446a5fdddb9d5ef313c1bd022fd959b11dec28
diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx
index bf78289..5a18711 100644
--- a/connectivity/source/commontools/FValue.cxx
+++ b/connectivity/source/commontools/FValue.cxx
@@ -204,8 +204,15 @@ void ORowSetValue::setTypeKind(sal_Int32 _eType)
(*this) = getString();
break;
case DataType::BIGINT:
- (*this) = getLong();
+ {
+ sal_Int64 nVal(getLong());
+ sal_uInt64 nuVal(getULong());
+ if (nVal == 0 && nuVal != 0)
+ (*this) = nuVal;
+ else
+ (*this) = nVal;
break;
+ }
case DataType::FLOAT:
(*this) = getFloat();
@@ -221,8 +228,15 @@ void ORowSetValue::setTypeKind(sal_Int32 _eType)
(*this) = getInt16();
break;
case DataType::INTEGER:
- (*this) = getInt32();
+ {
+ sal_Int32 nVal(getInt32());
+ sal_uInt32 nuVal(getUInt32());
+ if (nVal == 0 && nuVal != 0)
+ (*this) = nuVal;
+ else
+ (*this) = nVal;
break;
+ }
case DataType::BIT:
case DataType::BOOLEAN:
(*this) = getBool();
@@ -1498,7 +1512,7 @@ sal_uInt32 ORowSetValue::getUInt32() const
case DataType::DECIMAL:
case DataType::NUMERIC:
case DataType::LONGVARCHAR:
- nRet = OUString(m_aValue.m_pString).toInt32();
+ nRet = OUString(m_aValue.m_pString).toUInt32();
break;
case DataType::FLOAT:
nRet = sal_uInt32(m_aValue.m_nFloat);
@@ -1645,7 +1659,7 @@ sal_uInt64 ORowSetValue::getULong() const
case DataType::DECIMAL:
case DataType::NUMERIC:
case DataType::LONGVARCHAR:
- nRet = static_cast<sal_uInt64>(OUString(m_aValue.m_pString).toInt64());
+ nRet = static_cast<sal_uInt64>(OUString(m_aValue.m_pString).toUInt64());
break;
case DataType::FLOAT:
nRet = sal_uInt64(m_aValue.m_nFloat);
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index 8d24548..39b7e91 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -1595,6 +1595,14 @@ sal_Bool implSetObject( const Reference< XParameters >& _rxParameters,
switch (_rValue.getValueTypeClass())
{
case TypeClass_UNSIGNED_HYPER:
+ {
+ sal_uInt64 nValue = 0;
+ OSL_VERIFY( _rValue >>= nValue );
+ _rxParameters->setString(_nColumnIndex, OUString::number(nValue));
+ }
+ break;
+
+ case TypeClass_UNSIGNED_LONG:
case TypeClass_HYPER:
{
sal_Int64 nValue = 0;
@@ -1627,7 +1635,6 @@ sal_Bool implSetObject( const Reference< XParameters >& _rxParameters,
_rxParameters->setByte(_nColumnIndex, *(sal_Int8 *)_rValue.getValue());
break;
- case TypeClass_UNSIGNED_SHORT:
case TypeClass_SHORT:
_rxParameters->setShort(_nColumnIndex, *(sal_Int16*)_rValue.getValue());
break;
@@ -1636,10 +1643,14 @@ sal_Bool implSetObject( const Reference< XParameters >& _rxParameters,
_rxParameters->setString(_nColumnIndex, OUString((sal_Unicode *)_rValue.getValue(),1));
break;
- case TypeClass_UNSIGNED_LONG:
+ case TypeClass_UNSIGNED_SHORT:
case TypeClass_LONG:
- _rxParameters->setInt(_nColumnIndex, *(sal_Int32*)_rValue.getValue());
+ {
+ sal_Int32 nValue = 0;
+ OSL_VERIFY( _rValue >>= nValue );
+ _rxParameters->setInt(_nColumnIndex, nValue);
break;
+ }
case TypeClass_FLOAT:
_rxParameters->setFloat(_nColumnIndex, *(float*)_rValue.getValue());
commit 6dc6300fe50ea9555a9a54755c07a7b55519f71a
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date: Wed Aug 14 17:33:12 2013 +0200
better debugging: dump unexpected exception
Change-Id: I5df60d69431c67e3b8a2d76677d82e8eb1bd398a
diff --git a/connectivity/source/commontools/parameters.cxx b/connectivity/source/commontools/parameters.cxx
index 32ac6e8..2b658c5 100644
--- a/connectivity/source/commontools/parameters.cxx
+++ b/connectivity/source/commontools/parameters.cxx
@@ -609,6 +609,7 @@ namespace dbtools
}
catch( const Exception& )
{
+ DBG_UNHANDLED_EXCEPTION();
SAL_WARN( "connectivity.commontools", "ParameterManager::fillLinkedParameters: master-detail parameter number " <<
sal_Int32( *aPosition + 1 ) << " could not be filled!" );
}
commit 76b5ac2193f4822d87a4543b7d6adfff4e7f0cf2
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date: Wed Aug 14 17:32:36 2013 +0200
doing it once is sufficient
Change-Id: If31845aa575b3f9459507deefb1b469ac3715e35
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index 64e7d84..6ef538a 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -2424,10 +2424,6 @@ ORowSetValue& ORowSet::getParameterStorage(sal_Int32 parameterIndex)
m_aParametersSet.resize( parameterIndex ,false);
m_aParametersSet[parameterIndex - 1] = true;
- if ( m_aParametersSet.size() < (size_t)parameterIndex )
- m_aParametersSet.resize( parameterIndex ,false);
- m_aParametersSet[parameterIndex - 1] = true;
-
if ( m_pParameters.is() )
{
if ( m_bCommandFacetsDirty )
commit d805c470845c89a54bfc50ec7d75dfba670d8b21
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date: Wed Aug 14 16:08:38 2013 +0200
fdo#67546 handle unsigned 64 bit integers
Change-Id: I09453c73303076318b7105a778ff98695b0a3839
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index 1ea9b14..8d24548 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -1594,6 +1594,7 @@ sal_Bool implSetObject( const Reference< XParameters >& _rxParameters,
sal_Bool bSuccessfullyReRouted = sal_True;
switch (_rValue.getValueTypeClass())
{
+ case TypeClass_UNSIGNED_HYPER:
case TypeClass_HYPER:
{
sal_Int64 nValue = 0;
More information about the Libreoffice-commits
mailing list