dba34b: #i115655# new ui setting for max row scan for text db
This commit is contained in:
@@ -56,6 +56,7 @@ using namespace ::com::sun::star::lang;
|
|||||||
|
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
OFlatConnection::OFlatConnection(ODriver* _pDriver) : OConnection(_pDriver)
|
OFlatConnection::OFlatConnection(ODriver* _pDriver) : OConnection(_pDriver)
|
||||||
|
,m_nMaxRowsToScan(50)
|
||||||
,m_bHeaderLine(sal_True)
|
,m_bHeaderLine(sal_True)
|
||||||
,m_cFieldDelimiter(';')
|
,m_cFieldDelimiter(';')
|
||||||
,m_cStringDelimiter('"')
|
,m_cStringDelimiter('"')
|
||||||
@@ -108,6 +109,10 @@ void OFlatConnection::construct(const ::rtl::OUString& url,const Sequence< Prope
|
|||||||
OSL_VERIFY( pBegin->Value >>= aVal );
|
OSL_VERIFY( pBegin->Value >>= aVal );
|
||||||
m_cThousandDelimiter = aVal.toChar();
|
m_cThousandDelimiter = aVal.toChar();
|
||||||
}
|
}
|
||||||
|
else if ( !pBegin->Name.compareToAscii("MaxRowScan") )
|
||||||
|
{
|
||||||
|
pBegin->Value >>= m_nMaxRowsToScan;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
osl_decrementInterlockedCount( &m_refCount );
|
osl_decrementInterlockedCount( &m_refCount );
|
||||||
|
@@ -127,6 +127,7 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
|
|||||||
::comphelper::UStringMixEqual aCase(bCase);
|
::comphelper::UStringMixEqual aCase(bCase);
|
||||||
::std::vector<String> aColumnNames,m_aTypeNames;
|
::std::vector<String> aColumnNames,m_aTypeNames;
|
||||||
m_aTypeNames.resize(nFieldCount);
|
m_aTypeNames.resize(nFieldCount);
|
||||||
|
const sal_Int32 nMaxRowsToScan = pConnection->getMaxRowsToScan();
|
||||||
sal_Int32 nRowCount = 0;
|
sal_Int32 nRowCount = 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@@ -158,7 +159,7 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
|
|||||||
}
|
}
|
||||||
++nRowCount;
|
++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++)
|
for (xub_StrLen i = 0; i < nFieldCount; i++)
|
||||||
{
|
{
|
||||||
|
@@ -75,6 +75,11 @@
|
|||||||
<value>false</value>
|
<value>false</value>
|
||||||
</prop>
|
</prop>
|
||||||
</node>
|
</node>
|
||||||
|
<node oor:name="MaxRowScan" oor:op="replace">
|
||||||
|
<prop oor:name="Value" oor:type="xs:int">
|
||||||
|
<value>100</value>
|
||||||
|
</prop>
|
||||||
|
</node>
|
||||||
</node>
|
</node>
|
||||||
<node oor:name="Features">
|
<node oor:name="Features">
|
||||||
<node oor:name="UseSQL92NamingConstraints" oor:op="replace">
|
<node oor:name="UseSQL92NamingConstraints" oor:op="replace">
|
||||||
|
@@ -38,6 +38,7 @@ namespace connectivity
|
|||||||
class OFlatConnection : public file::OConnection
|
class OFlatConnection : public file::OConnection
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
sal_Int32 m_nMaxRowsToScan;
|
||||||
sal_Bool m_bHeaderLine; // column names in first row
|
sal_Bool m_bHeaderLine; // column names in first row
|
||||||
sal_Unicode m_cFieldDelimiter; // look at the name
|
sal_Unicode m_cFieldDelimiter; // look at the name
|
||||||
sal_Unicode m_cStringDelimiter; // delimiter for strings m_cStringDelimiter blabla m_cStringDelimiter
|
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 getStringDelimiter() const { return m_cStringDelimiter; }
|
||||||
inline sal_Unicode getDecimalDelimiter() const { return m_cDecimalDelimiter; }
|
inline sal_Unicode getDecimalDelimiter() const { return m_cDecimalDelimiter; }
|
||||||
inline sal_Unicode getThousandDelimiter() const { return m_cThousandDelimiter;}
|
inline sal_Unicode getThousandDelimiter() const { return m_cThousandDelimiter;}
|
||||||
|
inline sal_Int32 getMaxRowsToScan() const { return m_nMaxRowsToScan;}
|
||||||
// XServiceInfo
|
// XServiceInfo
|
||||||
DECLARE_SERVICE_INFO();
|
DECLARE_SERVICE_INFO();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user