diff options
author | Ocke.Janssen <Ocke.Janssen@oracle.com> | 2010-11-25 11:23:27 +0100 |
---|---|---|
committer | Ocke.Janssen <Ocke.Janssen@oracle.com> | 2010-11-25 11:23:27 +0100 |
commit | f99088e1081ca38ff1cafecac974a22143a7b085 (patch) | |
tree | 30dd5c39bc52971fad0c28f6c9401a3abeadf29b /connectivity | |
parent | 7b7a507d69a451402c328760071618070ffc7e08 (diff) |
dba34b: #i115655# new ui setting for max row scan for text db
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/flat/EConnection.cxx | 5 | ||||
-rw-r--r-- | connectivity/source/drivers/flat/ETable.cxx | 3 | ||||
-rwxr-xr-x | connectivity/source/drivers/flat/flat.xcu | 5 | ||||
-rw-r--r-- | connectivity/source/inc/flat/EConnection.hxx | 2 |
4 files changed, 14 insertions, 1 deletions
diff --git a/connectivity/source/drivers/flat/EConnection.cxx b/connectivity/source/drivers/flat/EConnection.cxx index 4aeb5fd90369..428f813c2674 100644 --- a/connectivity/source/drivers/flat/EConnection.cxx +++ b/connectivity/source/drivers/flat/EConnection.cxx @@ -56,6 +56,7 @@ using namespace ::com::sun::star::lang; // -------------------------------------------------------------------------------- OFlatConnection::OFlatConnection(ODriver* _pDriver) : OConnection(_pDriver) + ,m_nMaxRowsToScan(50) ,m_bHeaderLine(sal_True) ,m_cFieldDelimiter(';') ,m_cStringDelimiter('"') @@ -108,6 +109,10 @@ void OFlatConnection::construct(const ::rtl::OUString& url,const Sequence< Prope OSL_VERIFY( pBegin->Value >>= aVal ); m_cThousandDelimiter = aVal.toChar(); } + else if ( !pBegin->Name.compareToAscii("MaxRowScan") ) + { + pBegin->Value >>= m_nMaxRowsToScan; + } } osl_decrementInterlockedCount( &m_refCount ); diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index 2e41c10080e1..5e93b07a15f6 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -127,6 +127,7 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale) ::comphelper::UStringMixEqual aCase(bCase); ::std::vector<String> aColumnNames,m_aTypeNames; m_aTypeNames.resize(nFieldCount); + const sal_Int32 nMaxRowsToScan = pConnection->getMaxRowsToScan(); sal_Int32 nRowCount = 0; do { @@ -158,7 +159,7 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale) } ++nRowCount; } - while(nRowCount < 50 && m_pFileStream->ReadByteStringLine(aFirstLine,nEncoding)); + while(nRowCount < nMaxRowsToScan && m_pFileStream->ReadByteStringLine(aFirstLine,nEncoding)); for (xub_StrLen i = 0; i < nFieldCount; i++) { diff --git a/connectivity/source/drivers/flat/flat.xcu b/connectivity/source/drivers/flat/flat.xcu index d00d1f98c38c..cd6a072ff1c6 100755 --- a/connectivity/source/drivers/flat/flat.xcu +++ b/connectivity/source/drivers/flat/flat.xcu @@ -75,6 +75,11 @@ <value>false</value> </prop> </node> + <node oor:name="MaxRowScan" oor:op="replace"> + <prop oor:name="Value" oor:type="xs:int"> + <value>100</value> + </prop> + </node> </node> <node oor:name="Features"> <node oor:name="UseSQL92NamingConstraints" oor:op="replace"> diff --git a/connectivity/source/inc/flat/EConnection.hxx b/connectivity/source/inc/flat/EConnection.hxx index 3b4fb7e558d6..becd4670f994 100644 --- a/connectivity/source/inc/flat/EConnection.hxx +++ b/connectivity/source/inc/flat/EConnection.hxx @@ -38,6 +38,7 @@ namespace connectivity class OFlatConnection : public file::OConnection { private: + sal_Int32 m_nMaxRowsToScan; sal_Bool m_bHeaderLine; // column names in first row sal_Unicode m_cFieldDelimiter; // look at the name sal_Unicode m_cStringDelimiter; // delimiter for strings m_cStringDelimiter blabla m_cStringDelimiter @@ -55,6 +56,7 @@ namespace connectivity inline sal_Unicode getStringDelimiter() const { return m_cStringDelimiter; } inline sal_Unicode getDecimalDelimiter() const { return m_cDecimalDelimiter; } inline sal_Unicode getThousandDelimiter() const { return m_cThousandDelimiter;} + inline sal_Int32 getMaxRowsToScan() const { return m_nMaxRowsToScan;} // XServiceInfo DECLARE_SERVICE_INFO(); |