User: obo Date: 2006/07/10 07:24:20 Modified: dba/connectivity/source/drivers/ado/ATables.cxx
Log: INTEGRATION: CWS qiq (1.16.104); FILE MERGED 2006/06/27 14:10:33 fs 1.16.104.2: RESYNC: (1.16-1.17); FILE MERGED 2006/06/16 11:32:32 fs 1.16.104.1: 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) File Changes: Directory: /dba/connectivity/source/drivers/ado/ ================================================ File [changed]: ATables.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/ado/ATables.cxx?r1=1.17&r2=1.18 Delta lines: +17 -22 --------------------- --- ATables.cxx 20 Jun 2006 01:15:36 -0000 1.17 +++ ATables.cxx 10 Jul 2006 14:24:17 -0000 1.18 @@ -72,6 +72,9 @@ #ifndef _CPPUHELPER_INTERFACECONTAINER_H_ #include <cppuhelper/interfacecontainer.h> #endif +#ifndef _DBHELPER_DBEXCEPTION_HXX_ +#include <connectivity/dbexception.hxx> +#endif using namespace ::cppu; using namespace connectivity; @@ -99,24 +102,27 @@ m_pCatalog->refreshTables(); } // ------------------------------------------------------------------------- -Reference< XPropertySet > OTables::createEmptyObject() +Reference< XPropertySet > OTables::createDescriptor() { return new OAdoTable(this,isCaseSensitive(),m_pCatalog); } // ------------------------------------------------------------------------- // XAppend -void OTables::appendObject( const Reference< XPropertySet >& descriptor ) +sdbcx::ObjectType OTables::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor ) { OAdoTable* pTable = NULL; - if(getImplementation(pTable,descriptor) && pTable != NULL) - { + if ( !getImplementation( pTable, descriptor ) || pTable == NULL ) + ::dbtools::throwGenericSQLException( + ::rtl::OUString::createFromAscii( "Could not create table: invalid object descriptor." ), + static_cast<XTypeProvider*>(this) + ); + OSL_ENSURE(m_aCollection.IsValid(),"Collection isn't valid"); if(!m_aCollection.Append(pTable->getImpl())) ADOS::ThrowException(*m_pCatalog->getConnection()->getConnection(),static_cast<XTypeProvider*>(this)); m_aCollection.Refresh(); - } - else - throw SQLException(::rtl::OUString::createFromAscii("Could not append table!"),static_cast<XTypeProvider*>(this),OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_HY0000),1000,Any()); + + return new OAdoTable(this,isCaseSensitive(),m_pCatalog,pTable->getImpl()); } // ------------------------------------------------------------------------- // XDrop @@ -125,17 +131,6 @@ OSL_ENSURE(m_aCollection.IsValid(),"Collection isn't valid"); if ( !m_aCollection.Delete(_sElementName) ) ADOS::ThrowException(*m_pCatalog->getConnection()->getConnection(),static_cast<XTypeProvider*>(this)); -} -// ------------------------------------------------------------------------- -sdbcx::ObjectType OTables::cloneObject(const Reference< XPropertySet >& _xDescriptor) -{ - OAdoTable* pTable = NULL; - if(getImplementation(pTable,_xDescriptor) && pTable != NULL) - { - WpADOTable aTable = pTable->getImpl(); - return new OAdoTable(this,isCaseSensitive(),m_pCatalog,aTable); - } - return sdbcx::ObjectType(); } // ----------------------------------------------------------------------------- void OTables::appendNew(const ::rtl::OUString& _rsNewTable) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
