Tag: cws_ooh680_dba241b User: oj Date: 2008-04-23 11:16:50+0000 Modified: dba/connectivity/source/drivers/dbase/DTable.cxx
Log: #i87325# wrong len checked File Changes: Directory: /dba/connectivity/source/drivers/dbase/ ================================================== File [changed]: DTable.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/dbase/DTable.cxx?r1=1.103.44.1&r2=1.103.44.1.6.1 Delta lines: +21 -17 --------------------- --- DTable.cxx 2008-01-18 14:54:57+0000 1.103.44.1 +++ DTable.cxx 2008-04-23 11:16:47+0000 1.103.44.1.6.1 @@ -4,9 +4,9 @@ * * $RCSfile: DTable.cxx,v $ * - * $Revision: 1.103.44.1 $ + * $Revision: 1.103.44.1.6.1 $ * - * last change: $Author: kz $ $Date: 2008/01/18 14:54:57 $ + * last change: $Author: oj $ $Date: 2008/04/23 11:16:47 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1605,19 +1605,23 @@ // sein koennte und muesste ByteString aDefaultValue = ::rtl::math::doubleToString( n, rtl_math_StringFormat_F, nScale, '.', NULL, 0); - sal_Int32 nRealLen = aDefaultValue.Len() - nScale; + sal_Int32 nRealLen = aDefaultValue.Len(); + BOOL bValidLength = nRealLen <= nLen; + if ( bValidLength ) + { + nRealLen -= nScale; if ( nScale ) // for '.' --nRealLen; if ( n < 0.0 ) // for the sign '-' --nRealLen; - BOOL bValidLength = sal_False; - if ( nRealLen <= (nRealPrecision - nScale) ) + bValidLength = nRealLen < nRealPrecision; + if ( bValidLength ) { strncpy(pData,aDefaultValue.GetBuffer(),nLen); // write the resulting double back *rRow[nPos] = toDouble(aDefaultValue); - bValidLength = TRUE; + } // if ( nRealLen < nRealPrecision ) } if (!bValidLength) { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
