diff options
Diffstat (limited to 'dbaccess/source/ui/tabledesign/TableController.cxx')
-rw-r--r-- | dbaccess/source/ui/tabledesign/TableController.cxx | 71 |
1 files changed, 5 insertions, 66 deletions
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index e25a292a7705..d37573c59654 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -2,9 +2,9 @@ * * $RCSfile: TableController.cxx,v $ * - * $Revision: 1.39 $ + * $Revision: 1.40 $ * - * last change: $Author: oj $ $Date: 2001-06-29 11:21:10 $ + * last change: $Author: oj $ $Date: 2001-06-29 11:53:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1172,70 +1172,9 @@ void OTableController::loadData() pTabEdRow = new OTableRow(); pTabEdRow->SetReadOnly(!bIsAlterAllowed); // search for type - ::std::pair<OTypeInfoMap::iterator, OTypeInfoMap::iterator> aPair = m_aTypeInfo.equal_range(nType); - OTypeInfoMap::iterator aIter = aPair.first; - if(aIter == m_aTypeInfo.end()) // compare with end is correct here - { - OSL_ENSURE(sal_False, "OTableController::loadData: no type info found for this type!"); - continue; - } - - for(;aIter != aPair.second;++aIter) - { - // 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; -#endif - if ( ( !sTypeName.getLength() - || (aIter->second->aTypeName == sTypeName) - ) - && (aIter->second->nPrecision >= nPrecision) - && (aIter->second->nMaximumScale >= nScale) - ) - break; - } - - if (aIter == aPair.second) - { - for(aIter = aPair.first; aIter != aPair.second; ++aIter) - { - // search the best matching type (now comparing the local names) - if ( (aIter->second->aLocalTypeName == sTypeName) - && (aIter->second->nPrecision >= nPrecision) - && (aIter->second->nMaximumScale >= nScale) - ) - { - OSL_ENSURE(sal_False, - ( ::rtl::OString("OTableController::loadData: assuming column type ") - += ::rtl::OString(aIter->second->aTypeName.getStr(), aIter->second->aTypeName.getLength(), gsl_getSystemTextEncoding()) - += ::rtl::OString(" for column \"") - += ::rtl::OString(sName.getStr(), sName.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; - } - } - } - - if (aIter == aPair.second) - { // no match for the names, no match for the local names - // -> drop the precision and the scale restriction, accept any type with the property - // type id (nType) - - OSL_ENSURE(sal_False, - ( ::rtl::OString("OTableController::loadData: did not find a matching type for column \"") - += ::rtl::OString(sName.getStr(), sName.getLength(), gsl_getSystemTextEncoding()) - += ::rtl::OString("\" (expected type name: ") - += ::rtl::OString(sTypeName.getStr(), sTypeName.getLength(), gsl_getSystemTextEncoding()) - += ::rtl::OString(")! Defaulting to the first matching type.")).getStr()); - - pTabEdRow->SetFieldType( aPair.first->second, sal_True ); - } - else - pTabEdRow->SetFieldType( aIter->second ); + sal_Bool bForce; + const OTypeInfo* pTypeInfo = ::dbaui::getTypeInfoFromType(m_aTypeInfo,nType,sTypeName,nPrecision,nScale,bForce); + pTabEdRow->SetFieldType( pTypeInfo, bForce ); pActFieldDescr = pTabEdRow->GetActFieldDescr(); OSL_ENSURE(pActFieldDescr, "OTableController::loadData: invalid field description generated by the table row!"); |