summaryrefslogtreecommitdiff
path: root/connectivity/source/commontools/FValue.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/commontools/FValue.cxx')
-rw-r--r--connectivity/source/commontools/FValue.cxx107
1 files changed, 85 insertions, 22 deletions
diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx
index 9f1afe1e93..647ddaccde 100644
--- a/connectivity/source/commontools/FValue.cxx
+++ b/connectivity/source/commontools/FValue.cxx
@@ -258,6 +258,7 @@ void ORowSetValue::setTypeKind(sal_Int32 _eType)
(*this) = getAny();
break;
default:
+ (*this) = getAny();
OSL_ENSURE(0,"ORowSetValue:operator==(): UNSPUPPORTED TYPE!");
}
}
@@ -344,6 +345,19 @@ void ORowSetValue::free()
TRACE_FREE( Any )
m_aValue.m_pValue = NULL;
break;
+ case DataType::BIT:
+ case DataType::TINYINT:
+ case DataType::SMALLINT:
+ case DataType::BOOLEAN:
+ break;
+ default:
+ if ( m_aValue.m_pValue )
+ {
+ delete (Any*)m_aValue.m_pValue;
+ TRACE_FREE( Any )
+ m_aValue.m_pValue = NULL;
+ }
+ break;
}
m_bNull = sal_True;
@@ -849,7 +863,9 @@ bool ORowSetValue::operator==(const ORowSetValue& _rRH) const
bRet = false;
break;
default:
+ bRet = false;
OSL_ENSURE(0,"ORowSetValue::operator==(): UNSPUPPORTED TYPE!");
+ break;
}
return bRet;
}
@@ -942,6 +958,8 @@ Any ORowSetValue::makeAny() const
break;
default:
OSL_ENSURE(0,"ORowSetValue::makeAny(): UNSPUPPORTED TYPE!");
+ rValue = getAny();
+ break;
}
}
return rValue;
@@ -1032,6 +1050,12 @@ Any ORowSetValue::makeAny() const
}
}
break;
+ default:
+ {
+ Any aValue = getAny();
+ aValue >>= aRet;
+ break;
+ }
}
}
return aRet;
@@ -1104,8 +1128,11 @@ sal_Bool ORowSetValue::getBool() const
bRet = m_bSigned ? (m_aValue.m_nInt32 != 0) : (*static_cast<sal_Int64*>(m_aValue.m_pValue) != sal_Int64(0));
break;
default:
- OSL_ENSURE(0,"Illegal conversion!");
- break;
+ {
+ Any aValue = getAny();
+ aValue >>= bRet;
+ break;
+ }
}
}
return bRet;
@@ -1174,8 +1201,11 @@ sal_Int8 ORowSetValue::getInt8() const
nRet = static_cast<sal_Int8>(*static_cast<sal_Int64*>(m_aValue.m_pValue));
break;
default:
- OSL_ENSURE(0,"Illegal conversion!");
- break;
+ {
+ Any aValue = getAny();
+ aValue >>= nRet;
+ break;
+ }
}
}
return nRet;
@@ -1244,8 +1274,11 @@ sal_Int16 ORowSetValue::getInt16() const
nRet = static_cast<sal_Int16>(*static_cast<sal_Int64*>(m_aValue.m_pValue));
break;
default:
- OSL_ENSURE(0,"Illegal conversion!");
- break;
+ {
+ Any aValue = getAny();
+ aValue >>= nRet;
+ break;
+ }
}
}
return nRet;
@@ -1314,8 +1347,11 @@ sal_Int32 ORowSetValue::getInt32() const
nRet = static_cast<sal_Int32>(*static_cast<sal_Int64*>(m_aValue.m_pValue));
break;
default:
- OSL_ENSURE(0,"Illegal conversion!");
- break;
+ {
+ Any aValue = getAny();
+ aValue >>= nRet;
+ break;
+ }
}
}
return nRet;
@@ -1384,8 +1420,11 @@ sal_Int64 ORowSetValue::getLong() const
nRet = *(sal_Int64*)m_aValue.m_pValue;
break;
default:
- OSL_ENSURE(0,"Illegal conversion!");
- break;
+ {
+ Any aValue = getAny();
+ aValue >>= nRet;
+ break;
+ }
}
}
return nRet;
@@ -1458,8 +1497,11 @@ float ORowSetValue::getFloat() const
nRet = float(*(sal_Int64*)m_aValue.m_pValue);
break;
default:
- OSL_ENSURE(0,"Illegal conversion!");
- break;
+ {
+ Any aValue = getAny();
+ aValue >>= nRet;
+ break;
+ }
}
}
return nRet;
@@ -1534,8 +1576,11 @@ double ORowSetValue::getDouble() const
nRet = double(*(sal_Int64*)m_aValue.m_pValue);
break;
default:
- OSL_ENSURE(0,"Illegal conversion!");
- break;
+ {
+ Any aValue = getAny();
+ aValue >>= nRet;
+ break;
+ }
}
}
return nRet;
@@ -1626,6 +1671,11 @@ void ORowSetValue::setFromDouble(const double& _rVal,sal_Int32 _nDatatype)
TRACE_ALLOC( sal_Int64 )
}
break;
+ default:
+ {
+ m_aValue.m_pValue = new Any(_rVal);
+ break;
+ }
}
m_eTypeKind = _nDatatype;
}
@@ -1692,7 +1742,11 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const
aSeq = *static_cast< Sequence<sal_Int8>*>(m_aValue.m_pValue);
break;
default:
- ;
+ {
+ Any aValue = getAny();
+ aValue >>= aSeq;
+ break;
+ }
}
}
return aSeq;
@@ -1734,8 +1788,11 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const
}
break;
default:
- OSL_ENSURE(0,"Illegal conversion!");
- break;
+ {
+ Any aAnyValue = getAny();
+ aAnyValue >>= aValue;
+ break;
+ }
}
}
return aValue;
@@ -1776,8 +1833,11 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const
aValue = *static_cast< ::com::sun::star::util::Time*>(m_aValue.m_pValue);
break;
default:
- OSL_ENSURE(0,"Illegal conversion!");
- break;
+ {
+ Any aAnyValue = getAny();
+ aAnyValue >>= aValue;
+ break;
+ }
}
}
return aValue;
@@ -1826,8 +1886,11 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const
aValue = *static_cast< ::com::sun::star::util::DateTime*>(m_aValue.m_pValue);
break;
default:
- OSL_ENSURE(0,"Illegal conversion!");
- break;
+ {
+ Any aAnyValue = getAny();
+ aAnyValue >>= aValue;
+ break;
+ }
}
}
return aValue;
@@ -2094,7 +2157,7 @@ void ORowSetValue::impl_fill( const sal_Int32 _nType, sal_Bool _bNullable, const
break;
default:
OSL_ENSURE( false, "ORowSetValue::fill: unsupported type!" );
- bReadData = false;
+ (*this) = _rValueSource.getObject();
break;
}
if ( bReadData && _bNullable && _rValueSource.wasNull() )