From bf7690bc1b444278bef1e355c7463d27381a8700 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 25 Feb 2016 09:38:09 +0200 Subject: convert EComposeRule to scoped enum Change-Id: I5a2e4f6f6f0f353c75dff85e865608b12c2104f9 --- connectivity/source/commontools/TColumnsHelper.cxx | 4 ++-- connectivity/source/commontools/TIndexes.cxx | 8 ++++---- connectivity/source/commontools/TKeys.cxx | 6 +++--- connectivity/source/commontools/TTableHelper.cxx | 12 ++++++------ connectivity/source/commontools/dbtools.cxx | 14 +++++++------- connectivity/source/commontools/dbtools2.cxx | 6 +++--- connectivity/source/commontools/parameters.cxx | 2 +- connectivity/source/commontools/statementcomposer.cxx | 2 +- 8 files changed, 27 insertions(+), 27 deletions(-) (limited to 'connectivity/source/commontools') diff --git a/connectivity/source/commontools/TColumnsHelper.cxx b/connectivity/source/commontools/TColumnsHelper.cxx index 26ec91946edc..99392e9276ad 100644 --- a/connectivity/source/commontools/TColumnsHelper.cxx +++ b/connectivity/source/commontools/TColumnsHelper.cxx @@ -178,7 +178,7 @@ sdbcx::ObjectType OColumnsHelper::appendObject( const OUString& _rForName, const Reference xMetaData = m_pTable->getConnection()->getMetaData(); OUString aSql = "ALTER TABLE " + - ::dbtools::composeTableName( xMetaData, m_pTable, ::dbtools::eInTableDefinitions, false, false, true ) + + ::dbtools::composeTableName( xMetaData, m_pTable, ::dbtools::EComposeRule::InTableDefinitions, false, false, true ) + " ADD " + ::dbtools::createStandardColumnPart(descriptor,m_pTable->getConnection(),nullptr,m_pTable->getTypeCreatePattern()); @@ -200,7 +200,7 @@ void OColumnsHelper::dropObject(sal_Int32 /*_nPos*/, const OUString& _sElementNa Reference xMetaData = m_pTable->getConnection()->getMetaData(); OUString aQuote = xMetaData->getIdentifierQuoteString( ); OUString aSql = "ALTER TABLE " + - ::dbtools::composeTableName( xMetaData, m_pTable, ::dbtools::eInTableDefinitions, false, false, true ) + + ::dbtools::composeTableName( xMetaData, m_pTable, ::dbtools::EComposeRule::InTableDefinitions, false, false, true ) + " DROP " + ::dbtools::quoteName( aQuote,_sElementName); diff --git a/connectivity/source/commontools/TIndexes.cxx b/connectivity/source/commontools/TIndexes.cxx index 6069bc227e65..f27bc9958f08 100644 --- a/connectivity/source/commontools/TIndexes.cxx +++ b/connectivity/source/commontools/TIndexes.cxx @@ -146,10 +146,10 @@ sdbcx::ObjectType OIndexesHelper::appendObject( const OUString& _rForName, const OUString aCatalog,aSchema,aTable; - dbtools::qualifiedNameComponents(m_pTable->getMetaData(),m_pTable->getName(),aCatalog,aSchema,aTable,::dbtools::eInDataManipulation); + dbtools::qualifiedNameComponents(m_pTable->getMetaData(),m_pTable->getName(),aCatalog,aSchema,aTable,::dbtools::EComposeRule::InDataManipulation); OUString aComposedName; - aComposedName = dbtools::composeTableName(m_pTable->getMetaData(),aCatalog,aSchema,aTable, true, ::dbtools::eInIndexDefinitions); + aComposedName = dbtools::composeTableName(m_pTable->getMetaData(),aCatalog,aSchema,aTable, true, ::dbtools::EComposeRule::InIndexDefinitions); if (!_rForName.isEmpty() ) { aSql.append( ::dbtools::quoteName( aQuote, _rForName ) ); @@ -228,9 +228,9 @@ void OIndexesHelper::dropObject(sal_Int32 /*_nPos*/,const OUString& _sElementNam OUString aSql( "DROP INDEX " ); - OUString aComposedName = dbtools::composeTableName( m_pTable->getMetaData(), m_pTable, ::dbtools::eInIndexDefinitions, false, false, true ); + OUString aComposedName = dbtools::composeTableName( m_pTable->getMetaData(), m_pTable, ::dbtools::EComposeRule::InIndexDefinitions, false, false, true ); OUString sIndexName,sTemp; - sIndexName = dbtools::composeTableName( m_pTable->getMetaData(), sTemp, aSchema, aName, true, ::dbtools::eInIndexDefinitions ); + sIndexName = dbtools::composeTableName( m_pTable->getMetaData(), sTemp, aSchema, aName, true, ::dbtools::EComposeRule::InIndexDefinitions ); aSql += sIndexName + " ON " + aComposedName; diff --git a/connectivity/source/commontools/TKeys.cxx b/connectivity/source/commontools/TKeys.cxx index 3c2639583b0d..d06c91656495 100644 --- a/connectivity/source/commontools/TKeys.cxx +++ b/connectivity/source/commontools/TKeys.cxx @@ -159,7 +159,7 @@ sdbcx::ObjectType OKeysHelper::appendObject( const OUString& _rForName, const Re aSql.append("ALTER TABLE "); OUString aQuote = m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString( ); - aSql.append(composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable, ::dbtools::eInTableDefinitions, false, false, true )); + aSql.append(composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable, ::dbtools::EComposeRule::InTableDefinitions, false, false, true )); aSql.append(" ADD "); if ( nKeyType == KeyType::PRIMARY ) @@ -189,7 +189,7 @@ sdbcx::ObjectType OKeysHelper::appendObject( const OUString& _rForName, const Re if ( nKeyType == KeyType::FOREIGN ) { aSql.append(" REFERENCES "); - aSql.append(::dbtools::quoteTableName(m_pTable->getConnection()->getMetaData(),sReferencedName,::dbtools::eInTableDefinitions)); + aSql.append(::dbtools::quoteTableName(m_pTable->getConnection()->getMetaData(),sReferencedName,::dbtools::EComposeRule::InTableDefinitions)); aSql.append(" ("); for(sal_Int32 i=0;igetCount();++i) @@ -274,7 +274,7 @@ void OKeysHelper::dropObject(sal_Int32 _nPos, const OUString& _sElementName) OUStringBuffer aSql; aSql.append("ALTER TABLE "); - aSql.append( composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable,::dbtools::eInTableDefinitions, false, false, true )); + aSql.append( composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable,::dbtools::EComposeRule::InTableDefinitions, false, false, true )); sal_Int32 nKeyType = KeyType::PRIMARY; if ( xKey.is() ) diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index 95aede3a8005..930b2b0a4f05 100644 --- a/connectivity/source/commontools/TTableHelper.cxx +++ b/connectivity/source/commontools/TTableHelper.cxx @@ -393,7 +393,7 @@ void OTableHelper::refreshForeignKeys(TStringVector& _rNames) if ( pKeyProps.get() ) m_pImpl->m_aKeys.insert(TKeyMap::value_type(sOldFKName,pKeyProps)); - const OUString sReferencedName = ::dbtools::composeTableName(getMetaData(),sCatalog,aSchema,aName,false,::dbtools::eInDataManipulation); + const OUString sReferencedName = ::dbtools::composeTableName(getMetaData(),sCatalog,aSchema,aName,false,::dbtools::EComposeRule::InDataManipulation); pKeyProps.reset(new sdbcx::KeyProperties(sReferencedName,KeyType::FOREIGN,nUpdateRule,nDeleteRule)); pKeyProps->m_aKeyColumnNames.push_back(sForeignKeyColumn); _rNames.push_back(sFkName); @@ -513,13 +513,13 @@ void SAL_CALL OTableHelper::rename( const OUString& newName ) throw(SQLException OUString sSql = getRenameStart(); OUString sCatalog,sSchema,sTable; - ::dbtools::qualifiedNameComponents(getMetaData(),newName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation); + ::dbtools::qualifiedNameComponents(getMetaData(),newName,sCatalog,sSchema,sTable,::dbtools::EComposeRule::InDataManipulation); OUString sComposedName; - sComposedName = ::dbtools::composeTableName(getMetaData(),m_CatalogName,m_SchemaName,m_Name,true,::dbtools::eInDataManipulation); + sComposedName = ::dbtools::composeTableName(getMetaData(),m_CatalogName,m_SchemaName,m_Name,true,::dbtools::EComposeRule::InDataManipulation); sSql += sComposedName + " TO "; - sComposedName = ::dbtools::composeTableName(getMetaData(),sCatalog,sSchema,sTable,true,::dbtools::eInDataManipulation); + sComposedName = ::dbtools::composeTableName(getMetaData(),sCatalog,sSchema,sTable,true,::dbtools::EComposeRule::InDataManipulation); sSql += sComposedName; Reference< XStatement > xStmt = m_pImpl->m_xConnection->createStatement( ); @@ -533,7 +533,7 @@ void SAL_CALL OTableHelper::rename( const OUString& newName ) throw(SQLException OTable_TYPEDEF::rename(newName); } else - ::dbtools::qualifiedNameComponents(getMetaData(),newName,m_CatalogName,m_SchemaName,m_Name,::dbtools::eInTableDefinitions); + ::dbtools::qualifiedNameComponents(getMetaData(),newName,m_CatalogName,m_SchemaName,m_Name,::dbtools::EComposeRule::InTableDefinitions); } Reference< XDatabaseMetaData> OTableHelper::getMetaData() const @@ -562,7 +562,7 @@ void SAL_CALL OTableHelper::alterColumnByIndex( sal_Int32 index, const Reference OUString SAL_CALL OTableHelper::getName() throw(RuntimeException, std::exception) { OUString sComposedName; - sComposedName = ::dbtools::composeTableName(getMetaData(),m_CatalogName,m_SchemaName,m_Name,false,::dbtools::eInDataManipulation); + sComposedName = ::dbtools::composeTableName(getMetaData(),m_CatalogName,m_SchemaName,m_Name,false,::dbtools::EComposeRule::InDataManipulation); return sComposedName; } diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index 16e0b1250f30..e7b11fc3fafc 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -765,26 +765,26 @@ namespace switch ( _eComposeRule ) { - case eInTableDefinitions: + case EComposeRule::InTableDefinitions: pCatalogCall = &XDatabaseMetaData::supportsCatalogsInTableDefinitions; pSchemaCall = &XDatabaseMetaData::supportsSchemasInTableDefinitions; break; - case eInIndexDefinitions: + case EComposeRule::InIndexDefinitions: pCatalogCall = &XDatabaseMetaData::supportsCatalogsInIndexDefinitions; pSchemaCall = &XDatabaseMetaData::supportsSchemasInIndexDefinitions; break; - case eInProcedureCalls: + case EComposeRule::InProcedureCalls: pCatalogCall = &XDatabaseMetaData::supportsCatalogsInProcedureCalls; pSchemaCall = &XDatabaseMetaData::supportsSchemasInProcedureCalls; break; - case eInPrivilegeDefinitions: + case EComposeRule::InPrivilegeDefinitions: pCatalogCall = &XDatabaseMetaData::supportsCatalogsInPrivilegeDefinitions; pSchemaCall = &XDatabaseMetaData::supportsSchemasInPrivilegeDefinitions; break; - case eComplete: + case EComposeRule::Complete: bIgnoreMetaData = true; break; - case eInDataManipulation: + case EComposeRule::InDataManipulation: // already properly set above break; } @@ -1303,7 +1303,7 @@ OUString composeTableNameForSelect( const Reference< XConnection >& _rxConnectio bUseSchemaInSelect ? _rSchema : OUString(), _rName, true, - eInDataManipulation + EComposeRule::InDataManipulation ); } diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx index 1894f531c458..b8a97e78fe13 100644 --- a/connectivity/source/commontools/dbtools2.cxx +++ b/connectivity/source/commontools/dbtools2.cxx @@ -215,7 +215,7 @@ OUString createStandardCreateStatement(const Reference< XPropertySet >& descript descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= sSchema; descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= sTable; - sComposedName = ::dbtools::composeTableName( xMetaData, sCatalog, sSchema, sTable, true, ::dbtools::eInTableDefinitions ); + sComposedName = ::dbtools::composeTableName( xMetaData, sCatalog, sSchema, sTable, true, ::dbtools::EComposeRule::InTableDefinitions ); if ( sComposedName.isEmpty() ) ::dbtools::throwFunctionSequenceException(_xConnection); @@ -329,8 +329,8 @@ OUString createStandardKeyStatement(const Reference< XPropertySet >& descriptor, sCatalog, sSchema, sTable, - ::dbtools::eInDataManipulation); - sComposedName = ::dbtools::composeTableName( xMetaData, sCatalog, sSchema, sTable, true, ::dbtools::eInTableDefinitions ); + ::dbtools::EComposeRule::InDataManipulation); + sComposedName = ::dbtools::composeTableName( xMetaData, sCatalog, sSchema, sTable, true, ::dbtools::EComposeRule::InTableDefinitions ); if ( sComposedName.isEmpty() ) diff --git a/connectivity/source/commontools/parameters.cxx b/connectivity/source/commontools/parameters.cxx index d3e318c9ac15..1f43707fb17b 100644 --- a/connectivity/source/commontools/parameters.cxx +++ b/connectivity/source/commontools/parameters.cxx @@ -219,7 +219,7 @@ namespace dbtools OUString tblName; xDetailField->getPropertyValue("TableName") >>= tblName; if (!tblName.isEmpty()) - sFilter = ::dbtools::quoteTableName( m_xConnectionMetadata, tblName, ::dbtools::eInDataManipulation ) + "."; + sFilter = ::dbtools::quoteTableName( m_xConnectionMetadata, tblName, ::dbtools::EComposeRule::InDataManipulation ) + "."; } { OUString colName; diff --git a/connectivity/source/commontools/statementcomposer.cxx b/connectivity/source/commontools/statementcomposer.cxx index 376811c5833a..8c67142f721e 100644 --- a/connectivity/source/commontools/statementcomposer.cxx +++ b/connectivity/source/commontools/statementcomposer.cxx @@ -126,7 +126,7 @@ namespace dbtools sStatement = "SELECT * FROM "; OUString sCatalog, sSchema, sTable; - qualifiedNameComponents( _rData.xConnection->getMetaData(), _rData.sCommand, sCatalog, sSchema, sTable, eInDataManipulation ); + qualifiedNameComponents( _rData.xConnection->getMetaData(), _rData.sCommand, sCatalog, sSchema, sTable, EComposeRule::InDataManipulation ); sStatement += composeTableNameForSelect( _rData.xConnection, sCatalog, sSchema, sTable ); } -- cgit