Tag: cws_dev300_dba30c User: oj Date: 2008-05-07 08:59:16+0000 Modified: dba/connectivity/source/commontools/FValue.cxx dba/connectivity/source/commontools/parameters.cxx
Log: #i73021 #correct signed, unsiged handling of bigit File Changes: Directory: /dba/connectivity/source/commontools/ ================================================ File [changed]: FValue.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/FValue.cxx?r1=1.33&r2=1.33.10.1 Delta lines: +29 -8 -------------------- --- FValue.cxx 2008-04-10 07:54:16+0000 1.33 +++ FValue.cxx 2008-05-07 08:59:13+0000 1.33.10.1 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: FValue.cxx,v $ - * $Revision: 1.33 $ + * $Revision: 1.33.10.1 $ * * This file is part of OpenOffice.org. * @@ -1044,7 +1044,10 @@ bRet = ::rtl::OUString(m_aValue.m_pString).toInt32() != 0; break; case DataType::BIGINT: - bRet = *(sal_Int64*)m_aValue.m_pValue != 0.0; + if ( m_bSigned ) + bRet = *(sal_Int64*)m_aValue.m_pValue != 0; + else + bRet = ::rtl::OUString(m_aValue.m_pString).toInt64() != 0; break; case DataType::FLOAT: bRet = *(float*)m_aValue.m_pValue != 0.0; @@ -1096,7 +1099,10 @@ nRet = sal_Int8(::rtl::OUString(m_aValue.m_pString).toInt32()); break; case DataType::BIGINT: + if ( m_bSigned ) nRet = sal_Int8(*(sal_Int64*)m_aValue.m_pValue); + else + nRet = sal_Int8(::rtl::OUString(m_aValue.m_pString).toInt32()); break; case DataType::FLOAT: nRet = sal_Int8(*(float*)m_aValue.m_pValue); @@ -1157,7 +1163,10 @@ nRet = sal_Int16(::rtl::OUString(m_aValue.m_pString).toInt32()); break; case DataType::BIGINT: + if ( m_bSigned ) nRet = sal_Int16(*(sal_Int64*)m_aValue.m_pValue); + else + nRet = sal_Int16(::rtl::OUString(m_aValue.m_pString).toInt32()); break; case DataType::FLOAT: nRet = sal_Int16(*(float*)m_aValue.m_pValue); @@ -1726,10 +1735,22 @@ switch(m_eTypeKind) { case DataType::BIGINT: - if ( m_bSigned ) - (*this) = getLong(); + if ( m_bSigned ) // now we are signed, so we were unsigned and need to call getString() + { + m_bSigned = !m_bSigned; + const ::rtl::OUString sValue = getString(); + free(); + m_bSigned = !m_bSigned; + (*this) = sValue; + } else - (*this) = getString(); + { + m_bSigned = !m_bSigned; + const sal_Int64 nValue = getLong(); + free(); + m_bSigned = !m_bSigned; + (*this) = nValue; + } break; case DataType::TINYINT: if ( m_bSigned ) File [changed]: parameters.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/parameters.cxx?r1=1.3&r2=1.3.8.1 Delta lines: +3 -2 ------------------- --- parameters.cxx 2008-04-10 08:02:30+0000 1.3 +++ parameters.cxx 2008-05-07 08:59:13+0000 1.3.8.1 @@ -48,6 +48,7 @@ #include "TConnection.hxx" #include <tools/debug.hxx> +#include <tools/diagnose_ex.h> #include <comphelper/uno3.hxx> #include <comphelper/proparrhlp.hxx> @@ -593,7 +594,7 @@ // type and scale of the parameter field sal_Int32 nParamType = DataType::VARCHAR; - OSL_VERIFY( xDetailField->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FIELDTYPE) ) >>= nParamType ); + OSL_VERIFY( xDetailField->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE) ) >>= nParamType ); sal_Int32 nScale = 0; if ( xDetailField->getPropertySetInfo()->hasPropertyByName( OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE) ) ) @@ -621,7 +622,7 @@ } catch( const Exception& ) { - OSL_ENSURE( sal_False, "ParameterManager::fillLinkedParameters: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
