Tag: cws_src680_stlusagefix01 User: oj Date: 06/01/16 05:47:19 Modified: /dba/dbaccess/source/core/api/ CRowSetColumn.cxx, CRowSetColumn.hxx, CRowSetDataColumn.cxx, CRowSetDataColumn.hxx, RowSet.cxx, RowSetBase.cxx, RowSetBase.hxx, RowSetCache.cxx, RowSetCache.hxx, RowSetCacheIterator.cxx, RowSetCacheIterator.hxx
Log: #i60480# fix stl usage File Changes: Directory: /dba/dbaccess/source/core/api/ ========================================= File [changed]: CRowSetColumn.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/CRowSetColumn.cxx?r1=1.13&r2=1.13.16.1 Delta lines: +4 -4 ------------------- --- CRowSetColumn.cxx 19 Dec 2005 17:13:03 -0000 1.13 +++ CRowSetColumn.cxx 16 Jan 2006 13:47:15 -0000 1.13.16.1 @@ -4,9 +4,9 @@ * * $RCSfile: CRowSetColumn.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.13.16.1 $ * - * last change: $Author: obo $ $Date: 2005/12/19 17:13:03 $ + * last change: $Author: oj $ $Date: 2006/01/16 13:47:15 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -149,7 +149,7 @@ OColumnSettings::getFastPropertyValue( rValue, nHandle ); break; case PROPERTY_ID_VALUE: - if(!m_aColumnValue.isNull() && m_aColumnValue != m_rEnd && (*m_aColumnValue).isValid()) + if ( !m_aColumnValue.isNull() && (*m_aColumnValue).isValid() ) rValue = (*(*m_aColumnValue))[m_nPos].makeAny(); break; default: File [changed]: CRowSetColumn.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/CRowSetColumn.hxx?r1=1.8&r2=1.8.16.1 Delta lines: +5 -6 ------------------- --- CRowSetColumn.hxx 19 Dec 2005 17:13:18 -0000 1.8 +++ CRowSetColumn.hxx 16 Jan 2006 13:47:15 -0000 1.8.16.1 @@ -4,9 +4,9 @@ * * $RCSfile: CRowSetColumn.hxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.8.16.1 $ * - * last change: $Author: obo $ $Date: 2005/12/19 17:13:18 $ + * last change: $Author: oj $ $Date: 2006/01/16 13:47:15 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -63,9 +63,8 @@ sal_Int32 _nPos, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxDBMeta, const ::rtl::OUString& _rDescription, - ORowSetCacheIterator& _rColumnValue, - ORowSetMatrix::iterator& _rEnd) - : ORowSetDataColumn(_xMetaData,_xRow,NULL,_nPos,_rxDBMeta,_rDescription,_rColumnValue,_rEnd) + ORowSetCacheIterator& _rColumnValue) + : ORowSetDataColumn(_xMetaData,_xRow,NULL,_nPos,_rxDBMeta,_rDescription,_rColumnValue) { } File [changed]: CRowSetDataColumn.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/CRowSetDataColumn.cxx?r1=1.30&r2=1.30.16.1 Delta lines: +7 -9 ------------------- --- CRowSetDataColumn.cxx 19 Dec 2005 17:13:32 -0000 1.30 +++ CRowSetDataColumn.cxx 16 Jan 2006 13:47:15 -0000 1.30.16.1 @@ -4,9 +4,9 @@ * * $RCSfile: CRowSetDataColumn.cxx,v $ * - * $Revision: 1.30 $ + * $Revision: 1.30.16.1 $ * - * last change: $Author: obo $ $Date: 2005/12/19 17:13:32 $ + * last change: $Author: oj $ $Date: 2006/01/16 13:47:15 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -76,12 +76,10 @@ sal_Int32 _nPos, const Reference< XDatabaseMetaData >& _rxDBMeta, const ::rtl::OUString& _rDescription, - const ORowSetCacheIterator& _rColumnValue, - ORowSetMatrix::iterator& _rEnd) + const ORowSetCacheIterator& _rColumnValue) : ODataColumn(_xMetaData,_xRow,_xRowUpdate,_nPos,_rxDBMeta) ,m_aDescription(_rDescription) ,m_aColumnValue(_rColumnValue) - ,m_rEnd(_rEnd) { DBG_CTOR(ORowSetDataColumn,NULL); } @@ -155,7 +153,7 @@ OColumnSettings::getFastPropertyValue( rValue, nHandle ); break; case PROPERTY_ID_VALUE: - if(!m_aColumnValue.isNull() && m_aColumnValue != m_rEnd && m_aColumnValue->isValid()) + if ( !m_aColumnValue.isNull() && m_aColumnValue->isValid() ) { ORowSetRow aRow = *m_aColumnValue; OSL_ENSURE((sal_Int32)aRow->size() > m_nPos,"Pos is greater than size of vector"); @@ -237,7 +235,7 @@ // ------------------------------------------------------------------------- void ORowSetDataColumn::fireValueChange(const ORowSetValue& _rOldValue) { - if(!m_aColumnValue.isNull() && m_aColumnValue != m_rEnd && m_aColumnValue->isValid() && (!((*(*m_aColumnValue))[m_nPos] == _rOldValue))) + if ( !m_aColumnValue.isNull() && m_aColumnValue->isValid() && (!((*(*m_aColumnValue))[m_nPos] == _rOldValue)) ) { sal_Int32 nHandle = PROPERTY_ID_VALUE; m_aOldValue = _rOldValue.makeAny(); @@ -245,7 +243,7 @@ fire(&nHandle, &aNew, &m_aOldValue, 1, sal_False ); } - else if ( !m_aColumnValue.isNull() && m_aColumnValue == m_rEnd && !_rOldValue.isNull() ) + else if ( !m_aColumnValue.isNull() && !_rOldValue.isNull() ) { sal_Int32 nHandle = PROPERTY_ID_VALUE; m_aOldValue = _rOldValue.makeAny(); File [changed]: CRowSetDataColumn.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/CRowSetDataColumn.hxx?r1=1.14&r2=1.14.16.1 Delta lines: +5 -6 ------------------- --- CRowSetDataColumn.hxx 19 Dec 2005 17:13:47 -0000 1.14 +++ CRowSetDataColumn.hxx 16 Jan 2006 13:47:15 -0000 1.14.16.1 @@ -4,9 +4,9 @@ * * $RCSfile: CRowSetDataColumn.hxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.14.16.1 $ * - * last change: $Author: obo $ $Date: 2005/12/19 17:13:47 $ + * last change: $Author: oj $ $Date: 2006/01/16 13:47:15 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -62,10 +62,10 @@ { protected: ORowSetCacheIterator m_aColumnValue; - ORowSetMatrix::iterator& m_rEnd; // end of the matrix to when we reach the end ::com::sun::star::uno::Any m_aOldValue; ::rtl::OUString m_aDescription; // description + ORowSetBase* m_pRowSet; virtual ~ORowSetDataColumn(); public: @@ -75,8 +75,7 @@ sal_Int32 _nPos, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxDBMeta, const ::rtl::OUString& _rDescription, - const ORowSetCacheIterator& _rColumnValue, - ORowSetMatrix::iterator& _rEnd); + const ORowSetCacheIterator& _rColumnValue); // com::sun::star::lang::XTypeProvider File [changed]: RowSet.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSet.cxx?r1=1.139&r2=1.139.14.1 Delta lines: +12 -16 --------------------- --- RowSet.cxx 21 Dec 2005 13:33:51 -0000 1.139 +++ RowSet.cxx 16 Jan 2006 13:47:15 -0000 1.139.14.1 @@ -4,9 +4,9 @@ * * $RCSfile: RowSet.cxx,v $ * - * $Revision: 1.139 $ + * $Revision: 1.139.14.1 $ * - * last change: $Author: obo $ $Date: 2005/12/21 13:33:51 $ + * last change: $Author: oj $ $Date: 2006/01/16 13:47:15 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1032,13 +1032,13 @@ ::osl::MutexGuard aCacheGuard( *m_pMutex); sal_Bool bInserted = m_pCache->insertRow(); + // make sure that our row is set to the new inserted row before clearing the inser flags in the cache + m_pCache->resetInsertRow(bInserted); + // notification order // - column values setCurrentRow(sal_False,aOldValues,aGuard); // we don't move here - // make sure that our row is set to the new inserted row before clearing the inser flags in the cache - m_pCache->resetInsertRow(bInserted); - // - rowChanged notifyAllListenersRowChanged(aGuard,aEvt); @@ -1359,7 +1359,6 @@ if ( m_pCache && ( m_pCache->m_bInserted || m_bModified) ) return (*(*m_pCache->m_aInsertRow))[m_nLastColumnIndex = columnIndex]; - OSL_ENSURE(m_aCurrentRow != m_pCache->m_aInsertRow,"Current row stand on the insert row but all flags are wrong!"); return getValue(columnIndex); } // ------------------------------------------------------------------------- @@ -1692,7 +1691,7 @@ m_pCache->m_nPrivileges = Privilege::SELECT; } m_pCache->setMaxRowSize(m_nFetchSize); - m_aCurrentRow = m_pCache->createIterator(); + m_aCurrentRow = m_pCache->createIterator(this); m_aOldRow = m_pCache->registerOldRow(); // now we can clear the parameter row m_aParameterRow.clear(); @@ -1749,8 +1748,7 @@ i+1, m_xActiveConnection->getMetaData(), aDescription, - m_aCurrentRow, - m_pCache->getEnd()); + m_aCurrentRow); aColumnMap.insert(StringMap::value_type(sName,0)); aColumns->push_back(pColumn); pColumn->setName(sName); @@ -1835,8 +1833,7 @@ i, m_xActiveConnection->getMetaData(), aDescription, - m_aCurrentRow, - m_pCache->getEnd()); + m_aCurrentRow); aColumns->push_back(pColumn); if(!sName.getLength()) { @@ -2500,7 +2497,7 @@ // ----------------------------------------------------------------------------- void ORowSet::checkUpdateConditions(sal_Int32 columnIndex) { - if(!m_pCache || columnIndex <= 0 || m_aCurrentRow.isNull() || m_aCurrentRow == m_pCache->getEnd() || m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY) + if ( !m_pCache || columnIndex <= 0 || m_aCurrentRow.isNull() || m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY ) throwFunctionSequenceException(*this); } // ----------------------------------------------------------------------------- @@ -2545,7 +2542,7 @@ m_bAfterLast = rParent.m_bAfterLast; m_pCache = rParent.m_pCache; m_aBookmark = rParent.m_aBookmark; - m_aCurrentRow = m_pCache->createIterator(); + m_aCurrentRow = m_pCache->createIterator(this); m_xNumberFormatTypes = rParent.m_xNumberFormatTypes; m_aOldRow = m_pCache->registerOldRow(); @@ -2575,8 +2572,7 @@ i, rParent.m_xActiveConnection->getMetaData(), aDescription, - m_aCurrentRow, - m_pCache->getEnd()); + m_aCurrentRow); aColumns->push_back(pColumn); pColumn->setName(*pBegin); aNames.push_back(*pBegin); File [changed]: RowSetBase.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSetBase.cxx?r1=1.80&r2=1.80.10.1 Delta lines: +4 -6 ------------------- --- RowSetBase.cxx 3 Jan 2006 16:13:39 -0000 1.80 +++ RowSetBase.cxx 16 Jan 2006 13:47:16 -0000 1.80.10.1 @@ -4,9 +4,9 @@ * * $RCSfile: RowSetBase.cxx,v $ * - * $Revision: 1.80 $ + * $Revision: 1.80.10.1 $ * - * last change: $Author: kz $ $Date: 2006/01/03 16:13:39 $ + * last change: $Author: oj $ $Date: 2006/01/16 13:47:16 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1156,8 +1156,6 @@ sal_Bool bNull = m_aCurrentRow.isNull(); ORowSetMatrix::iterator atest = m_aCurrentRow; #endif - // OSL_ENSURE(!m_aCurrentRow.isNull() && m_aCurrentRow != m_pCache->getEnd(),"Position of matrix iterator isn't valid!"); - OSL_ENSURE(m_aCurrentRow->isValid(),"Currentrow isn't valid"); sal_Int32 i=0; try { @@ -1248,7 +1246,7 @@ OSL_ENSURE( m_pRowSet, "ORowSetNotifier::ORowSetNotifier: invalid row set. This wil crash." ); // remember the "inserted" and "modified" state for later firing - m_bWasNew = m_pRowSet->isNew( ORowSetBase::GrantNotifierAccess() );; + m_bWasNew = m_pRowSet->isNew( ORowSetBase::GrantNotifierAccess() ); m_bWasModified = m_pRowSet->isModified( ORowSetBase::GrantNotifierAccess() ); // if the row set is on the insert row, then we need to cancel this File [changed]: RowSetBase.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSetBase.hxx?r1=1.32&r2=1.32.72.1 Delta lines: +5 -4 ------------------- --- RowSetBase.hxx 8 Sep 2005 10:01:22 -0000 1.32 +++ RowSetBase.hxx 16 Jan 2006 13:47:16 -0000 1.32.72.1 @@ -4,9 +4,9 @@ * * $RCSfile: RowSetBase.hxx,v $ * - * $Revision: 1.32 $ + * $Revision: 1.32.72.1 $ * - * last change: $Author: rt $ $Date: 2005/09/08 10:01:22 $ + * last change: $Author: oj $ $Date: 2006/01/16 13:47:16 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -330,13 +330,14 @@ // ========================================================== // granular access control - struct GrantNotifierAccess { friend class ORowSetNotifier; private: GrantNotifierAccess () { } }; + struct GrantNotifierAccess { friend class ORowSetNotifier; friend class ORowSetCacheIterator; friend class ORowSetCache; private: GrantNotifierAccess () { } }; // cancel the insertion, if necessary (means if we're on the insert row) inline void doCancelModification( const GrantNotifierAccess& ) { doCancelModification(); } inline sal_Bool isModification( const GrantNotifierAccess& ) { return isModification(); } inline sal_Bool isModified( const GrantNotifierAccess& ) { return isModified(); } inline sal_Bool isNew( const GrantNotifierAccess& ) { return isNew(); } + inline sal_Bool isInsertRow( const GrantNotifierAccess& ) { return isNew() || isModified(); } inline void fireProperty( sal_Int32 _nProperty, sal_Bool _bNew, sal_Bool _bOld, const GrantNotifierAccess& ) { fireProperty( _nProperty, _bNew, _bOld ); File [changed]: RowSetCache.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSetCache.cxx?r1=1.80&r2=1.80.10.1 Delta lines: +22 -194 ---------------------- --- RowSetCache.cxx 3 Jan 2006 16:13:57 -0000 1.80 +++ RowSetCache.cxx 16 Jan 2006 13:47:16 -0000 1.80.10.1 @@ -4,9 +4,9 @@ * * $RCSfile: RowSetCache.cxx,v $ * - * $Revision: 1.80 $ + * $Revision: 1.80.10.1 $ * - * last change: $Author: kz $ $Date: 2006/01/03 16:13:57 $ + * last change: $Author: oj $ $Date: 2006/01/16 13:47:16 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -90,6 +90,9 @@ #ifndef DBACCESS_CORE_API_CROWSETCOLUMN_HXX #include "CRowSetColumn.hxx" #endif +#ifndef DBACCESS_CORE_API_ROWSETBASE_HXX +#include "RowSetBase.hxx" +#endif #ifndef _DBHELPER_DBEXCEPTION_HXX_ #include <connectivity/dbexception.hxx> #endif @@ -412,13 +415,14 @@ for(;aCacheIter != m_aCacheIterators.end();++aCacheIter) { aCacheIterToChange[aCacheIter->first] = sal_False; - if ( aCacheIter->second.aIterator == m_pMatrix->end() ) - continue; - if(aCacheIter->second.aIterator != m_aInsertRow && !m_bInserted && !m_bModified) + if ( !aCacheIter->second.pRowSet->isInsertRow(ORowSetBase::GrantNotifierAccess()) ) + { + if ( aCacheIter->second.aIterator != m_pMatrix->end() && !m_bInserted && !m_bModified ) { sal_Int16 nDist = (aCacheIter->second.aIterator - m_pMatrix->begin()); aPositions.push_back(nDist); aCacheIterToChange[aCacheIter->first] = sal_True; + } // if(aCacheIter->second.aIterator != m_aInsertRow && !m_bInserted && !m_bModified) } } sal_Int32 nKeyPos = (m_aMatrixIter - m_pMatrix->begin()); @@ -453,151 +457,6 @@ return m_xMetaData; } // ------------------------------------------------------------------------- -// XRow -sal_Bool ORowSetCache::wasNull( ) -{ - if(m_bAfterLast) - throwFunctionSequenceException(m_xSet.get()); - - OSL_ENSURE(m_aMatrixIter != m_pMatrix->end(),"Iterator is equal end()"); - - return (*(*m_aMatrixIter))[m_nLastColumnIndex].isNull(); -} -// ----------------------------------------------------------------------------- -ORowSetValue ORowSetCache::getValue(sal_Int32 columnIndex) -{ - if(m_bAfterLast) - throwFunctionSequenceException(m_xSet.get()); - - OSL_ENSURE(m_aMatrixIter != m_pMatrix->end(),"Iterator is equal end()"); - - m_nLastColumnIndex = columnIndex; - return (*(*m_aMatrixIter))[m_nLastColumnIndex]; -} -// ------------------------------------------------------------------------- -::rtl::OUString ORowSetCache::getString( sal_Int32 columnIndex ) -{ - return getValue(columnIndex); -} -// ------------------------------------------------------------------------- -sal_Bool ORowSetCache::getBoolean( sal_Int32 columnIndex ) -{ - return getValue(columnIndex); -} -// ------------------------------------------------------------------------- -sal_Int8 ORowSetCache::getByte( sal_Int32 columnIndex ) -{ - return getValue(columnIndex); -} -// ------------------------------------------------------------------------- -sal_Int16 ORowSetCache::getShort( sal_Int32 columnIndex ) -{ - return getValue(columnIndex); -} -// ------------------------------------------------------------------------- -sal_Int32 ORowSetCache::getInt( sal_Int32 columnIndex ) -{ - return getValue(columnIndex); -} -// ------------------------------------------------------------------------- -sal_Int64 ORowSetCache::getLong( sal_Int32 columnIndex ) -{ - return getValue(columnIndex); -} -// ------------------------------------------------------------------------- -float ORowSetCache::getFloat( sal_Int32 columnIndex ) -{ - return getValue(columnIndex); -} -// ------------------------------------------------------------------------- -double ORowSetCache::getDouble( sal_Int32 columnIndex ) -{ - return getValue(columnIndex); -} -// ------------------------------------------------------------------------- -Sequence< sal_Int8 > ORowSetCache::getBytes( sal_Int32 columnIndex ) -{ - return getValue(columnIndex); -} -// ------------------------------------------------------------------------- -::com::sun::star::util::Date ORowSetCache::getDate( sal_Int32 columnIndex ) -{ - return getValue(columnIndex); -} -// ------------------------------------------------------------------------- -::com::sun::star::util::Time ORowSetCache::getTime( sal_Int32 columnIndex ) -{ - return getValue(columnIndex); -} -// ------------------------------------------------------------------------- -::com::sun::star::util::DateTime ORowSetCache::getTimestamp( sal_Int32 columnIndex ) -{ - return getValue(columnIndex); -} -// ------------------------------------------------------------------------- -Reference< ::com::sun::star::io::XInputStream > ORowSetCache::getBinaryStream( sal_Int32 columnIndex ) -{ - if(m_bAfterLast) - throwFunctionSequenceException(m_xSet.get()); - - OSL_ENSURE(m_aMatrixIter != m_pMatrix->end(),"Iterator is equal end()"); - - m_nLastColumnIndex = columnIndex; - return new ::comphelper::SequenceInputStream((*(*m_aMatrixIter))[m_nLastColumnIndex].getSequence()); -} -// ------------------------------------------------------------------------- -Reference< ::com::sun::star::io::XInputStream > ORowSetCache::getCharacterStream( sal_Int32 columnIndex ) -{ - if(m_bAfterLast) - throwFunctionSequenceException(m_xSet.get()); - - OSL_ENSURE(m_aMatrixIter != m_pMatrix->end(),"Iterator is equal end()"); - - m_nLastColumnIndex = columnIndex; - return new ::comphelper::SequenceInputStream((*(*m_aMatrixIter))[m_nLastColumnIndex].getSequence()); -} -// ------------------------------------------------------------------------- -Any ORowSetCache::getObject( sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& typeMap ) -{ - if(m_bAfterLast) - throwFunctionSequenceException(m_xSet.get()); - - return Any(); -} -// ------------------------------------------------------------------------- -Reference< XRef > ORowSetCache::getRef( sal_Int32 columnIndex ) -{ - if(m_bAfterLast) - throwFunctionSequenceException(m_xSet.get()); - - return Reference< XRef >(); -} -// ------------------------------------------------------------------------- -Reference< XBlob > ORowSetCache::getBlob( sal_Int32 columnIndex ) -{ - if(m_bAfterLast) - throwFunctionSequenceException(m_xSet.get()); - - return Reference< XBlob >(); -} -// ------------------------------------------------------------------------- -Reference< XClob > ORowSetCache::getClob( sal_Int32 columnIndex ) -{ - if(m_bAfterLast) - throwFunctionSequenceException(m_xSet.get()); - - return Reference< XClob >(); -} -// ------------------------------------------------------------------------- -Reference< XArray > ORowSetCache::getArray( sal_Int32 columnIndex ) -{ - if(m_bAfterLast) - throwFunctionSequenceException(m_xSet.get()); - - return Reference< XArray >(); -} -// ------------------------------------------------------------------------- - // ::com::sun::star::sdbcx::XRowLocate Any ORowSetCache::getBookmark( ) { @@ -687,10 +546,6 @@ } // ------------------------------------------------------------------------- // XRowUpdate -void ORowSetCache::updateNull( sal_Int32 columnIndex ) -{ - updateValue(columnIndex,ORowSetValue()); -} // ----------------------------------------------------------------------------- void ORowSetCache::updateValue(sal_Int32 columnIndex,const ORowSetValue& x) { @@ -1349,12 +1204,6 @@ return m_bDeleted; } // ------------------------------------------------------------------------- -Reference< XInterface > ORowSetCache::getStatement( ) -{ - return m_pCacheSet->getStatement(); -} -// ------------------------------------------------------------------------- - // XResultSetUpdate sal_Bool ORowSetCache::insertRow( ) { @@ -1392,38 +1241,16 @@ // ------------------------------------------------------------------------- void ORowSetCache::cancelRowModification() { - resetInsertRow(sal_False); - // clear the insertrow references -> implies that the current row of the rowset changes as well ORowSetCacheMap::iterator aCacheIter = m_aCacheIterators.begin(); - for(;aCacheIter != m_aCacheIterators.end();++aCacheIter) - { - if ( aCacheIter->second.aIterator != m_pMatrix->end() ) + ORowSetCacheMap::iterator aCacheEnd = m_aCacheIterators.end(); + for(;aCacheIter != aCacheEnd;++aCacheIter) { - ORowSetMatrix::iterator aOldIter = aCacheIter->second.aIterator; - if(aOldIter == m_aInsertRow) + if ( aCacheIter->second.pRowSet->isInsertRow(ORowSetBase::GrantNotifierAccess()) && aCacheIter->second.aIterator == m_aInsertRow ) aCacheIter->second.aIterator = m_pMatrix->end(); - } - } -} -// ------------------------------------------------------------------------- -/* -void ORowSetCache::updateRow( ) -{ - ::osl::MutexGuard aGuard( m_aRowCountMutex ); - - if(isAfterLast() || isBeforeFirst()) - throw SQLException(DBACORE_RESSTRING(RID_STR_NO_UPDATEROW),NULL,SQLSTATE_GENERAL,1000,Any() ); - - m_pCacheSet->updateRow(*m_aInsertRow,*m_aMatrixIter,m_aUpdateTable); - - clearInsertRow(); - - // we don't need to repositioning here refresh will do it for us - m_bModified = sal_False; - refreshRow( ); + } // for(;aCacheIter != aCacheEnd;++aCacheIter) + resetInsertRow(sal_False); } -*/ // ------------------------------------------------------------------------- void ORowSetCache::updateRow( ORowSetMatrix::iterator& _rUpdateRow ) { @@ -1562,11 +1389,12 @@ } // ------------------------------------------------------------------------- -ORowSetCacheIterator ORowSetCache::createIterator() +ORowSetCacheIterator ORowSetCache::createIterator(ORowSetBase* _pRowSet) { ORowSetCacheIterator_Helper aHelper; aHelper.aIterator = m_pMatrix->end(); - return ORowSetCacheIterator(m_aCacheIterators.insert(m_aCacheIterators.begin(),ORowSetCacheMap::value_type(m_aCacheIterators.size()+1,aHelper)),this); + aHelper.pRowSet = _pRowSet; + return ORowSetCacheIterator(m_aCacheIterators.insert(m_aCacheIterators.begin(),ORowSetCacheMap::value_type(m_aCacheIterators.size()+1,aHelper)),this,_pRowSet); } // ----------------------------------------------------------------------------- void ORowSetCache::rotateCacheIterator(sal_Int16 _nDist) File [changed]: RowSetCache.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSetCache.hxx?r1=1.25&r2=1.25.74.1 Delta lines: +4 -29 -------------------- --- RowSetCache.hxx 8 Sep 2005 10:01:59 -0000 1.25 +++ RowSetCache.hxx 16 Jan 2006 13:47:16 -0000 1.25.74.1 @@ -4,9 +4,9 @@ * * $RCSfile: RowSetCache.hxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.25.74.1 $ * - * last change: $Author: rt $ $Date: 2005/09/08 10:01:59 $ + * last change: $Author: oj $ $Date: 2006/01/16 13:47:16 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -173,7 +173,6 @@ void rotateCacheIterator(sal_Int16 _nDist); void updateValue(sal_Int32 columnIndex,const connectivity::ORowSetValue& x); - connectivity::ORowSetValue getValue(sal_Int32 columnIndex); // checks and set the flags isAfterLast isLast and position when afterlast is true void checkPositionFlags(); void checkUpdateConditions(sal_Int32 columnIndex); @@ -203,7 +202,7 @@ // called from the rowset when a updateXXX was called for the first time void setUpdateIterator(const ORowSetMatrix::iterator& _rOriginalRow); - ORowSetCacheIterator createIterator(); + ORowSetCacheIterator createIterator(ORowSetBase* _pRowSet); // sets the size of the matrix void setMaxRowSize(sal_Int32 _nSize); @@ -214,28 +213,6 @@ // ::com::sun::star::sdbc::XResultSetMetaDataSupplier ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > getMetaData( ); - // ::com::sun::star::sdbc::XRow - sal_Bool wasNull( ); - ::rtl::OUString getString( sal_Int32 columnIndex ); - sal_Bool getBoolean( sal_Int32 columnIndex ); - sal_Int8 getByte( sal_Int32 columnIndex ); - sal_Int16 getShort( sal_Int32 columnIndex ); - sal_Int32 getInt( sal_Int32 columnIndex ); - sal_Int64 getLong( sal_Int32 columnIndex ); - float getFloat( sal_Int32 columnIndex ); - double getDouble( sal_Int32 columnIndex ); - ::com::sun::star::uno::Sequence< sal_Int8 > getBytes( sal_Int32 columnIndex ); - ::com::sun::star::util::Date getDate( sal_Int32 columnIndex ); - ::com::sun::star::util::Time getTime( sal_Int32 columnIndex ); - ::com::sun::star::util::DateTime getTimestamp( sal_Int32 columnIndex ); - ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > getBinaryStream( sal_Int32 columnIndex ); - ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > getCharacterStream( sal_Int32 columnIndex ); - ::com::sun::star::uno::Any getObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ); - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef > getRef( sal_Int32 columnIndex ); - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob > getBlob( sal_Int32 columnIndex ); - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob > getClob( sal_Int32 columnIndex ); - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray > getArray( sal_Int32 columnIndex ); - // ::com::sun::star::sdbcx::XRowLocate ::com::sun::star::uno::Any getBookmark( ); sal_Bool moveToBookmark( const ::com::sun::star::uno::Any& bookmark ); @@ -245,7 +222,6 @@ sal_Int32 hashBookmark( const ::com::sun::star::uno::Any& bookmark ); // ::com::sun::star::sdbc::XRowUpdate - void updateNull( sal_Int32 columnIndex ); void updateBinaryStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ); void updateCharacterStream( sal_Int32 columnIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ); void updateObject( sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x ); @@ -269,7 +245,6 @@ sal_Bool rowUpdated( ); sal_Bool rowInserted( ); sal_Bool rowDeleted( ); - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getStatement( ); // ::com::sun::star::sdbc::XResultSetUpdate sal_Bool insertRow(); File [changed]: RowSetCacheIterator.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSetCacheIterator.cxx?r1=1.10&r2=1.10.2.1 Delta lines: +17 -5 -------------------- --- RowSetCacheIterator.cxx 12 Jan 2006 17:20:39 -0000 1.10 +++ RowSetCacheIterator.cxx 16 Jan 2006 13:47:16 -0000 1.10.2.1 @@ -4,9 +4,9 @@ * * $RCSfile: RowSetCacheIterator.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.10.2.1 $ * - * last change: $Author: rt $ $Date: 2006/01/12 17:20:39 $ + * last change: $Author: oj $ $Date: 2006/01/16 13:47:16 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -38,11 +38,16 @@ #ifndef DBACCESS_CORE_API_ROWSETCACHE_HXX #include "RowSetCache.hxx" #endif +#ifndef DBACCESS_CORE_API_ROWSETBASE_HXX +#include "RowSetBase.hxx" +#endif + using namespace dbaccess; ORowSetCacheIterator::ORowSetCacheIterator(const ORowSetCacheIterator& _rRH) : m_pCache(_rRH.m_pCache) , m_aIter(_rRH.m_aIter) +,m_pRowSet(_rRH.m_pRowSet) { } // ----------------------------------------------------------------------------- @@ -58,6 +63,7 @@ m_pCache = _rRH.m_pCache; m_aIter = _rRH.m_aIter; + m_pRowSet = _rRH.m_pRowSet; return *this; } @@ -75,7 +81,7 @@ // ----------------------------------------------------------------------------- const ORowSetRow& ORowSetCacheIterator::operator *() const { - if ( m_aIter->second.aIterator == m_pCache->m_pMatrix->end() ) + if ( !m_pRowSet->isInsertRow(ORowSetBase::GrantNotifierAccess()) && m_aIter->second.aIterator == m_pCache->m_pMatrix->end() ) { OSL_ENSURE(m_aIter->second.aBookmark.hasValue(),"bookmark has no value!"); m_pCache->moveToBookmark(m_aIter->second.aBookmark); @@ -91,7 +97,7 @@ // ----------------------------------------------------------------------------- const ORowSetMatrix::iterator& ORowSetCacheIterator::operator ->() const { - if ( m_aIter->second.aIterator == m_pCache->m_pMatrix->end() ) + if ( !m_pRowSet->isInsertRow(ORowSetBase::GrantNotifierAccess()) && m_aIter->second.aIterator == m_pCache->m_pMatrix->end() ) { OSL_ENSURE(m_aIter->second.aBookmark.hasValue(),"bookmark has no value!"); m_pCache->moveToBookmark(m_aIter->second.aBookmark); @@ -122,5 +128,11 @@ // ----------------------------------------------------------------------------- sal_Bool ORowSetCacheIterator::isNull() const { - return !m_pCache || m_aIter == m_pCache->m_aCacheIterators.end() || m_aIter->second.aIterator == m_pCache->m_pMatrix->end(); + return !m_pCache || !m_pRowSet || m_aIter == m_pCache->m_aCacheIterators.end() || + ( m_pRowSet->isInsertRow(ORowSetBase::GrantNotifierAccess()) + ? + m_aIter->second.aIterator == m_pCache->m_pInsertMatrix->end() + : + m_aIter->second.aIterator == m_pCache->m_pMatrix->end() + ); } File [changed]: RowSetCacheIterator.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSetCacheIterator.hxx?r1=1.7&r2=1.7.74.1 Delta lines: +9 -5 ------------------- --- RowSetCacheIterator.hxx 8 Sep 2005 10:02:41 -0000 1.7 +++ RowSetCacheIterator.hxx 16 Jan 2006 13:47:17 -0000 1.7.74.1 @@ -4,9 +4,9 @@ * * $RCSfile: RowSetCacheIterator.hxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.7.74.1 $ * - * last change: $Author: rt $ $Date: 2005/09/08 10:02:41 $ + * last change: $Author: oj $ $Date: 2006/01/16 13:47:17 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -44,10 +44,12 @@ namespace dbaccess { + class ORowSetBase; typedef struct { ORowSetMatrix::iterator aIterator; ::com::sun::star::uno::Any aBookmark; + ORowSetBase* pRowSet; } ORowSetCacheIterator_Helper; DECLARE_STL_STDKEY_MAP(sal_Int32,ORowSetCacheIterator_Helper,ORowSetCacheMap); @@ -58,14 +60,16 @@ friend class ORowSetCache; ORowSetCacheMap::iterator m_aIter; ORowSetCache* m_pCache; + ORowSetBase* m_pRowSet; protected: - ORowSetCacheIterator(const ORowSetCacheMap::iterator& _rIter,ORowSetCache* _pCache) + ORowSetCacheIterator(const ORowSetCacheMap::iterator& _rIter,ORowSetCache* _pCache,ORowSetBase* _pRowSet) : m_aIter(_rIter) ,m_pCache(_pCache) + ,m_pRowSet(_pRowSet) { } public: - ORowSetCacheIterator() :m_pCache(NULL),m_aIter(){} + ORowSetCacheIterator() :m_pCache(NULL),m_aIter(),m_pRowSet(NULL){} ORowSetCacheIterator(const ORowSetCacheIterator& _rRH); ORowSetCacheIterator& operator =(const ORowSetCacheIterator&); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
