diff options
Diffstat (limited to 'connectivity/source/commontools/FValue.cxx')
-rw-r--r-- | connectivity/source/commontools/FValue.cxx | 48 |
1 files changed, 39 insertions, 9 deletions
diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx index 797cad9de343..0a8b5bd1b972 100644 --- a/connectivity/source/commontools/FValue.cxx +++ b/connectivity/source/commontools/FValue.cxx @@ -788,12 +788,30 @@ sal_Bool operator==(const DateTime& _rLH,const DateTime& _rRH) bool ORowSetValue::operator==(const ORowSetValue& _rRH) const { - if(m_eTypeKind != _rRH.m_eTypeKind) - return false; - if ( m_bSigned != _rRH.m_bSigned ) - return false; - if(m_bNull != _rRH.isNull()) + if ( m_eTypeKind != _rRH.m_eTypeKind ) + { + switch(m_eTypeKind) + { + case DataType::FLOAT: + case DataType::DOUBLE: + case DataType::REAL: + return getDouble() == _rRH.getDouble(); + default: + switch(_rRH.m_eTypeKind) + { + case DataType::FLOAT: + case DataType::DOUBLE: + case DataType::REAL: + return getDouble() == _rRH.getDouble(); + default: + break; + } + break; + } return false; + } + if ( m_bNull != _rRH.isNull() ) + return false; if(m_bNull && _rRH.isNull()) return true; @@ -803,16 +821,28 @@ bool ORowSetValue::operator==(const ORowSetValue& _rRH) const { case DataType::VARCHAR: case DataType::CHAR: - case DataType::DECIMAL: - case DataType::NUMERIC: case DataType::LONGVARCHAR: { ::rtl::OUString aVal1(m_aValue.m_pString); ::rtl::OUString aVal2(_rRH.m_aValue.m_pString); - bRet = aVal1 == aVal2; - break; + return aVal1 == aVal2; } + default: + if ( m_bSigned != _rRH.m_bSigned ) + return false; + break; + } + switch(m_eTypeKind) + { + case DataType::DECIMAL: + case DataType::NUMERIC: + { + ::rtl::OUString aVal1(m_aValue.m_pString); + ::rtl::OUString aVal2(_rRH.m_aValue.m_pString); + bRet = aVal1 == aVal2; + } + break; case DataType::FLOAT: bRet = *(float*)m_aValue.m_pValue == *(float*)_rRH.m_aValue.m_pValue; break; |