User: obo     
Date: 2006/07/10 07:19:11

Modified:
   dba/connectivity/source/commontools/TIndexes.cxx

Log:
 INTEGRATION: CWS qiq (1.7.104); FILE MERGED
 2006/06/27 13:56:11 fs 1.7.104.3: RESYNC: (1.7-1.8); FILE MERGED
 2006/06/16 11:32:29 fs 1.7.104.2: 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:24:21 fs 1.7.104.1: some refactoring of compose/quoteTableName 
and friends, in preparation of #i51143#

File Changes:

Directory: /dba/connectivity/source/commontools/
================================================

File [changed]: TIndexes.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/TIndexes.cxx?r1=1.8&r2=1.9
Delta lines:  +69 -71
---------------------
--- TIndexes.cxx        20 Jun 2006 01:04:04 -0000      1.8
+++ TIndexes.cxx        10 Jul 2006 14:19:09 -0000      1.9
@@ -147,21 +147,18 @@
        m_pTable->refreshIndexes();
 }
 // -------------------------------------------------------------------------
-Reference< XPropertySet > OIndexesHelper::createEmptyObject()
+Reference< XPropertySet > OIndexesHelper::createDescriptor()
 {
        return new OIndexHelper(m_pTable);
 }
 // -------------------------------------------------------------------------
 // XAppend
-void OIndexesHelper::appendObject( const Reference< XPropertySet >& descriptor 
)
+sdbcx::ObjectType OIndexesHelper::appendObject( const ::rtl::OUString& 
_rForName, const Reference< XPropertySet >& descriptor )
 {
-       ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
-       ::rtl::OUString aName = 
comphelper::getString(descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)));
-       if ( m_pElements->exists(aName) )
-               throw 
ElementExistException(aName,static_cast<XTypeProvider*>(this));
+       if ( m_pTable->isNew() )
+        return cloneDescriptor( descriptor );
 
-       if(!m_pTable->isNew())
-       {
+       ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
         ::rtl::OUStringBuffer aSql( 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CREATE ")));
                ::rtl::OUString aQuote  = 
m_pTable->getMetaData()->getIdentifierQuoteString(  );
                ::rtl::OUString aDot    = ::rtl::OUString::createFromAscii(".");
@@ -175,10 +172,10 @@
                
dbtools::qualifiedNameComponents(m_pTable->getMetaData(),m_pTable->getName(),aCatalog,aSchema,aTable,::dbtools::eInDataManipulation);
                ::rtl::OUString aComposedName;
 
-               
dbtools::composeTableName(m_pTable->getMetaData(),aCatalog,aSchema,aTable,aComposedName,sal_True,::dbtools::eInIndexDefinitions);
-               if ( aName.getLength() )
+       aComposedName = 
dbtools::composeTableName(m_pTable->getMetaData(),aCatalog,aSchema,aTable,sal_True,::dbtools::eInIndexDefinitions);
+       if ( _rForName.getLength() )
                {
-                       aSql.append(::dbtools::quoteName( aQuote,aName ));
+               aSql.append( ::dbtools::quoteName( aQuote, _rForName ) );
             aSql.appendAscii(" ON ");
                        aSql.append(aComposedName);
                        aSql.appendAscii(" ( ");
@@ -229,7 +226,8 @@
                        xStmt->execute(sSql);
                        ::comphelper::disposeComponent(xStmt);
                }
-       }
+
+    return createObject( _rForName );
 }
 // -------------------------------------------------------------------------
 // XDrop
@@ -245,9 +243,9 @@
 
                ::rtl::OUString aSql    = 
::rtl::OUString::createFromAscii("DROP INDEX ");
 
-               ::rtl::OUString aComposedName = 
dbtools::composeTableName(m_pTable->getMetaData(),m_pTable,sal_True,::dbtools::eInIndexDefinitions);
+               ::rtl::OUString aComposedName = dbtools::composeTableName( 
m_pTable->getMetaData(), m_pTable, ::dbtools::eInIndexDefinitions, false, 
false, true );
                ::rtl::OUString sIndexName,sTemp;
-               
dbtools::composeTableName(m_pTable->getMetaData(),sTemp,aSchema,aName,sIndexName,sal_True,::dbtools::eInIndexDefinitions,sal_True,sal_True);
+               sIndexName = dbtools::composeTableName( 
m_pTable->getMetaData(), sTemp, aSchema, aName, sal_True, 
::dbtools::eInIndexDefinitions );
 
                aSql += sIndexName
                                + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" 
ON "))




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to