diff options
Diffstat (limited to 'connectivity/source/drivers/evoab/LTable.cxx')
-rw-r--r-- | connectivity/source/drivers/evoab/LTable.cxx | 83 |
1 files changed, 41 insertions, 42 deletions
diff --git a/connectivity/source/drivers/evoab/LTable.cxx b/connectivity/source/drivers/evoab/LTable.cxx index 505337dacf..41ac3773d1 100644 --- a/connectivity/source/drivers/evoab/LTable.cxx +++ b/connectivity/source/drivers/evoab/LTable.cxx @@ -72,7 +72,7 @@ using namespace ::com::sun::star::lang; // ------------------------------------------------------------------------- void OEvoabTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale) { - BOOL bRead = TRUE; + sal_Bool bRead = sal_True; QuotedTokenizedString aHeaderLine; OEvoabConnection* pConnection = (OEvoabConnection*)m_pConnection; @@ -115,7 +115,7 @@ void OEvoabTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale) m_aPrecisions.reserve(nFieldCount); m_aScales.reserve(nFieldCount); - sal_Bool bCase = getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers(); + sal_Bool bCase = getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers(); CharClass aCharClass(pConnection->getDriver()->getFactory(),_aLocale); // read description sal_Unicode cDecimalDelimiter = pConnection->getDecimalDelimiter(); @@ -141,11 +141,11 @@ void OEvoabTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale) //OSL_TRACE("OEvoabTable::aColumnName = %s\n", ((OUtoCStr(::rtl::OUString(aColumnName))) ? (OUtoCStr(::rtl::OUString(aColumnName))):("NULL")) ); sal_Int32 eType; - UINT16 nPrecision = 0; - UINT16 nScale = 0; + sal_uInt16 nPrecision = 0; + sal_uInt16 nScale = 0; - BOOL bNumeric = FALSE; - ULONG nIndex = 0; + sal_Bool bNumeric = sal_False; + sal_uIntPtr nIndex = 0; // first without fielddelimiter String aField; @@ -155,7 +155,7 @@ void OEvoabTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale) if (aField.Len() == 0 || (pConnection->getStringDelimiter() && pConnection->getStringDelimiter() == aField.GetChar(0))) { - bNumeric = FALSE; + bNumeric = sal_False; } else { @@ -169,21 +169,21 @@ void OEvoabTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale) if (aField2.Len() == 0) { - bNumeric = FALSE; + bNumeric = sal_False; } else { - bNumeric = TRUE; + bNumeric = sal_True; xub_StrLen nDot = 0; for (xub_StrLen j = 0; j < aField2.Len(); j++) { sal_Unicode c = aField2.GetChar(j); - // nur Ziffern und Dezimalpunkt und Tausender-Trennzeichen? + // only digits, decimalpoint and thousands-delimiter if ((!cDecimalDelimiter || c != cDecimalDelimiter) && (!cThousandDelimiter || c != cThousandDelimiter) && !aCharClass.isDigit(aField2,j)) { - bNumeric = FALSE; + bNumeric = sal_False; break; } if (cDecimalDelimiter && c == cDecimalDelimiter) @@ -195,26 +195,26 @@ void OEvoabTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale) } if (nDot > 1) // if there is more than one dot it isn't a number - bNumeric = FALSE; + bNumeric = sal_False; if (bNumeric && cThousandDelimiter) { - // Ist der Trenner richtig angegeben? + // is the delimiter given correctly String aValue = aField2.GetToken(0,cDecimalDelimiter); for (sal_Int32 j = aValue.Len() - 4; j >= 0; j -= 4) { sal_Unicode c = aValue.GetChar(j); - // nur Ziffern und Dezimalpunkt und Tausender-Trennzeichen? + // only digits, decimalpoint and thousands-delimiter? if (c == cThousandDelimiter && j) continue; else { - bNumeric = FALSE; + bNumeric = sal_False; break; } } } - // jetzt koennte es noch ein Datumsfeld sein + // Now it might still be a Date-field if (!bNumeric) { try @@ -236,12 +236,12 @@ void OEvoabTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale) if(nPrecision) { eType = DataType::DECIMAL; - aTypeName = ::rtl::OUString::createFromAscii("DECIMAL"); + aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DECIMAL")); } else { eType = DataType::DOUBLE; - aTypeName = ::rtl::OUString::createFromAscii("DOUBLE"); + aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DOUBLE")); } } else @@ -255,21 +255,21 @@ void OEvoabTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale) { case NUMBERFORMAT_DATE: eType = DataType::DATE; - aTypeName = ::rtl::OUString::createFromAscii("DATE"); + aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATE")); break; case NUMBERFORMAT_DATETIME: eType = DataType::TIMESTAMP; - aTypeName = ::rtl::OUString::createFromAscii("TIMESTAMP"); + aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TIMESTAMP")); break; case NUMBERFORMAT_TIME: eType = DataType::TIME; - aTypeName = ::rtl::OUString::createFromAscii("TIME"); + aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TIME")); break; default: eType = DataType::VARCHAR; - nPrecision = 0; // nyi: Daten koennen aber laenger sein! + nPrecision = 0; // nyi: Data can be longer nScale = 0; - aTypeName = ::rtl::OUString::createFromAscii("VARCHAR"); + aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VARCHAR")); }; nFlags |= ColumnSearch::CHAR; } @@ -338,8 +338,8 @@ void OEvoabTable::construct() Sequence< ::com::sun::star::uno::Any > aArg(1); aArg[0] <<= aAppLocale; - Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier(m_pConnection->getDriver()->getFactory()->createInstanceWithArguments(::rtl::OUString::createFromAscii("com.sun.star.util.NumberFormatsSupplier"),aArg),UNO_QUERY); - m_xNumberFormatter = Reference< ::com::sun::star::util::XNumberFormatter >(m_pConnection->getDriver()->getFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.NumberFormatter")),UNO_QUERY); + Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier(m_pConnection->getDriver()->getFactory()->createInstanceWithArguments(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatsSupplier")),aArg),UNO_QUERY); + m_xNumberFormatter = Reference< ::com::sun::star::util::XNumberFormatter >(m_pConnection->getDriver()->getFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatter"))),UNO_QUERY); m_xNumberFormatter->attachNumberFormatsSupplier(xSupplier); INetURLObject aURL; @@ -362,7 +362,7 @@ void OEvoabTable::construct() sal_Int32 nSize = m_pFileStream->Tell(); m_pFileStream->Seek(STREAM_SEEK_TO_BEGIN); - // Buffersize abhaengig von der Filegroesse + // Buffer size is dependent on the file-size m_pFileStream->SetBufferSize(nSize > 1000000 ? 32768 : nSize > 100000 ? 16384 : nSize > 10000 ? 4096 : 1024); @@ -510,10 +510,10 @@ sal_Bool OEvoabTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sa *(_rRow->get())[0] = m_nFilePos; if (!bRetrieveData) - return TRUE; + return sal_True; OEvoabConnection* pConnection = (OEvoabConnection*)m_pConnection; - // Felder: + // Fields: xub_StrLen nStartPos = 0; String aStr; OSQLColumns::Vector::const_iterator aIter = _rCols.get().begin(); @@ -526,7 +526,7 @@ sal_Bool OEvoabTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sa (_rRow->get())[i+1]->setNull(); else { - // Laengen je nach Datentyp: + // Lengths for each data-type: sal_Int32 nLen, nType = 0; if(bIsTable) @@ -552,7 +552,7 @@ sal_Bool OEvoabTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sa nRes = m_xNumberFormatter->convertStringToNumber(::com::sun::star::util::NumberFormat::ALL,aStr); Reference<XPropertySet> xProp(m_xNumberFormatter->getNumberFormatsSupplier()->getNumberFormatSettings(),UNO_QUERY); com::sun::star::util::Date aDate; - xProp->getPropertyValue(::rtl::OUString::createFromAscii("NullDate")) >>= aDate; + xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NullDate"))) >>= aDate; switch(nType) { @@ -573,7 +573,7 @@ sal_Bool OEvoabTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sa } break; case DataType::DOUBLE: case DataType::INTEGER: - case DataType::DECIMAL: // #99178# OJ + case DataType::DECIMAL: case DataType::NUMERIC: { sal_Unicode cDecimalDelimiter = pConnection->getDecimalDelimiter(); @@ -584,23 +584,22 @@ sal_Bool OEvoabTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sa !cDecimalDelimiter && nType == DataType::INTEGER, "FalscherTyp"); - // In Standard-Notation (DezimalPUNKT ohne Tausender-Komma) umwandeln: + // Convert to standard-notation (DecimalPOINT without Thousands-comma): for (xub_StrLen j = 0; j < aStr.Len(); ++j) { if (cDecimalDelimiter && aStr.GetChar(j) == cDecimalDelimiter) aStrConverted += '.'; else if ( aStr.GetChar(j) == '.' ) // special case, if decimal seperator isn't '.' we have to vut the string after it - break; // #99189# OJ + break; else if (cThousandDelimiter && aStr.GetChar(j) == cThousandDelimiter) { - // weglassen + // leave out } else aStrConverted += aStr.GetChar(j) ; } double nVal = ::rtl::math::stringToDouble(aStrConverted.GetBuffer(),',','.',NULL,NULL); - // #99178# OJ if ( DataType::DECIMAL == nType || DataType::NUMERIC == nType ) *(_rRow->get())[i+1] = ORowSetValue(String::CreateFromDouble(nVal)); else @@ -609,7 +608,7 @@ sal_Bool OEvoabTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sa default: { - // Wert als String in Variable der Row uebernehmen + // Copy Value as String in Row-variable *(_rRow->get())[i+1] = ORowSetValue(aStr); } break; @@ -664,15 +663,15 @@ sal_Bool OEvoabTable::setColumnAliases() } } else - OSL_ENSURE( sal_False, "OEvoabTable::setColumnAliases: did not find one of the aliases!" ); + OSL_FAIL( "OEvoabTable::setColumnAliases: did not find one of the aliases!" ); } if(!bFound) aColumnFinalName = aColumnReadName; sColumnFinalName = aColumnFinalName; - sal_Bool bCase = getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers(); + sal_Bool bCase = getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers(); ::rtl::OUString aTypeName; - aTypeName = ::rtl::OUString::createFromAscii("VARCHAR"); + aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VARCHAR")); sdbcx::OColumn* pColumn = new sdbcx::OColumn(sColumnFinalName,aTypeName,::rtl::OUString(), ColumnValue::NULLABLE, m_aPrecisions[i], @@ -696,7 +695,7 @@ sal_Bool OEvoabTable::checkHeaderLine() { if (m_nFilePos == 0 && ((OEvoabConnection*)m_pConnection)->isHeaderLine()) { - BOOL bRead2; + sal_Bool bRead2; do { bRead2 = m_pFileStream->ReadByteStringLine(m_aCurrentLine,m_pConnection->getTextEncoding()); @@ -718,7 +717,7 @@ sal_Bool OEvoabTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_In return sal_False; OEvoabConnection* pConnection = (OEvoabConnection*)m_pConnection; // ---------------------------------------------------------- - // Positionierung vorbereiten: + // prepare positioning: //OSL_TRACE("OEvoabTable::(before SeekRow,m_pFileStriam Exist)m_aCurrentLine = %d\n", ((OUtoCStr(::rtl::OUString(m_aCurrentLine))) ? (OUtoCStr(::rtl::OUString(m_aCurrentLine))):("NULL")) ); m_nFilePos = nCurPos; @@ -851,7 +850,7 @@ sal_Bool OEvoabTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_In if (m_pFileStream->IsEof()) return sal_False; - m_nFilePos = m_pFileStream->Tell(); // Byte-Position in der Datei merken (am ZeilenANFANG) + m_nFilePos = m_pFileStream->Tell(); // save Byte-Position in the file (at start of line) m_pFileStream->ReadByteStringLine(m_aCurrentLine,pConnection->getTextEncoding()); if (m_pFileStream->IsEof()) return sal_False; |