summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/misc/dsmeta.cxx
diff options
context:
space:
mode:
authorFrank Schönheit <frank.schoenheit@sun.com>2009-10-16 14:16:52 +0200
committerFrank Schönheit <frank.schoenheit@sun.com>2009-10-16 14:16:52 +0200
commitb1eb3409755926b211cbf43f81417bf2bed1c321 (patch)
tree9a69324e73892c7a3ef7f05498a330589023341b /dbaccess/source/ui/misc/dsmeta.cxx
parent04fb2a0047071a6d2ca76eff480a7ce1929d2ebb (diff)
#i104329# introduce a dedicated PrimaryKeySupport property at DataSource.Settings, which determines whether a data source should (be assumed to) support primary keys. Valid values are TRUE (=> supports), FALSE (=> doesn't support) and VOID (=> use the old heuristics, i.e. consult XDatabaseMetaData.supportsCoreSQLGrammar)
Diffstat (limited to 'dbaccess/source/ui/misc/dsmeta.cxx')
-rw-r--r--dbaccess/source/ui/misc/dsmeta.cxx40
1 files changed, 9 insertions, 31 deletions
diff --git a/dbaccess/source/ui/misc/dsmeta.cxx b/dbaccess/source/ui/misc/dsmeta.cxx
index 847bc8799..6c9b1442c 100644
--- a/dbaccess/source/ui/misc/dsmeta.cxx
+++ b/dbaccess/source/ui/misc/dsmeta.cxx
@@ -47,32 +47,6 @@ namespace dbaui
using namespace ::com::sun::star;
/** === end UNO using === **/
- struct InitAdvanced : public AdvancedSettingsSupport
- {
- enum Special { All, AllButIgnoreCurrency, None };
-
- InitAdvanced( Special _eType )
- :AdvancedSettingsSupport()
- {
- bGeneratedValues = ( _eType == All ) || ( _eType == AllButIgnoreCurrency );
- bUseSQL92NamingConstraints = ( _eType == All ) || ( _eType == AllButIgnoreCurrency );
- bAppendTableAliasInSelect = ( _eType == All ) || ( _eType == AllButIgnoreCurrency );
- bUseKeywordAsBeforeAlias = ( _eType == All ) || ( _eType == AllButIgnoreCurrency );
- bUseBracketedOuterJoinSyntax = ( _eType == All ) || ( _eType == AllButIgnoreCurrency );
- bIgnoreDriverPrivileges = ( _eType == All ) || ( _eType == AllButIgnoreCurrency );
- bParameterNameSubstitution = ( _eType == All ) || ( _eType == AllButIgnoreCurrency );
- bDisplayVersionColumns = ( _eType == All ) || ( _eType == AllButIgnoreCurrency );
- bUseCatalogInSelect = ( _eType == All ) || ( _eType == AllButIgnoreCurrency );
- bUseSchemaInSelect = ( _eType == All ) || ( _eType == AllButIgnoreCurrency );
- bUseIndexDirectionKeyword = ( _eType == All ) || ( _eType == AllButIgnoreCurrency );
- bUseDOSLineEnds = ( _eType == All ) || ( _eType == AllButIgnoreCurrency );
- bBooleanComparisonMode = ( _eType == All ) || ( _eType == AllButIgnoreCurrency );
- bFormsCheckRequiredFields = ( _eType == All ) || ( _eType == AllButIgnoreCurrency );
- bIgnoreCurrency = ( _eType == All );
- bEscapeDateTime = ( _eType == All ) || ( _eType == AllButIgnoreCurrency );
- }
- };
-
struct FeatureSupport
{
// authentication mode of the data source
@@ -105,7 +79,7 @@ namespace dbaui
const ::rtl::OUString* pEnd = pIter + aURLs.getLength();
for(;pIter != pEnd;++pIter)
{
- InitAdvanced aInit(InitAdvanced::None);
+ AdvancedSettingsSupport aInit;
const uno::Sequence< beans::NamedValue> aProperties = aDriverConfig.getFeatures(*pIter).getNamedValues();
const beans::NamedValue* pPropertiesIter = aProperties.getConstArray();
const beans::NamedValue* pPropertiesEnd = pPropertiesIter + aProperties.getLength();
@@ -175,10 +149,14 @@ namespace dbaui
{
pPropertiesIter->Value >>= aInit.bEscapeDateTime;
}
- } // for (;pPropertiesIter != pPropertiesEnd ; ++pPropertiesIter)
+ else if ( pPropertiesIter->Name.equalsAscii("PrimaryKeySupport") )
+ {
+ pPropertiesIter->Value >>= aInit.bPrimaryKeySupport;
+ }
+ }
s_aSupport.insert(AdvancedSupport::value_type(*pIter,aInit));
}
- } // if ( s_aSupport.empty() )
+ }
OSL_ENSURE(s_aSupport.find(_sURL) != s_aSupport.end(),"Illegal URL!");
return s_aSupport[ _sURL ];
}
@@ -208,8 +186,8 @@ namespace dbaui
aInit = AuthPwd;
}
s_aSupport.insert(Supported::value_type(*pIter,aInit));
- } // for(;pIter != pEnd;++pIter)
- } // if ( s_aSupport.empty() )
+ }
+ }
OSL_ENSURE(s_aSupport.find(_sURL) != s_aSupport.end(),"Illegal URL!");
return s_aSupport[ _sURL ].eAuthentication;
}