Tag: cws_src680_qiq User: fs Date: 2006/06/27 05:46:23 Modified: dba/dbaccess/source/ui/misc/UITools.cxx
Log: RESYNC: (1.59-1.60); FILE MERGED File Changes: Directory: /dba/dbaccess/source/ui/misc/ ======================================== File [changed]: UITools.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/UITools.cxx?r1=1.59.66.4&r2=1.59.66.5 Delta lines: +16 -26 --------------------- --- UITools.cxx 24 May 2006 06:49:27 -0000 1.59.66.4 +++ UITools.cxx 27 Jun 2006 12:46:19 -0000 1.59.66.5 @@ -548,10 +548,10 @@ { // search the best matching type #ifdef DBG_UTIL - ::rtl::OUString sDBTypeName = aIter->second->aTypeName; - sal_Int32 nDBTypePrecision = aIter->second->nPrecision; - sal_Int32 nDBTypeScale = aIter->second->nMaximumScale; - sal_Bool bDBAutoIncrement = aIter->second->bAutoIncrement; + ::rtl::OUString sDBTypeName = aIter->second->aTypeName; (void)sDBTypeName; + sal_Int32 nDBTypePrecision = aIter->second->nPrecision; (void)nDBTypePrecision; + sal_Int32 nDBTypeScale = aIter->second->nMaximumScale; (void)nDBTypeScale; + sal_Bool bDBAutoIncrement = aIter->second->bAutoIncrement; (void)bDBAutoIncrement; #endif if ( ( !_sTypeName.getLength() @@ -585,15 +585,12 @@ && (aIter->second->bAutoIncrement == _bAutoIncrement) ) { -// we can not assert here because we could be in d&d -/* OSL_ENSURE(sal_False, ( ::rtl::OString("getTypeInfoFromType: assuming column type ") += ::rtl::OString(aIter->second->aTypeName.getStr(), aIter->second->aTypeName.getLength(), gsl_getSystemTextEncoding()) += ::rtl::OString("\" (expected type name ") += ::rtl::OString(_sTypeName.getStr(), _sTypeName.getLength(), gsl_getSystemTextEncoding()) += ::rtl::OString(" matches the type's local name).")).getStr()); -*/ break; } } @@ -604,14 +601,11 @@ // -> drop the precision and the scale restriction, accept any type with the property // type id (nType) - // we can not assert here because we could be in d&d -/* OSL_ENSURE(sal_False, ( ::rtl::OString("getTypeInfoFromType: did not find a matching type") += ::rtl::OString(" (expected type name: ") += ::rtl::OString(_sTypeName.getStr(), _sTypeName.getLength(), gsl_getSystemTextEncoding()) += ::rtl::OString(")! Defaulting to the first matching type.")).getStr()); -*/ for(aIter = aPair.first; aIter != aPair.second; ++aIter) { // search the best matching type (now comparing the local names) @@ -671,20 +665,19 @@ { ::comphelper::TStringMixEqualFunctor aCase(sal_False); // search for typeinfo where the typename is equal _sTypeName - OTypeInfoMap::const_iterator aIter = _rTypeInfo.begin(); - OTypeInfoMap::const_iterator aEnd = _rTypeInfo.end(); - for (; aIter != aEnd ; ++aIter) + OTypeInfoMap::const_iterator typeInfoLoop = _rTypeInfo.begin(); + OTypeInfoMap::const_iterator typeInfoEnd = _rTypeInfo.end(); + for (; typeInfoLoop != typeInfoEnd; ++typeInfoLoop) + { + if ( aCase( typeInfoLoop->second->getDBName() , _sTypeName ) ) { - if ( aCase(aIter->second->getDBName() , _sTypeName) ) + pTypeInfo = typeInfoLoop->second; break; } - - if ( aIter != aEnd ) - pTypeInfo = aIter->second; + } } -// we can not assert here because we could be in d&d -// OSL_ENSURE(pTypeInfo, "getTypeInfoFromType: no type info found for this type!"); + OSL_ENSURE(pTypeInfo, "getTypeInfoFromType: no type info found for this type!"); return pTypeInfo; } // ----------------------------------------------------------------------------- @@ -767,7 +760,6 @@ pInfo->nMaximumScale = aValue; nPos = 18; aValue.fill(nPos,aTypes[nPos],xRow); - pInfo->nNumPrecRadix = aValue; // check if values are less than zero like it happens in a oracle jdbc driver if( pInfo->nPrecision < 0) @@ -776,8 +768,6 @@ pInfo->nMinimumScale = 0; if( pInfo->nMaximumScale < 0) pInfo->nMaximumScale = 0; - if( pInfo->nNumPrecRadix < 0) - pInfo->nNumPrecRadix = 10; String aName; switch(pInfo->nType) @@ -1182,7 +1172,7 @@ // if the col is bound to a text field we have to disallow all non-text formats if ((DataType::CHAR == _nDataType) || (DataType::VARCHAR == _nDataType) || (DataType::LONGVARCHAR == _nDataType)) { - sal_Bool bText = sal_True; + bText = sal_True; pFormatDescriptor->Put(SfxBoolItem(SID_ATTR_NUMBERFORMAT_ONE_AREA, sal_True)); if (!_pFormatter->IsTextFormat(_nFormatKey)) // text fields can only have text formats --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
