Tag: cws_src680_dba203c User: oj Date: 06/04/13 00:08:16 Modified: /dba/dbaccess/source/core/api/ KeySet.cxx, KeySet.hxx
Log: #i62797# values from insertrow may have a different type which has to be corrected File Changes: Directory: /dba/dbaccess/source/core/api/ ========================================= File [changed]: KeySet.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/KeySet.cxx?r1=1.59&r2=1.59.104.1 Delta lines: +19 -12 --------------------- --- KeySet.cxx 23 Sep 2005 12:02:11 -0000 1.59 +++ KeySet.cxx 13 Apr 2006 07:08:13 -0000 1.59.104.1 @@ -4,9 +4,9 @@ * * $RCSfile: KeySet.cxx,v $ * - * $Revision: 1.59 $ + * $Revision: 1.59.104.1 $ * - * last change: $Author: hr $ $Date: 2005/09/23 12:02:11 $ + * last change: $Author: oj $ $Date: 2006/04/13 07:08:13 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -533,10 +533,8 @@ m_aKeyIter = m_aKeyMap.find(::comphelper::getINT32((*_rInsertRow)[0].getAny())); OSL_ENSURE(m_aKeyIter != m_aKeyMap.end(),"New inserted row not found!"); m_aKeyIter->second.second = 2; - connectivity::ORowVector< ORowSetValue >::iterator aIter = m_aKeyIter->second.first->begin(); - OColumnNamePos::const_iterator aPosIter = (*m_pKeyColumnNames).begin(); - for(;aPosIter != (*m_pKeyColumnNames).end();++aPosIter,++aIter) - *aIter = (*_rInsertRow)[aPosIter->second.first]; + + copyRowValue(_rInsertRow,m_aKeyIter->second.first); } } // ------------------------------------------------------------------------- @@ -694,11 +692,8 @@ if ( m_bInserted ) { ORowSetRow aKeyRow = new connectivity::ORowVector< ORowSetValue >((*m_pKeyColumnNames).size()); - connectivity::ORowVector< ORowSetValue >::iterator aIter = aKeyRow->begin(); - OColumnNamePos::const_iterator aPosIter = (*m_pKeyColumnNames).begin(); - for(;aPosIter != (*m_pKeyColumnNames).end();++aPosIter,++aIter) - *aIter = (*_rInsertRow)[aPosIter->second.first]; + copyRowValue(_rInsertRow,aKeyRow); OKeySetMatrix::iterator aKeyIter = m_aKeyMap.end(); --aKeyIter; @@ -706,6 +701,18 @@ // now we set the bookmark for this row (*_rInsertRow)[0] = makeAny((sal_Int32)m_aKeyIter->first); } +} +// ----------------------------------------------------------------------------- +void OKeySet::copyRowValue(const ORowSetRow& _rInsertRow,ORowSetRow& _rKeyRow) +{ + connectivity::ORowVector< ORowSetValue >::iterator aIter = _rKeyRow->begin(); + OColumnNamePos::const_iterator aPosIter = (*m_pKeyColumnNames).begin(); + OColumnNamePos::const_iterator aPosEnd = (*m_pKeyColumnNames).end(); + for(;aPosIter != aPosEnd;++aPosIter,++aIter) + { + *aIter = (*_rInsertRow)[aPosIter->second.first]; + aIter->setTypeKind(aPosIter->second.second.first); + } } // ------------------------------------------------------------------------- void SAL_CALL OKeySet::deleteRow(const ORowSetRow& _rDeleteRow,const connectivity::OSQLTable& _xTable ) throw(SQLException, RuntimeException) File [changed]: KeySet.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/KeySet.hxx?r1=1.23&r2=1.23.104.1 Delta lines: +10 -3 -------------------- --- KeySet.hxx 23 Sep 2005 12:02:30 -0000 1.23 +++ KeySet.hxx 13 Apr 2006 07:08:13 -0000 1.23.104.1 @@ -4,9 +4,9 @@ * * $RCSfile: KeySet.hxx,v $ * - * $Revision: 1.23 $ + * $Revision: 1.23.104.1 $ * - * last change: $Author: hr $ $Date: 2005/09/23 12:02:30 $ + * last change: $Author: oj $ $Date: 2006/04/13 07:08:13 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -100,6 +100,13 @@ ::rtl::OUString getComposedTableName( const ::rtl::OUString& _sCatalog, const ::rtl::OUString& _sSchema, const ::rtl::OUString& _sTable); + + /** copies the values from the insert row into the key row + * + * \param _rInsertRow the row which was inserted + * \param _rKeyRow The current key row of the row set. + */ + void copyRowValue(const ORowSetRow& _rInsertRow,ORowSetRow& _rKeyRow); ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > getKeyColumns() const; void fillAllRows(); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
