User: obo Date: 2006/07/10 07:20:48 Modified: dba/connectivity/source/commontools/dbtools2.cxx
Log: INTEGRATION: CWS qiq (1.15.38); FILE MERGED 2006/06/27 13:58:19 fs 1.15.38.4: RESYNC: (1.15-1.16); FILE MERGED 2006/06/16 11:32:29 fs 1.15.38.3: during #i51143#: refactored VCollection: - createEmptyObject now named createDescriptor - cloneObject removed - appendObject now returns the newly created object (previously done via a subsequent call to cloneObject) 2006/05/23 13:22:46 fs 1.15.38.2: some refactoring of compose/quoteTableName and friends, in preparation of #i51143# 2006/05/10 10:50:41 fs 1.15.38.1: some assertion to detect some problems earlier File Changes: Directory: /dba/connectivity/source/commontools/ ================================================ File [changed]: dbtools2.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/dbtools2.cxx?r1=1.16&r2=1.17 Delta lines: +25 -54 --------------------- --- dbtools2.cxx 20 Jun 2006 01:06:16 -0000 1.16 +++ dbtools2.cxx 10 Jul 2006 14:20:45 -0000 1.17 @@ -229,7 +229,7 @@ descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= sSchema; descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= sTable; - ::dbtools::composeTableName(xMetaData,sCatalog,sSchema,sTable,sComposedName,sal_True,::dbtools::eInTableDefinitions); + sComposedName = ::dbtools::composeTableName( xMetaData, sCatalog, sSchema, sTable, sal_True, ::dbtools::eInTableDefinitions ); if ( !sComposedName.getLength() ) ::dbtools::throwFunctionSequenceException(_xConnection); @@ -346,7 +346,7 @@ sSchema, sTable, ::dbtools::eInDataManipulation); - ::dbtools::composeTableName(xMetaData,sCatalog, sSchema, sTable,sComposedName,sal_True,::dbtools::eInTableDefinitions); + sComposedName = ::dbtools::composeTableName( xMetaData, sCatalog, sSchema, sTable, sal_True, ::dbtools::eInTableDefinitions ); if ( !sComposedName.getLength() ) @@ -446,9 +446,8 @@ const ::rtl::OUString sQuote = xMetaData->getIdentifierQuoteString(); ::rtl::OUString sQuotedName = ::dbtools::quoteName(sQuote,_rName); ::rtl::OUString sComposedName; - sal_Bool bUseCatalogInSelect = isDataSourcePropertyEnabled(_xConnection,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UseCatalogInSelect")),sal_True); - sal_Bool bUseSchemaInSelect = isDataSourcePropertyEnabled(_xConnection,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UseSchemaInSelect")),sal_True); - ::dbtools::composeTableName(xMetaData,getString(_aCatalog),_aSchema,_aTable,sComposedName,sal_True,::dbtools::eInDataManipulation,bUseCatalogInSelect,bUseSchemaInSelect); + sComposedName = composeTableNameForSelect( + _xConnection, getString( _aCatalog ), _aSchema, _aTable ); ColumnInformationMap aInfo(_bCase); collectColumnInformation(_xConnection,sComposedName,sQuotedName,aInfo); @@ -565,34 +564,6 @@ return xProp; } // ----------------------------------------------------------------------------- -::rtl::OUString composeTableName(const Reference<XDatabaseMetaData>& _xMetaData, - const Reference<XPropertySet>& _xTable, - sal_Bool _bQuote, - EComposeRule _eComposeRule - , sal_Bool _bUseCatalogInSelect - , sal_Bool _bUseSchemaInSelect) -{ - ::rtl::OUString aComposedName; - ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap(); - Reference< XPropertySetInfo > xInfo = _xTable->getPropertySetInfo(); - if ( xInfo.is() - && xInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)) - && xInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) - && xInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) ) - { - - ::rtl::OUString aCatalog; - ::rtl::OUString aSchema; - ::rtl::OUString aTable; - _xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)) >>= aCatalog; - _xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= aSchema; - _xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= aTable; - - dbtools::composeTableName(_xMetaData,aCatalog,aSchema,aTable,aComposedName,_bQuote,_eComposeRule,_bUseCatalogInSelect,_bUseSchemaInSelect); - } - return aComposedName; -} -// ----------------------------------------------------------------------------- sal_Bool isDataSourcePropertyEnabled(const Reference<XInterface>& _xProp,const ::rtl::OUString& _sProperty,sal_Bool _bDefault) { sal_Bool bEnabled = _bDefault; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
