User: obo     
Date: 2006/07/10 08:07:27

Modified:
   dba/dbaccess/source/core/api/tablecontainer.cxx

Log:
 INTEGRATION: CWS qiq (1.60.124); FILE MERGED
 2006/06/27 11:59:33 fs 1.60.124.5: RESYNC: (1.60-1.61); FILE MERGED
 2006/06/16 11:47:37 fs 1.60.124.4: 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/31 11:05:14 fs 1.60.124.3: ObjectNameApproval now always throwing an 
SQLException
 2006/05/30 12:56:20 fs 1.60.124.2: #i51143# use an ObjectNameApproval in 
appendObject, to verify the name against existing query names (if the 
connection supports queries in queries)
 2006/05/24 06:40:21 fs 1.60.124.1: some refactoring of compose/quoteTableName 
and friends, in preparation of #i51143#

File Changes:

Directory: /dba/dbaccess/source/core/api/
=========================================

File [changed]: tablecontainer.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/tablecontainer.cxx?r1=1.61&r2=1.62
Delta lines:  +46 -37
---------------------
--- tablecontainer.cxx  20 Jun 2006 02:41:59 -0000      1.61
+++ tablecontainer.cxx  10 Jul 2006 15:07:25 -0000      1.62
@@ -60,6 +60,9 @@
 #ifndef _DBA_CORE_RESOURCE_HRC_
 #include "core_resource.hrc"
 #endif
+#ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_
+#include <com/sun/star/sdb/CommandType.hpp>
+#endif
 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
 #include <com/sun/star/beans/XPropertySet.hpp>
 #endif
@@ -117,6 +120,9 @@
 #ifndef _DBACORE_DEFINITIONCOLUMN_HXX_
 #include "definitioncolumn.hxx"
 #endif
+#ifndef DBACCESS_OBJECTNAMEAPPROVAL_HXX
+#include "objectnameapproval.hxx"
+#endif
 #ifndef _STRING_HXX
 #include <tools/string.hxx>
 #endif
@@ -342,7 +348,7 @@
        return xRet;
 }
 // 
-----------------------------------------------------------------------------
-Reference< XPropertySet > OTableContainer::createEmptyObject()
+Reference< XPropertySet > OTableContainer::createDescriptor()
 {
        Reference< XPropertySet > xRet;
 
@@ -367,7 +373,7 @@
 }
 // 
-----------------------------------------------------------------------------
 // XAppend
-void OTableContainer::appendObject( const Reference< XPropertySet >& 
descriptor )
+ObjectType OTableContainer::appendObject( const ::rtl::OUString& _rForName, 
const Reference< XPropertySet >& descriptor )
 {
        // append the new table with a create stmt
        ::rtl::OUString aName = 
getString(descriptor->getPropertyValue(PROPERTY_NAME));
@@ -378,6 +384,10 @@
                throw 
SQLException(sMessage,static_cast<XTypeProvider*>(static_cast<OFilteredContainer*>(this)),SQLSTATE_GENERAL,1000,Any());
        }
 
+    Reference< XConnection > xConnection( m_xConnection.get(), UNO_QUERY );
+    PContainerApprove pApprove( new ObjectNameApproval( xConnection, 
ObjectNameApproval::TypeTable ) );
+    pApprove->approveElement( aName, descriptor );
+
        m_bInAppend = sal_True;
        try
        {
@@ -390,7 +400,6 @@
                {
                        ::rtl::OUString aSql = 
::dbtools::createSqlCreateTableStatement(descriptor,m_xConnection);
 
-                       
                        Reference<XConnection> xCon = m_xConnection;
                        OSL_ENSURE(xCon.is(),"Connection is null!");
                        if ( xCon.is() )
@@ -408,10 +417,9 @@
                throw;
        }
        m_bInAppend = sal_False;
+
        Reference<XPropertySet> xTableDefinition;
        Reference<XNameAccess> xColumnDefinitions;
-       if ( descriptor.is() )
-       {
                
lcl_createDefintionObject(getNameForObject(descriptor),m_xTableDefinitions,xTableDefinition,xColumnDefinitions,sal_False);
                Reference<XColumnsSupplier> xSup(descriptor,UNO_QUERY);
                Reference<XDataDescriptorFactory> 
xFac(xColumnDefinitions,UNO_QUERY);
@@ -453,7 +461,8 @@
                Sequence< ::rtl::OUString> 
aNames(s_pTableProps,sizeof(s_pTableProps)/sizeof(s_pTableProps[0]));
                if ( bModified || 
!lcl_isPropertySetDefaulted(aNames,xTableDefinition) )
                        
::dbaccess::notifyDataSourceModified(m_xTableDefinitions,sal_True);
-       }
+
+    return createObject( _rForName );
 }
 // -------------------------------------------------------------------------
 // XDrop
@@ -479,7 +488,7 @@
                                        
xTable->getPropertyValue(PROPERTY_SCHEMANAME)   >>= sSchema;
                                xTable->getPropertyValue(PROPERTY_NAME)         
        >>= sTable;
 
-                               
::dbtools::composeTableName(m_xMetaData,sCatalog,sSchema,sTable,sComposedName,sal_True,::dbtools::eInTableDefinitions);
+                               sComposedName = ::dbtools::composeTableName( 
m_xMetaData, sCatalog, sSchema, sTable, sal_True, 
::dbtools::eInTableDefinitions );
 
                                ::rtl::OUString sType;
                                xTable->getPropertyValue(PROPERTY_TYPE)         
        >>= sType;




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

Reply via email to