Tag: cws_src680_dba30 User: fs Date: 2006/07/19 05:09:10 Modified: dba/dbaccess/source/core/api/RowSetBase.cxx
Log: RESYNC: (1.85-1.87); FILE MERGED File Changes: Directory: /dba/dbaccess/source/core/api/ ========================================= File [changed]: RowSetBase.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSetBase.cxx?r1=1.75.6.6&r2=1.75.6.7 Delta lines: +71 -52 --------------------- --- RowSetBase.cxx 8 May 2006 11:17:39 -0000 1.75.6.6 +++ RowSetBase.cxx 19 Jul 2006 12:09:07 -0000 1.75.6.7 @@ -77,9 +77,6 @@ #ifndef _DBHELPER_DBEXCEPTION_HXX_ #include <connectivity/dbexception.hxx> #endif -#ifndef _CONNECTIVITY_EMPTYMETADATA_HXX_ -#include <connectivity/emptymetadata.hxx> -#endif #ifndef _OSL_THREAD_H_ #include <osl/thread.h> #endif @@ -123,7 +120,7 @@ { } // ----------------------------------------------------------------------------- -connectivity::sdbcx::ObjectType OEmptyCollection::createObject(const ::rtl::OUString& _rName) +connectivity::sdbcx::ObjectType OEmptyCollection::createObject(const ::rtl::OUString& /*_rName*/) { return connectivity::sdbcx::ObjectType(); } @@ -137,16 +134,18 @@ ORowSetBase::ORowSetBase(::cppu::OBroadcastHelper &_rBHelper,::osl::Mutex* _pMutex) : OPropertyStateContainer(_rBHelper) , m_pMutex(_pMutex) - , m_rBHelper(_rBHelper) , m_pCache(NULL) , m_pColumns(NULL) - , m_bBeforeFirst(sal_True) // changed from sal_False - , m_bAfterLast(sal_False) - , m_bClone(sal_False) + , m_rBHelper(_rBHelper) + , m_pEmptyCollection( NULL ) + , m_nLastColumnIndex(-1) , m_nDeletedPosition(-1) + , m_nResultSetType( ResultSetType::FORWARD_ONLY ) + , m_nResultSetConcurrency( ResultSetConcurrency::READ_ONLY ) + , m_bClone(sal_False) , m_bIgnoreResult(sal_False) - , m_nLastColumnIndex(-1) - , m_pEmptyCollection( NULL ) + , m_bBeforeFirst(sal_True) // changed from sal_False + , m_bAfterLast(sal_False) { DBG_CTOR(ORowSetBase,NULL); @@ -401,7 +400,7 @@ return getBinaryStream(columnIndex); } // ------------------------------------------------------------------------- -Any SAL_CALL ORowSetBase::getObject( sal_Int32 columnIndex, const Reference< XNameAccess >& typeMap ) throw(SQLException, RuntimeException) +Any SAL_CALL ORowSetBase::getObject( sal_Int32 columnIndex, const Reference< XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( *m_pMutex ); checkCache(); @@ -409,36 +408,28 @@ return getValue(columnIndex).makeAny(); } // ------------------------------------------------------------------------- -Reference< XRef > SAL_CALL ORowSetBase::getRef( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) +Reference< XRef > SAL_CALL ORowSetBase::getRef( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException) { - ::osl::MutexGuard aGuard( *m_pMutex ); - checkCache(); - - return Reference< XRef >(); + ::dbtools::throwFeatureNotImplementedException( "XRow::getRef", *m_pMySelf ); + return NULL; } // ------------------------------------------------------------------------- -Reference< XBlob > SAL_CALL ORowSetBase::getBlob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) +Reference< XBlob > SAL_CALL ORowSetBase::getBlob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException) { - ::osl::MutexGuard aGuard( *m_pMutex ); - checkCache(); - - return Reference< XBlob >(); + ::dbtools::throwFeatureNotImplementedException( "XRow::getBlob", *m_pMySelf ); + return NULL; } // ------------------------------------------------------------------------- -Reference< XClob > SAL_CALL ORowSetBase::getClob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) +Reference< XClob > SAL_CALL ORowSetBase::getClob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException) { - ::osl::MutexGuard aGuard( *m_pMutex ); - checkCache(); - - return Reference< XClob >(); + ::dbtools::throwFeatureNotImplementedException( "XRow::getClob", *m_pMySelf ); + return NULL; } // ------------------------------------------------------------------------- -Reference< XArray > SAL_CALL ORowSetBase::getArray( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) +Reference< XArray > SAL_CALL ORowSetBase::getArray( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException) { - ::osl::MutexGuard aGuard( *m_pMutex ); - checkCache(); - - return Reference< XArray >(); + ::dbtools::throwFeatureNotImplementedException( "XRow::getArray", *m_pMySelf ); + return NULL; } // ------------------------------------------------------------------------- // ::com::sun::star::sdbcx::XRowLocate @@ -477,8 +468,8 @@ checkCache(); - sal_Bool bRet; - if(bRet = notifyAllListenersCursorBeforeMove(aGuard)) + sal_Bool bRet( notifyAllListenersCursorBeforeMove( aGuard ) ); + if ( bRet ) { // check if we are inserting a row sal_Bool bWasNew = m_pCache->m_bNew || rowDeleted(); @@ -519,8 +510,8 @@ checkPositioningAllowed(); - sal_Bool bRet; - if(bRet = notifyAllListenersCursorBeforeMove(aGuard)) + sal_Bool bRet( notifyAllListenersCursorBeforeMove( aGuard ) ); + if ( bRet ) { // check if we are inserting a row sal_Bool bWasNew = m_pCache->m_bNew || rowDeleted(); @@ -553,11 +544,11 @@ return bRet; } // ------------------------------------------------------------------------- -sal_Int32 SAL_CALL ORowSetBase::compareBookmarks( const Any& first, const Any& second ) throw(SQLException, RuntimeException) +sal_Int32 SAL_CALL ORowSetBase::compareBookmarks( const Any& _first, const Any& _second ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( *m_pMutex ); checkCache(); - return m_pCache->compareBookmarks(first,second); + return m_pCache->compareBookmarks(_first,_second); } // ------------------------------------------------------------------------- sal_Bool SAL_CALL ORowSetBase::hasOrderedBookmarks( ) throw(SQLException, RuntimeException) @@ -583,8 +574,6 @@ Reference< XResultSetMetaData > xMeta; if(m_pCache) xMeta = m_pCache->getMetaData(); - else - xMeta = new OEmptyMetaData(); return xMeta; } @@ -624,8 +613,8 @@ ::osl::ResettableMutexGuard aGuard( *m_pMutex ); checkCache(); - sal_Bool bRet; - if(bRet = notifyAllListenersCursorBeforeMove(aGuard)) + sal_Bool bRet( notifyAllListenersCursorBeforeMove( aGuard ) ); + if ( bRet ) { // check if we are inserting a row sal_Bool bWasNew = m_pCache->m_bNew || rowDeleted(); @@ -830,8 +819,8 @@ ::osl::ResettableMutexGuard aGuard( *m_pMutex ); checkPositioningAllowed(); - sal_Bool bRet; - if(bRet = notifyAllListenersCursorBeforeMove(aGuard) ) + sal_Bool bRet( notifyAllListenersCursorBeforeMove( aGuard ) ); + if( bRet ) { // check if we are inserting a row sal_Bool bWasNew = m_pCache->m_bNew || rowDeleted(); @@ -924,8 +913,9 @@ ::osl::ResettableMutexGuard aGuard( *m_pMutex ); checkPositioningAllowed(); - sal_Bool bRet = row > 0; - if ( bRet && (bRet = notifyAllListenersCursorBeforeMove(aGuard)) ) + sal_Bool bRet = ( row > 0 ) + && notifyAllListenersCursorBeforeMove( aGuard ); + if ( bRet ) { // check if we are inserting a row sal_Bool bWasNew = m_pCache->m_bNew || rowDeleted(); @@ -973,10 +963,13 @@ checkPositioningAllowed(); - sal_Bool bRet =!((m_bAfterLast && rows > 0) || (m_bBeforeFirst && rows < 0)); // we are already behind the last row or before the first - + sal_Bool bRet = + ( ( !m_bAfterLast || rows <= 0 ) + && ( !m_bBeforeFirst || rows >= 0 ) + && notifyAllListenersCursorBeforeMove( aGuard ) + ); - if(bRet && (bRet = notifyAllListenersCursorBeforeMove(aGuard))) + if ( bRet ) { // check if we are inserting a row sal_Bool bWasNew = m_pCache->m_bNew || rowDeleted(); @@ -1021,9 +1014,10 @@ checkPositioningAllowed(); - sal_Bool bRet = !m_bBeforeFirst; + sal_Bool bRet = !m_bBeforeFirst + && notifyAllListenersCursorBeforeMove(aGuard); - if(bRet && (bRet = notifyAllListenersCursorBeforeMove(aGuard))) + if ( bRet ) { // check if we are inserting a row sal_Bool bWasNew = m_pCache->m_bNew || rowDeleted(); @@ -1082,9 +1076,13 @@ OSL_ENSURE(m_aCurrentRow->isValid(),"Currentrow isn't valid"); OSL_ENSURE(m_aBookmark.hasValue(),"Bookmark has no value!"); +#if OSL_DEBUG_LEVEL > 0 sal_Int32 nOldRow = m_pCache->getRow(); +#endif positionCache( MOVE_NONE_REFRESH_ONLY ); +#if OSL_DEBUG_LEVEL > 0 sal_Int32 nNewRow = m_pCache->getRow(); +#endif OSL_ENSURE(nOldRow == nNewRow,"Old position is not equal to new postion"); m_aCurrentRow = m_pCache->m_aMatrixIter; OSL_ENSURE(!m_aCurrentRow.isNull(),"CurrentRow is nul after positionCache!"); @@ -1216,7 +1214,7 @@ DBG_TRACE2("DBACCESS ORowSetBase::firePropertyChange() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); OSL_ENSURE(m_pColumns,"Columns can not be NULL here!"); #if OSL_DEBUG_LEVEL > 1 - sal_Bool bNull = m_aCurrentRow.isNull(); + sal_Bool bNull = m_aCurrentRow.isNull(); (void)bNull; ORowSetMatrix::iterator atest = m_aCurrentRow; #endif sal_Int32 i=0; @@ -1233,6 +1231,27 @@ } // ----------------------------------------------------------------------------- +void ORowSetBase::fireRowcount() +{ +} + +// ----------------------------------------------------------------------------- +sal_Bool ORowSetBase::notifyAllListenersCursorBeforeMove(::osl::ResettableMutexGuard& /*_rGuard*/) +{ + return sal_True; +} + +// ----------------------------------------------------------------------------- +void ORowSetBase::notifyAllListenersCursorMoved(::osl::ResettableMutexGuard& /*_rGuard*/) +{ +} + +// ----------------------------------------------------------------------------- +void ORowSetBase::notifyAllListeners(::osl::ResettableMutexGuard& /*_rGuard*/) +{ +} + +// ----------------------------------------------------------------------------- sal_Bool ORowSetBase::isModification( ) { return m_pCache && m_pCache->m_bNew; @@ -1331,7 +1350,7 @@ return aOldValues; } // ----------------------------------------------------------------------------- -void ORowSetBase::getPropertyDefaultByHandle( sal_Int32 _nHandle, Any& _rDefault ) const +void ORowSetBase::getPropertyDefaultByHandle( sal_Int32 /*_nHandle*/, Any& _rDefault ) const { _rDefault.clear(); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
