User: rt Date: 06/05/04 01:35:51 Modified: /dba/dbaccess/source/core/api/ KeySet.cxx
Log: INTEGRATION: CWS dba203c (1.59.104); FILE MERGED 2006/04/13 07:08:13 oj 1.59.104.1: #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.60 Delta lines: +16 -9 -------------------- --- KeySet.cxx 23 Sep 2005 12:02:11 -0000 1.59 +++ KeySet.cxx 4 May 2006 08:35:48 -0000 1.60 @@ -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) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
