Tag: cws_src680_warnings01 User: pl Date: 05/11/07 11:06:44 Modified: /dba/connectivity/source/drivers/dbase/ DTable.cxx
Log: RESYNC: (1.89-1.90); FILE MERGED 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.89.16.1&r2=1.89.16.2 Delta lines: +132 -125 ----------------------- --- DTable.cxx 7 Nov 2005 14:43:15 -0000 1.89.16.1 +++ DTable.cxx 7 Nov 2005 19:06:41 -0000 1.89.16.2 @@ -970,6 +970,8 @@ ::rtl::OUString aName; Reference<XPropertySet> xCol; + try + { for(sal_Int32 i=0;i<xColumns->getCount();++i) { ::cppu::extractInterface(xCol,xColumns->getByIndex(i)); @@ -979,25 +981,17 @@ xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= aName; - if (aName.getLength() > nMaxFieldLength) - { - try + ::rtl::OString aCol; + if ( DBTypeConversion::convertUnicodeString( aName, aCol, getConnection()->getTextEncoding() ) > nMaxFieldLength) { - // we have to drop the file because it is corrupted now - DropImpl(); - } - catch(const Exception&) - { - } ::rtl::OUString sMsg = ::rtl::OUString::createFromAscii("Invalid column name length for column: "); sMsg += aName; sMsg += ::rtl::OUString::createFromAscii("!"); throw SQLException(sMsg,*this,OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_HY0000),1000,Any()); } - ByteString aCol(aName.getStr(), getConnection()->getTextEncoding()); - (*m_pFileStream) << aCol.GetBuffer(); - m_pFileStream->Write(aBuffer, 11 - aCol.Len()); + (*m_pFileStream) << aCol.getStr(); + m_pFileStream->Write(aBuffer, 11 - aCol.getLength()); switch (getINT32(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)))) { @@ -1106,6 +1100,19 @@ { m_pFileStream->Seek(0L); (*m_pFileStream) << (BYTE) dBaseIIIMemo; + } // if (bCreateMemo) + } + catch(const Exception& e) + { + try + { + // we have to drop the file because it is corrupted now + DropImpl(); + } + catch(const Exception&) + { + } + throw e; } return TRUE; } @@ -2223,7 +2230,7 @@ { OSL_ASSERT(0); } - } + } // for(sal_uInt32 nRowPos = 0; nRowPos < m_aHeader.db_anz;++nRowPos) } // ----------------------------------------------------------------------------- void ODbaseTable::throwInvalidDbaseFormat() --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
