summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/flat/ETable.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/drivers/flat/ETable.cxx')
-rw-r--r--connectivity/source/drivers/flat/ETable.cxx42
1 files changed, 22 insertions, 20 deletions
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index 4417c0fe6a7a..584838ad6446 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -103,7 +104,7 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
// column count
const xub_StrLen nFieldCount = aHeaderLine.GetTokenCount(m_cFieldDelimiter,m_cStringDelimiter);
- if(!m_aColumns.isValid())
+ if(!m_aColumns.is())
m_aColumns = new OSQLColumns();
else
m_aColumns->get().clear();
@@ -236,7 +237,7 @@ void OFlatTable::impl_fillColumnInfo_nothrow(QuotedTokenizedString& aFirstLine,x
++nSpaceCount;
continue;
}
- // nur Ziffern und Dezimalpunkt und Tausender-Trennzeichen?
+ // just digits, decimal- and thousands-delimiter?
if ( ( !cDecimalDelimiter || c != cDecimalDelimiter ) &&
( !cThousandDelimiter || c != cThousandDelimiter ) &&
!aCharClass.isDigit(aField2,j) &&
@@ -259,12 +260,12 @@ void OFlatTable::impl_fillColumnInfo_nothrow(QuotedTokenizedString& aFirstLine,x
bNumeric = sal_False;
if (bNumeric && cThousandDelimiter)
{
- // Ist der Trenner richtig angegeben?
+ // Is the delimiter correct?
const String aValue = aField2.GetToken(0,cDecimalDelimiter);
for (sal_Int32 j = aValue.Len() - 4; j >= 0; j -= 4)
{
const sal_Unicode c = aValue.GetChar(static_cast<sal_uInt16>(j));
- // nur Ziffern und Dezimalpunkt und Tausender-Trennzeichen?
+ // just digits, decimal- and thousands-delimiter?
if (c == cThousandDelimiter && j)
continue;
else
@@ -275,7 +276,7 @@ void OFlatTable::impl_fillColumnInfo_nothrow(QuotedTokenizedString& aFirstLine,x
}
}
- // jetzt koennte es noch ein Datumsfeld sein
+ // now also check for a date field
if (!bNumeric)
{
try
@@ -370,7 +371,7 @@ void OFlatTable::impl_fillColumnInfo_nothrow(QuotedTokenizedString& aFirstLine,x
break;
default:
io_nType = DataType::VARCHAR;
- io_nPrecisions = 0; // nyi: Daten koennen aber laenger sein!
+ io_nPrecisions = 0; // nyi: Data can be longer!
io_nScales = 0;
{
static const ::rtl::OUString s_sVARCHAR(RTL_CONSTASCII_USTRINGPARAM("VARCHAR"));
@@ -431,11 +432,11 @@ void OFlatTable::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);
Reference<XPropertySet> xProp(xSupplier->getNumberFormatSettings(),UNO_QUERY);
- xProp->getPropertyValue(::rtl::OUString::createFromAscii("NullDate")) >>= m_aNullDate;
+ xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NullDate"))) >>= m_aNullDate;
INetURLObject aURL;
aURL.SetURL(getEntry());
@@ -456,7 +457,7 @@ void OFlatTable::construct()
sal_Int32 nSize = m_pFileStream->Tell();
m_pFileStream->Seek(STREAM_SEEK_TO_BEGIN);
- // Buffersize abhaengig von der Filegroesse
+ // Buffersize is dependent on the file-size
m_pFileStream->SetBufferSize(nSize > 1000000 ? 32768 :
nSize > 100000 ? 16384 :
nSize > 10000 ? 4096 : 1024);
@@ -619,7 +620,7 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal
OFlatConnection* pConnection = (OFlatConnection*)m_pConnection;
const sal_Unicode cDecimalDelimiter = pConnection->getDecimalDelimiter();
const sal_Unicode cThousandDelimiter = pConnection->getThousandDelimiter();
- // Felder:
+ // Fields:
xub_StrLen nStartPos = 0;
String aStr;
OSQLColumns::Vector::const_iterator aIter = _rCols.get().begin();
@@ -634,7 +635,7 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal
(_rRow->get())[i]->setNull();
else
{
- // Laengen je nach Datentyp:
+ // lengths depending on data-type:
sal_Int32 nLen,
nType = 0;
if(bIsTable)
@@ -677,7 +678,7 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal
} break;
case DataType::DOUBLE:
case DataType::INTEGER:
- case DataType::DECIMAL: // #99178# OJ
+ case DataType::DECIMAL:
case DataType::NUMERIC:
{
@@ -687,11 +688,11 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal
sal_Unicode* pData = aStrConverted.AllocBuffer(aStr.Len());
const sal_Unicode* pStart = pData;
- OSL_ENSURE(cDecimalDelimiter && nType != DataType::INTEGER ||
- !cDecimalDelimiter && nType == DataType::INTEGER,
+ OSL_ENSURE((cDecimalDelimiter && nType != DataType::INTEGER) ||
+ (!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)
{
const sal_Unicode cChar = aStr.GetChar(j);
@@ -699,10 +700,10 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal
*pData++ = '.';
//aStrConverted.Append( '.' );
else if ( cChar == '.' ) // special case, if decimal seperator isn't '.' we have to put the string after it
- continue; // #99189# OJ
+ continue;
else if (cThousandDelimiter && cChar == cThousandDelimiter)
{
- // weglassen
+ // leave out
}
else
*pData++ = cChar;
@@ -727,7 +728,7 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal
default:
{
- // Wert als String in Variable der Row uebernehmen
+ // Copy Value as String in Row-Variable
*(_rRow->get())[i] = ORowSetValue(aStr);
}
break;
@@ -747,7 +748,7 @@ sal_Bool OFlatTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::seekRow" );
OSL_ENSURE(m_pFileStream,"OFlatTable::seekRow: FileStream is NULL!");
// ----------------------------------------------------------
- // Positionierung vorbereiten:
+ // Prepare positioning:
m_nFilePos = nCurPos;
switch(eCursorPosition)
@@ -922,3 +923,4 @@ sal_Bool OFlatTable::readLine(sal_Int32& _rnCurrentPos)
return sal_True;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */