summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/flat
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/drivers/flat')
-rwxr-xr-x[-rw-r--r--]connectivity/source/drivers/flat/ECatalog.cxx0
-rwxr-xr-x[-rw-r--r--]connectivity/source/drivers/flat/EColumns.cxx0
-rwxr-xr-x[-rw-r--r--]connectivity/source/drivers/flat/EConnection.cxx6
-rwxr-xr-x[-rw-r--r--]connectivity/source/drivers/flat/EDatabaseMetaData.cxx0
-rwxr-xr-x[-rw-r--r--]connectivity/source/drivers/flat/EDriver.cxx0
-rwxr-xr-x[-rw-r--r--]connectivity/source/drivers/flat/EPreparedStatement.cxx0
-rwxr-xr-x[-rw-r--r--]connectivity/source/drivers/flat/EResultSet.cxx0
-rwxr-xr-x[-rw-r--r--]connectivity/source/drivers/flat/EStatement.cxx0
-rwxr-xr-x[-rw-r--r--]connectivity/source/drivers/flat/ETable.cxx322
-rwxr-xr-x[-rw-r--r--]connectivity/source/drivers/flat/ETables.cxx0
-rwxr-xr-x[-rw-r--r--]connectivity/source/drivers/flat/Eservices.cxx48
-rwxr-xr-x[-rw-r--r--]connectivity/source/drivers/flat/exports.dxp1
-rwxr-xr-xconnectivity/source/drivers/flat/flat.component35
-rwxr-xr-x[-rw-r--r--]connectivity/source/drivers/flat/flat.mxp.map1
-rwxr-xr-xconnectivity/source/drivers/flat/flat.xcu10
-rwxr-xr-x[-rw-r--r--]connectivity/source/drivers/flat/flat.xml0
-rwxr-xr-x[-rw-r--r--]connectivity/source/drivers/flat/makefile.mk8
17 files changed, 258 insertions, 173 deletions
diff --git a/connectivity/source/drivers/flat/ECatalog.cxx b/connectivity/source/drivers/flat/ECatalog.cxx
index f82eb7de00..f82eb7de00 100644..100755
--- a/connectivity/source/drivers/flat/ECatalog.cxx
+++ b/connectivity/source/drivers/flat/ECatalog.cxx
diff --git a/connectivity/source/drivers/flat/EColumns.cxx b/connectivity/source/drivers/flat/EColumns.cxx
index 7fdbeca25c..7fdbeca25c 100644..100755
--- a/connectivity/source/drivers/flat/EColumns.cxx
+++ b/connectivity/source/drivers/flat/EColumns.cxx
diff --git a/connectivity/source/drivers/flat/EConnection.cxx b/connectivity/source/drivers/flat/EConnection.cxx
index 0097e075ef..fa1abf048a 100644..100755
--- a/connectivity/source/drivers/flat/EConnection.cxx
+++ b/connectivity/source/drivers/flat/EConnection.cxx
@@ -53,6 +53,7 @@ using namespace ::com::sun::star::lang;
// --------------------------------------------------------------------------------
OFlatConnection::OFlatConnection(ODriver* _pDriver) : OConnection(_pDriver)
+ ,m_nMaxRowsToScan(50)
,m_bHeaderLine(sal_True)
,m_cFieldDelimiter(';')
,m_cStringDelimiter('"')
@@ -105,10 +106,15 @@ 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 );
OConnection::construct(url,info);
+ m_bShowDeleted = sal_True; // we do not supported rows for this type
}
// --------------------------------------------------------------------------------
Reference< XDatabaseMetaData > SAL_CALL OFlatConnection::getMetaData( ) throw(SQLException, RuntimeException)
diff --git a/connectivity/source/drivers/flat/EDatabaseMetaData.cxx b/connectivity/source/drivers/flat/EDatabaseMetaData.cxx
index 85d65153d4..85d65153d4 100644..100755
--- a/connectivity/source/drivers/flat/EDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/flat/EDatabaseMetaData.cxx
diff --git a/connectivity/source/drivers/flat/EDriver.cxx b/connectivity/source/drivers/flat/EDriver.cxx
index 48560bfb46..48560bfb46 100644..100755
--- a/connectivity/source/drivers/flat/EDriver.cxx
+++ b/connectivity/source/drivers/flat/EDriver.cxx
diff --git a/connectivity/source/drivers/flat/EPreparedStatement.cxx b/connectivity/source/drivers/flat/EPreparedStatement.cxx
index 601aadbb7b..601aadbb7b 100644..100755
--- a/connectivity/source/drivers/flat/EPreparedStatement.cxx
+++ b/connectivity/source/drivers/flat/EPreparedStatement.cxx
diff --git a/connectivity/source/drivers/flat/EResultSet.cxx b/connectivity/source/drivers/flat/EResultSet.cxx
index 94d47c3002..94d47c3002 100644..100755
--- a/connectivity/source/drivers/flat/EResultSet.cxx
+++ b/connectivity/source/drivers/flat/EResultSet.cxx
diff --git a/connectivity/source/drivers/flat/EStatement.cxx b/connectivity/source/drivers/flat/EStatement.cxx
index 6dd16a00b6..6dd16a00b6 100644..100755
--- a/connectivity/source/drivers/flat/EStatement.cxx
+++ b/connectivity/source/drivers/flat/EStatement.cxx
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index 36e4e29edf..14bf8ee5fe 100644..100755
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -73,7 +73,7 @@ using namespace ::com::sun::star::lang;
void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen@sun.com", "OFlatTable::fillColumns" );
- BOOL bRead = TRUE;
+ sal_Bool bRead = sal_True;
QuotedTokenizedString aHeaderLine;
OFlatConnection* pConnection = (OFlatConnection*)m_pConnection;
@@ -114,11 +114,11 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
m_aScales.clear();
// reserve some space
m_aColumns->get().reserve(nFieldCount+1);
- m_aTypes.reserve(nFieldCount+1);
- m_aPrecisions.reserve(nFieldCount+1);
- m_aScales.reserve(nFieldCount+1);
+ m_aTypes.assign(nFieldCount+1,DataType::SQLNULL);
+ m_aPrecisions.assign(nFieldCount+1,-1);
+ m_aScales.assign(nFieldCount+1,-1);
- const sal_Bool bCase = m_pConnection->getMetaData()->storesMixedCaseQuotedIdentifiers();
+ const sal_Bool bCase = m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers();
CharClass aCharClass(pConnection->getDriver()->getFactory(),_aLocale);
// read description
const sal_Unicode cDecimalDelimiter = pConnection->getDecimalDelimiter();
@@ -126,106 +126,186 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
String aColumnName;
::rtl::OUString aTypeName;
::comphelper::UStringMixEqual aCase(bCase);
- xub_StrLen nStartPosHeaderLine = 0; // use for eficient way to get the tokens
- xub_StrLen nStartPosFirstLine = 0; // use for eficient way to get the tokens
- xub_StrLen nStartPosFirstLine2 = 0;
- for (xub_StrLen i = 0; i < nFieldCount; i++)
+ ::std::vector<String> aColumnNames,m_aTypeNames;
+ m_aTypeNames.resize(nFieldCount);
+ const sal_Int32 nMaxRowsToScan = pConnection->getMaxRowsToScan();
+ sal_Int32 nRowCount = 0;
+ do
{
- if ( bHasHeaderLine )
+ xub_StrLen nStartPosHeaderLine = 0; // use for eficient way to get the tokens
+ xub_StrLen nStartPosFirstLine = 0; // use for eficient way to get the tokens
+ xub_StrLen nStartPosFirstLine2 = 0;
+ for (xub_StrLen i = 0; i < nFieldCount; i++)
{
- aHeaderLine.GetTokenSpecial(aColumnName,nStartPosHeaderLine,m_cFieldDelimiter,m_cStringDelimiter);
- if ( !aColumnName.Len() )
+ if ( nRowCount == 0)
{
- aColumnName = 'C';
- aColumnName += String::CreateFromInt32(i+1);
+ if ( bHasHeaderLine )
+ {
+ aHeaderLine.GetTokenSpecial(aColumnName,nStartPosHeaderLine,m_cFieldDelimiter,m_cStringDelimiter);
+ if ( !aColumnName.Len() )
+ {
+ aColumnName = 'C';
+ aColumnName += String::CreateFromInt32(i+1);
+ }
+ }
+ else
+ {
+ // no column name so ...
+ aColumnName = 'C';
+ aColumnName += String::CreateFromInt32(i+1);
+ }
+ aColumnNames.push_back(aColumnName);
}
+ impl_fillColumnInfo_nothrow(aFirstLine,nStartPosFirstLine,nStartPosFirstLine2,m_aTypes[i],m_aPrecisions[i],m_aScales[i],m_aTypeNames[i],cDecimalDelimiter,cThousandDelimiter,aCharClass);
}
- else
+ ++nRowCount;
+ }
+ while(nRowCount < nMaxRowsToScan && m_pFileStream->ReadByteStringLine(aFirstLine,nEncoding));
+
+ for (xub_StrLen i = 0; i < nFieldCount; i++)
+ {
+ // check if the columname already exists
+ String aAlias(aColumnNames[i]);
+ OSQLColumns::Vector::const_iterator aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
+ sal_Int32 nExprCnt = 0;
+ while(aFind != m_aColumns->get().end())
{
- // no column name so ...
- aColumnName = 'C';
- aColumnName += String::CreateFromInt32(i+1);
+ (aAlias = aColumnNames[i]) += String::CreateFromInt32(++nExprCnt);
+ aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
}
- sal_Int32 eType;
- UINT16 nPrecision = 0;
- UINT16 nScale = 0;
- BOOL bNumeric = FALSE;
- ULONG nIndex = 0;
+ sdbcx::OColumn* pColumn = new sdbcx::OColumn(aAlias,m_aTypeNames[i],::rtl::OUString(),::rtl::OUString(),
+ ColumnValue::NULLABLE,
+ m_aPrecisions[i],
+ m_aScales[i],
+ m_aTypes[i],
+ sal_False,
+ sal_False,
+ sal_False,
+ bCase);
+ Reference< XPropertySet> xCol = pColumn;
+ m_aColumns->get().push_back(xCol);
+ }
+ m_pFileStream->Seek(m_nStartRowFilePos);
+}
+void OFlatTable::impl_fillColumnInfo_nothrow(QuotedTokenizedString& aFirstLine,xub_StrLen& nStartPosFirstLine,xub_StrLen& nStartPosFirstLine2
+ ,sal_Int32& io_nType,sal_Int32& io_nPrecisions,sal_Int32& io_nScales,String& o_sTypeName
+ ,const sal_Unicode cDecimalDelimiter,const sal_Unicode cThousandDelimiter,const CharClass& aCharClass)
+{
+ if ( io_nType != DataType::VARCHAR )
+ {
+ sal_Bool bNumeric = io_nType == DataType::SQLNULL || io_nType == DataType::DOUBLE || io_nType == DataType::DECIMAL || io_nType == DataType::INTEGER;
+ sal_uLong nIndex = 0;
- // first without fielddelimiter
- String aField;
- aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine,m_cFieldDelimiter,'\0');
- if (aField.Len() == 0 ||
- (m_cStringDelimiter && m_cStringDelimiter == aField.GetChar(0)))
+ if ( bNumeric )
{
- bNumeric = FALSE;
- if ( m_cStringDelimiter != '\0' )
- aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
- else
- nStartPosFirstLine2 = nStartPosFirstLine;
- }
- else
- {
- String aField2;
- if ( m_cStringDelimiter != '\0' )
- aFirstLine.GetTokenSpecial(aField2,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
- else
- aField2 = aField;
-
- if (aField2.Len() == 0)
+ // first without fielddelimiter
+ String aField;
+ aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine,m_cFieldDelimiter,'\0');
+ if (aField.Len() == 0 ||
+ (m_cStringDelimiter && m_cStringDelimiter == aField.GetChar(0)))
{
- bNumeric = FALSE;
+ bNumeric = sal_False;
+ if ( m_cStringDelimiter != '\0' )
+ aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
+ else
+ nStartPosFirstLine2 = nStartPosFirstLine;
}
else
{
- bNumeric = TRUE;
- xub_StrLen nDot = 0;
- xub_StrLen nDecimalDelCount = 0;
- for (xub_StrLen j = 0; j < aField2.Len(); j++)
+ String aField2;
+ if ( m_cStringDelimiter != '\0' )
+ aFirstLine.GetTokenSpecial(aField2,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
+ else
+ aField2 = aField;
+
+ if (aField2.Len() == 0)
{
- const sal_Unicode c = aField2.GetChar(j);
- // just digits, decimal- and thousands-delimiter?
- if ( ( !cDecimalDelimiter || c != cDecimalDelimiter ) &&
- ( !cThousandDelimiter || c != cThousandDelimiter ) &&
- !aCharClass.isDigit(aField2,j) &&
- ( j != 0 || (c != '+' && c != '-' ) ) )
- {
- bNumeric = FALSE;
- break;
- }
- if (cDecimalDelimiter && c == cDecimalDelimiter)
- {
- nPrecision = 15; // we have an decimal value
- nScale = 2;
- ++nDecimalDelCount;
- } // if (cDecimalDelimiter && c == cDecimalDelimiter)
- if ( c == '.' )
- ++nDot;
+ bNumeric = sal_False;
}
-
- if (nDecimalDelCount > 1 || nDot > 1 ) // if there is more than one dot it isn't a number
- bNumeric = FALSE;
- if (bNumeric && cThousandDelimiter)
+ else
{
- // is the delimiter correctly given?
- const String aValue = aField2.GetToken(0,cDecimalDelimiter);
- for (sal_Int32 j = aValue.Len() - 4; j >= 0; j -= 4)
+ bNumeric = sal_True;
+ xub_StrLen nDot = 0;
+ xub_StrLen nDecimalDelCount = 0;
+ xub_StrLen nSpaceCount = 0;
+ for (xub_StrLen j = 0; j < aField2.Len(); j++)
{
- const sal_Unicode c = aValue.GetChar(static_cast<sal_uInt16>(j));
- // just digits, decimal- and thousands-delimiter?
- if (c == cThousandDelimiter && j)
+ const sal_Unicode c = aField2.GetChar(j);
+ if ( j == nSpaceCount && m_cFieldDelimiter != 32 && c == 32 )
+ {
+ ++nSpaceCount;
continue;
- else
+ }
+ // just digits, decimal- and thousands-delimiter?
+ if ( ( !cDecimalDelimiter || c != cDecimalDelimiter ) &&
+ ( !cThousandDelimiter || c != cThousandDelimiter ) &&
+ !aCharClass.isDigit(aField2,j) &&
+ ( j != 0 || (c != '+' && c != '-' ) ) )
{
- bNumeric = FALSE;
+ bNumeric = sal_False;
break;
}
+ if (cDecimalDelimiter && c == cDecimalDelimiter)
+ {
+ io_nPrecisions = 15; // we have an decimal value
+ io_nScales = 2;
+ ++nDecimalDelCount;
+ } // if (cDecimalDelimiter && c == cDecimalDelimiter)
+ if ( c == '.' )
+ ++nDot;
}
- }
- // now it still can be a Date-field
- if (!bNumeric)
+ if (nDecimalDelCount > 1 || nDot > 1 ) // if there is more than one dot it isn't a number
+ bNumeric = sal_False;
+ if (bNumeric && cThousandDelimiter)
+ {
+ // 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));
+ // just digits, decimal- and thousands-delimiter?
+ if (c == cThousandDelimiter && j)
+ continue;
+ else
+ {
+ bNumeric = sal_False;
+ break;
+ }
+ }
+ }
+
+ // now also check for a date field
+ if (!bNumeric)
+ {
+ try
+ {
+ nIndex = m_xNumberFormatter->detectNumberFormat(::com::sun::star::util::NumberFormat::ALL,aField2);
+ }
+ catch(Exception&)
+ {
+ }
+ }
+ }
+ }
+ }
+ else if ( io_nType == DataType::DATE || io_nType == DataType::TIMESTAMP || io_nType == DataType::TIME)
+ {
+ String aField;
+ aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine,m_cFieldDelimiter,'\0');
+ if (aField.Len() == 0 ||
+ (m_cStringDelimiter && m_cStringDelimiter == aField.GetChar(0)))
+ {
+ }
+ else
+ {
+ String aField2;
+ if ( m_cStringDelimiter != '\0' )
+ aFirstLine.GetTokenSpecial(aField2,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
+ else
+ aField2 = aField;
+ if (aField2.Len() )
{
try
{
@@ -243,87 +323,83 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
{
if (cDecimalDelimiter)
{
- if(nPrecision)
+ if(io_nPrecisions)
{
- eType = DataType::DECIMAL;
+ io_nType = DataType::DECIMAL;
static const ::rtl::OUString s_sDECIMAL(RTL_CONSTASCII_USTRINGPARAM("DECIMAL"));
- aTypeName = s_sDECIMAL;
+ o_sTypeName = s_sDECIMAL;
}
else
{
- eType = DataType::DOUBLE;
+ io_nType = DataType::DOUBLE;
static const ::rtl::OUString s_sDOUBLE(RTL_CONSTASCII_USTRINGPARAM("DOUBLE"));
- aTypeName = s_sDOUBLE;
+ o_sTypeName = s_sDOUBLE;
}
}
else
- eType = DataType::INTEGER;
+ {
+ io_nType = DataType::INTEGER;
+ io_nPrecisions = 0;
+ io_nScales = 0;
+ }
nFlags = ColumnSearch::BASIC;
}
else
{
-
switch (comphelper::getNumberFormatType(m_xNumberFormatter,nIndex))
{
case NUMBERFORMAT_DATE:
- eType = DataType::DATE;
+ io_nType = DataType::DATE;
{
static const ::rtl::OUString s_sDATE(RTL_CONSTASCII_USTRINGPARAM("DATE"));
- aTypeName = s_sDATE;
+ o_sTypeName = s_sDATE;
}
break;
case NUMBERFORMAT_DATETIME:
- eType = DataType::TIMESTAMP;
+ io_nType = DataType::TIMESTAMP;
{
static const ::rtl::OUString s_sTIMESTAMP(RTL_CONSTASCII_USTRINGPARAM("TIMESTAMP"));
- aTypeName = s_sTIMESTAMP;
+ o_sTypeName = s_sTIMESTAMP;
}
break;
case NUMBERFORMAT_TIME:
- eType = DataType::TIME;
+ io_nType = DataType::TIME;
{
static const ::rtl::OUString s_sTIME(RTL_CONSTASCII_USTRINGPARAM("TIME"));
- aTypeName = s_sTIME;
+ o_sTypeName = s_sTIME;
}
break;
default:
- eType = DataType::VARCHAR;
- nPrecision = 0; // nyi: Data can be longer!
- nScale = 0;
+ io_nType = DataType::VARCHAR;
+ io_nPrecisions = 0; // nyi: Data can be longer!
+ io_nScales = 0;
{
static const ::rtl::OUString s_sVARCHAR(RTL_CONSTASCII_USTRINGPARAM("VARCHAR"));
- aTypeName = s_sVARCHAR;
+ o_sTypeName = s_sVARCHAR;
}
};
nFlags |= ColumnSearch::CHAR;
}
-
- // check if the columname already exists
- String aAlias(aColumnName);
- OSQLColumns::Vector::const_iterator aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
- sal_Int32 nExprCnt = 0;
- while(aFind != m_aColumns->get().end())
+ }
+ else
+ {
+ String aField;
+ aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine,m_cFieldDelimiter,'\0');
+ if (aField.Len() == 0 ||
+ (m_cStringDelimiter && m_cStringDelimiter == aField.GetChar(0)))
{
- (aAlias = aColumnName) += String::CreateFromInt32(++nExprCnt);
- aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
+ if ( m_cStringDelimiter != '\0' )
+ aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
+ else
+ nStartPosFirstLine2 = nStartPosFirstLine;
+ }
+ else
+ {
+ String aField2;
+ if ( m_cStringDelimiter != '\0' )
+ aFirstLine.GetTokenSpecial(aField2,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
}
-
- sdbcx::OColumn* pColumn = new sdbcx::OColumn(aAlias,aTypeName,::rtl::OUString(),::rtl::OUString(),
- ColumnValue::NULLABLE,
- nPrecision,
- nScale,
- eType,
- sal_False,
- sal_False,
- sal_False,
- bCase);
- Reference< XPropertySet> xCol = pColumn;
- m_aColumns->get().push_back(xCol);
- m_aTypes.push_back(eType);
- m_aPrecisions.push_back(nPrecision);
- m_aScales.push_back(nScale);
}
- m_pFileStream->Seek(m_nStartRowFilePos);
}
// -------------------------------------------------------------------------
OFlatTable::OFlatTable(sdbcx::OCollection* _pTables,OFlatConnection* _pConnection,
@@ -531,7 +607,7 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal
*(_rRow->get())[0] = m_nFilePos;
if (!bRetrieveData)
- return TRUE;
+ return sal_True;
if ( m_bNeedToReadLine )
{
sal_Int32 nCurrentPos = 0;
diff --git a/connectivity/source/drivers/flat/ETables.cxx b/connectivity/source/drivers/flat/ETables.cxx
index e709141b52..e709141b52 100644..100755
--- a/connectivity/source/drivers/flat/ETables.cxx
+++ b/connectivity/source/drivers/flat/ETables.cxx
diff --git a/connectivity/source/drivers/flat/Eservices.cxx b/connectivity/source/drivers/flat/Eservices.cxx
index add587953e..a8cddebadf 100644..100755
--- a/connectivity/source/drivers/flat/Eservices.cxx
+++ b/connectivity/source/drivers/flat/Eservices.cxx
@@ -30,13 +30,11 @@
#include "precompiled_connectivity.hxx"
#include "flat/EDriver.hxx"
#include <cppuhelper/factory.hxx>
-#include <osl/diagnose.h>
using namespace connectivity::flat;
using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory;
@@ -49,27 +47,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pT
);
-//***************************************************************************************
-// The prescribed C-Api must be met!
-// It consists of three functions, which must be exported by the Module.
-//---------------------------------------------------------------------------------------
-void REGISTER_PROVIDER(
- const OUString& aServiceImplName,
- const Sequence< OUString>& Services,
- const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
-{
- OUString aMainKeyName;
- aMainKeyName = OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aMainKeyName += aServiceImplName;
- aMainKeyName += OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
-
- Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
- OSL_ENSURE(xNewKey.is(), "FILE::component_writeInfo : could not create a registry key !");
-
- for (sal_Int32 i=0; i<Services.getLength(); ++i)
- xNewKey->createKey(Services[i]);
-}
-
//---------------------------------------------------------------------------------------
struct ProviderRequest
{
@@ -119,31 +96,6 @@ component_getImplementationEnvironment(
}
//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void* /*pServiceManager*/,
- void* pRegistryKey
- )
-{
- if (pRegistryKey)
- try
- {
- Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
-
- REGISTER_PROVIDER(
- ODriver::getImplementationName_Static(),
- ODriver::getSupportedServiceNames_Static(), xKey);
-
- return sal_True;
- }
- catch (::com::sun::star::registry::InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "FILE::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
- }
-
- return sal_False;
-}
-
-//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pServiceManager,
diff --git a/connectivity/source/drivers/flat/exports.dxp b/connectivity/source/drivers/flat/exports.dxp
index 9630d7e067..f0e1c69934 100644..100755
--- a/connectivity/source/drivers/flat/exports.dxp
+++ b/connectivity/source/drivers/flat/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/connectivity/source/drivers/flat/flat.component b/connectivity/source/drivers/flat/flat.component
new file mode 100755
index 0000000000..fe8b79ee73
--- /dev/null
+++ b/connectivity/source/drivers/flat/flat.component
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.sdbc.flat.ODriver">
+ <service name="com.sun.star.sdbc.Driver"/>
+ <service name="com.sun.star.sdbcx.Driver"/>
+ </implementation>
+</component>
diff --git a/connectivity/source/drivers/flat/flat.mxp.map b/connectivity/source/drivers/flat/flat.mxp.map
index 54a8532f78..2737c61b5a 100644..100755
--- a/connectivity/source/drivers/flat/flat.mxp.map
+++ b/connectivity/source/drivers/flat/flat.mxp.map
@@ -1,5 +1,4 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
__mh_dylib_header
___builtin_delete
diff --git a/connectivity/source/drivers/flat/flat.xcu b/connectivity/source/drivers/flat/flat.xcu
index ed29028ea9..ba43121844 100755
--- a/connectivity/source/drivers/flat/flat.xcu
+++ b/connectivity/source/drivers/flat/flat.xcu
@@ -75,8 +75,18 @@
<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="MaxRowScan" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
<node oor:name="UseSQL92NamingConstraints" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
diff --git a/connectivity/source/drivers/flat/flat.xml b/connectivity/source/drivers/flat/flat.xml
index 77b45c48da..77b45c48da 100644..100755
--- a/connectivity/source/drivers/flat/flat.xml
+++ b/connectivity/source/drivers/flat/flat.xml
diff --git a/connectivity/source/drivers/flat/makefile.mk b/connectivity/source/drivers/flat/makefile.mk
index da801c44a8..0fe857919d 100644..100755
--- a/connectivity/source/drivers/flat/makefile.mk
+++ b/connectivity/source/drivers/flat/makefile.mk
@@ -105,3 +105,11 @@ DEF1EXPORTFILE= exports.dxp
.INCLUDE : $(PRJ)$/target.pmk
+
+ALLTAR : $(MISC)/flat.component
+
+$(MISC)/flat.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ flat.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt flat.component