User: obo Date: 2006/07/10 07:23:15 Modified: dba/connectivity/source/drivers/ado/AColumns.cxx
Log: INTEGRATION: CWS qiq (1.17.104); FILE MERGED 2006/06/27 14:07:07 fs 1.17.104.2: RESYNC: (1.17-1.18); FILE MERGED 2006/06/16 11:32:31 fs 1.17.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]: AColumns.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/ado/AColumns.cxx?r1=1.18&r2=1.19 Delta lines: +56 -59 --------------------- --- AColumns.cxx 20 Jun 2006 01:12:22 -0000 1.18 +++ AColumns.cxx 10 Jul 2006 14:23:13 -0000 1.19 @@ -63,6 +63,9 @@ #ifndef _COMPHELPER_TYPES_HXX_ #include <comphelper/types.hxx> #endif +#ifndef _DBHELPER_DBEXCEPTION_HXX_ +#include <connectivity/dbexception.hxx> +#endif using namespace connectivity::ado; using namespace connectivity; @@ -84,26 +87,29 @@ m_aCollection.Refresh(); } // ------------------------------------------------------------------------- -Reference< XPropertySet > OColumns::createEmptyObject() +Reference< XPropertySet > OColumns::createDescriptor() { return new OAdoColumn(isCaseSensitive(),m_pConnection); } // ------------------------------------------------------------------------- // XAppend -void OColumns::appendObject( const Reference< XPropertySet >& descriptor ) +sdbcx::ObjectType OColumns::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor ) { OAdoColumn* pColumn = NULL; - if(getImplementation(pColumn,descriptor) && pColumn != NULL) - { - WpADOColumn aColumn = pColumn->getColumnImpl(); + if ( !getImplementation( pColumn, descriptor ) || pColumn == NULL ) + ::dbtools::throwGenericSQLException( + ::rtl::OUString::createFromAscii( "Could not append column: invalid column descriptor." ), + static_cast<XTypeProvider*>(this) + ); - #if OSL_DEBUG_LEVEL > 0 + WpADOColumn aColumn = pColumn->getColumnImpl(); DataTypeEnum eType = aColumn.get_Type(); +#if OSL_DEBUG_LEVEL > 0 sal_Int32 nPrecision = aColumn.get_Precision(); (void)nPrecision; sal_Int32 nScale = aColumn.get_NumericScale(); (void)nScale; sal_Int32 nType = ADOS::MapADOType2Jdbc(eType); (void)nType; - #endif +#endif ::rtl::OUString sTypeName; pColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME)) >>= sTypeName; @@ -145,9 +151,8 @@ } } ADOS::ThrowException(*m_pConnection->getConnection(),static_cast<XTypeProvider*>(this)); - } - else - throw SQLException(::rtl::OUString::createFromAscii("Could not append column!"),static_cast<XTypeProvider*>(this),OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_HY0000),1000,Any()); + + return new OAdoColumn(isCaseSensitive(),m_pConnection,pColumn->getColumnImpl()); } // ------------------------------------------------------------------------- // XDrop @@ -155,14 +160,6 @@ { if(!m_aCollection.Delete(_sElementName)) ADOS::ThrowException(*m_pConnection->getConnection(),static_cast<XTypeProvider*>(this)); -} -// ----------------------------------------------------------------------------- -sdbcx::ObjectType OColumns::cloneObject(const Reference< XPropertySet >& _xDescriptor) -{ - OAdoColumn* pColumn = NULL; - if(getImplementation(pColumn,_xDescriptor) && pColumn != NULL) - return new OAdoColumn(isCaseSensitive(),m_pConnection,pColumn->getColumnImpl()); - return sdbcx::ObjectType(); } // ----------------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
