diff options
author | Rüdiger Timm <rt@openoffice.org> | 2003-04-24 14:18:23 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2003-04-24 14:18:23 +0000 |
commit | c8323184ecc8f9fc4e978b45a4ad8fc35bfcd940 (patch) | |
tree | e7036962c2a0a17f6c9dbe7664c4c4d0736f800d /connectivity | |
parent | d287a8893562af7c8a9a475f2e938c0ce02280ea (diff) |
INTEGRATION: CWS sb4 (1.12.58); FILE MERGED
2003/04/23 09:49:06 oj 1.12.58.1: #109043# check if append was okay and then add properties
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/ado/AColumns.cxx | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/connectivity/source/drivers/ado/AColumns.cxx b/connectivity/source/drivers/ado/AColumns.cxx index f35a332683e6..8fce661ef86c 100644 --- a/connectivity/source/drivers/ado/AColumns.cxx +++ b/connectivity/source/drivers/ado/AColumns.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AColumns.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: oj $ $Date: 2002-11-29 12:24:19 $ + * last change: $Author: rt $ $Date: 2003-04-24 15:18:23 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -143,20 +143,23 @@ void OColumns::appendObject( const Reference< XPropertySet >& descriptor ) if ( pTypeInfo && static_cast<DataTypeEnum>(pTypeInfo->eType) != eType ) // change column type if necessary aColumn.put_Type(static_cast<DataTypeEnum>(pTypeInfo->eType)); - ((ADOColumns*)m_aCollection)->Append(OLEVariant(aColumn.get_Name()),aColumn.get_Type(),aColumn.get_DefinedSize()); - WpADOColumn aAddedColumn = m_aCollection.GetItem(OLEVariant(aColumn.get_Name())); - - sal_Bool bAutoIncrement = sal_False; - pColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT)) >>= bAutoIncrement; - if ( bAutoIncrement ) - OTools::putValue( aAddedColumn.get_Properties(), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Autoincrement")), bAutoIncrement ); - - aAddedColumn.put_Precision(aColumn.get_Precision()); - aAddedColumn.put_NumericScale(aColumn.get_NumericScale()); - aAddedColumn.put_Attributes(aColumn.get_Attributes()); - aAddedColumn.put_SortOrder(aColumn.get_SortOrder()); - aAddedColumn.put_RelatedColumn(aColumn.get_RelatedColumn()); + if ( SUCCEEDED(((ADOColumns*)m_aCollection)->Append(OLEVariant(aColumn.get_Name()),aColumn.get_Type(),aColumn.get_DefinedSize())) ) + { + WpADOColumn aAddedColumn = m_aCollection.GetItem(OLEVariant(aColumn.get_Name())); + if ( aAddedColumn.IsValid() ) + { + sal_Bool bAutoIncrement = sal_False; + pColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT)) >>= bAutoIncrement; + if ( bAutoIncrement ) + OTools::putValue( aAddedColumn.get_Properties(), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Autoincrement")), bAutoIncrement ); + aAddedColumn.put_Precision(aColumn.get_Precision()); + aAddedColumn.put_NumericScale(aColumn.get_NumericScale()); + aAddedColumn.put_Attributes(aColumn.get_Attributes()); + aAddedColumn.put_SortOrder(aColumn.get_SortOrder()); + aAddedColumn.put_RelatedColumn(aColumn.get_RelatedColumn()); + } + } ADOS::ThrowException(*m_pConnection->getConnection(),*this); } else |