Tag: cws_src680_dba24 User: fs Date: 05/02/10 08:56:14 Modified: /dba/dbaccess/source/core/dataaccess/ datasource.cxx
Log: #i15113# two more known data source settings: TableTypeFilterMode and RespectDriverResultSetType File Changes: Directory: /dba/dbaccess/source/core/dataaccess/ ================================================ File [changed]: datasource.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/datasource.cxx?r1=1.53.2.1&r2=1.53.2.2 Delta lines: +46 -40 --------------------- --- datasource.cxx 4 Feb 2005 14:16:16 -0000 1.53.2.1 +++ datasource.cxx 10 Feb 2005 16:56:11 -0000 1.53.2.2 @@ -2,9 +2,9 @@ * * $RCSfile: datasource.cxx,v $ * - * $Revision: 1.53.2.1 $ + * $Revision: 1.53.2.2 $ * - * last change: $Author: oj $ $Date: 2005/02/04 14:16:16 $ + * last change: $Author: fs $ $Date: 2005/02/10 16:56:11 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -436,61 +436,67 @@ namespace { - Sequence< PropertyValue > lcl_filterDriverProperties(const Reference< XDriver >& _xDriver,const ::rtl::OUString& _sUrl,const Sequence< PropertyValue >& _aInfo) + Sequence< PropertyValue > lcl_filterDriverProperties(const Reference< XDriver >& _xDriver,const ::rtl::OUString& _sUrl,const Sequence< PropertyValue >& _rDataSourceSettings) { if ( _xDriver.is() ) { - Sequence< DriverPropertyInfo > aDriverInfo(_xDriver->getPropertyInfo(_sUrl,_aInfo)); - const char* pProperties[] = { - "JavaDriverClass","Extension" - ,"CharSet","HeaderLine" - ,"FieldDelimiter","StringDelimiter" - ,"DecimalDelimiter","ThousandDelimiter" - ,"ShowDeleted","IgnoreDriverPrivileges" - ,"NoNameLengthLimit","SystemDriverSettings" - ,"EnableSQL92Check","AutoIncrementCreation" - ,"AutoRetrievingStatement","IsAutoRetrievingEnabled" - ,"HostName","PortNumber" - ,"AppendTableAliasName","IgnoreDriverPrivileges" - ,"ParameterNameSubstitution","BooleanComparisonMode" - ,"ShutdownDatabase","DataCacheSizeIncrement" - ,"DataCacheSize","ControlUser" - ,"ControlPassword","UseCatalog" - ,"BaseDN","MaxRowCount","SuppressVersionColumns" - ,"FixedLength","AddIndexAppendix" - ,"UseSchemaInSelect","UseCatalogInSelect" + Sequence< DriverPropertyInfo > aDriverInfo(_xDriver->getPropertyInfo(_sUrl,_rDataSourceSettings)); + const char* pKnownSettings[] = { + // known JDBC settings + "JavaDriverClass", + // known settings for file-based drivers + "Extension", "CharSet", "HeaderLine", + "FieldDelimiter", "StringDelimiter", "DecimalDelimiter", + "ThousandDelimiter", "ShowDeleted", + // known ODBC settings + "SystemDriverSettings", "UseCatalog", + // settings related to auto increment handling + "AutoIncrementCreation", "AutoRetrievingStatement", "IsAutoRetrievingEnabled", + // known Adabas driver setting + "ShutdownDatabase", "DataCacheSizeIncrement", "DataCacheSize", + "ControlUser", "ControlPassword", + // known LDAP driver settings + "HostName", "PortNumber", "BaseDN", "MaxRowCount" + // misc known driver settings + "ParameterNameSubstitution", "AddIndexAppendix", + // known SDB level settings + "IgnoreDriverPrivileges", "NoNameLengthLimit", "AppendTableAliasName", + "EnableSQL92Check", "BooleanComparisonMode", "TableTypeFilterMode", + "RespectDriverResultSetType", "UseSchemaInSelect", "UseCatalogInSelect" }; - sal_Int32 nCount = sizeof(pProperties) / sizeof(pProperties[0]); + sal_Int32 nKnownSettings = sizeof(pKnownSettings) / sizeof(pKnownSettings[0]); - const PropertyValue* pSupported = _aInfo.getConstArray(); - const PropertyValue* pEnd = pSupported + _aInfo.getLength(); + const PropertyValue* pDataSourceSetting = _rDataSourceSettings.getConstArray(); + const PropertyValue* pEnd = pDataSourceSetting + _rDataSourceSettings.getLength(); ::std::vector< PropertyValue > aRet; - for ( ; pSupported != pEnd ; ++pSupported) + for ( ; pDataSourceSetting != pEnd ; ++pDataSourceSetting ) { - sal_Bool bFound = sal_False; + sal_Bool bAllowSetting = sal_False; sal_Int32 i; - for (i=0; i < nCount; ++i) + for ( i=0; i < nKnownSettings; ++i ) { - if ( !pSupported->Name.compareToAscii(pProperties[i]) ) - { - const DriverPropertyInfo* pDriverInfoIter = aDriverInfo.getConstArray(); - const DriverPropertyInfo* pDriverInfoEnd = pDriverInfoIter + aDriverInfo.getLength(); - for ( ; pDriverInfoIter != pDriverInfoEnd ; ++pDriverInfoIter) - { - if ( !pDriverInfoIter->Name.compareToAscii(pProperties[i]) ) - { - bFound = sal_True; + if ( !pDataSourceSetting->Name.compareToAscii( pKnownSettings[i] ) ) + { // the particular setting is known + + const DriverPropertyInfo* pAllowedDriverSetting = aDriverInfo.getConstArray(); + const DriverPropertyInfo* pDriverSettingsEnd = pAllowedDriverSetting + aDriverInfo.getLength(); + for ( ; pAllowedDriverSetting != pDriverSettingsEnd; ++pAllowedDriverSetting ) + { + if ( !pAllowedDriverSetting->Name.compareToAscii( pKnownSettings[i] ) ) + { // the driver also allows this setting + bAllowSetting = sal_True; break; } } break; } } - if ( bFound || i == nCount) - { - aRet.push_back( *pSupported ); + if ( bAllowSetting || ( i == nKnownSettings ) ) + { // if the driver allows this particular setting, or if the setting is completely unknown, + // we pass it to the driver + aRet.push_back( *pDataSourceSetting ); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
