Tag: cws_src680_oj14
User: oj      
Date: 2006/07/04 01:13:00

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.58.4.3&r2=1.58.4.4
Delta lines:  +16 -26
---------------------
--- UITools.cxx 25 Apr 2006 13:03:16 -0000      1.58.4.3
+++ UITools.cxx 4 Jul 2006 08:12:57 -0000       1.58.4.4
@@ -536,10 +536,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()
@@ -573,15 +573,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;
                                }
                        }
@@ -592,14 +589,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)
@@ -659,20 +653,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;
 }
 // 
-----------------------------------------------------------------------------
@@ -755,7 +748,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)
@@ -764,8 +756,6 @@
                                pInfo->nMinimumScale = 0;
                        if( pInfo->nMaximumScale < 0)
                                pInfo->nMaximumScale = 0;
-                       if( pInfo->nNumPrecRadix < 0)
-                               pInfo->nNumPrecRadix = 10;
 
                        String aName;
                        switch(pInfo->nType)
@@ -1170,7 +1160,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]

Reply via email to