summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorOcke Janssen [oj] <Ocke.Janssen@sun.com>2010-01-15 08:06:07 +0100
committerOcke Janssen [oj] <Ocke.Janssen@sun.com>2010-01-15 08:06:07 +0100
commit24519f54a51bc481acff466670b1d74df3ce9ab3 (patch)
tree48ae74033951f3ff3ca891cadc42c076d4a52101 /dbaccess
parent56660ceabd571ab96ec493c8c2f4986617fd14af (diff)
dba33d: #i106772# slice decimal value to scale
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/api/KeySet.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
index 1e7aa0f51f97..474ad8a38b65 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -802,7 +802,24 @@ void OKeySet::copyRowValue(const ORowSetRow& _rInsertRow,ORowSetRow& _rKeyRow)
SelectColumnsMetaData::const_iterator aPosEnd = (*m_pKeyColumnNames).end();
for(;aPosIter != aPosEnd;++aPosIter,++aIter)
{
- *aIter = (_rInsertRow->get())[aPosIter->second.nPosition];
+ ORowSetValue aValue((_rInsertRow->get())[aPosIter->second.nPosition]);
+ switch(aPosIter->second.nType)
+ {
+ case DataType::DECIMAL:
+ case DataType::NUMERIC:
+ {
+ ::rtl::OUString sValue = aValue.getString();
+ sal_Int32 nIndex = sValue.indexOf('.');
+ if ( nIndex != -1 )
+ {
+ aValue = sValue.copy(0,nIndex + (aPosIter->second.nScale > 0 ? aPosIter->second.nScale + 1 : 0));
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ *aIter = aValue;
aIter->setTypeKind(aPosIter->second.nType);
}
}