Tag: cws_src680_oj14 User: oj Date: 2006/07/04 00:25:27 Modified: dba/dbaccess/source/core/api/RowSet.cxx
Log: RESYNC: (1.142-1.144); FILE MERGED File Changes: Directory: /dba/dbaccess/source/core/api/ ========================================= File [changed]: RowSet.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSet.cxx?r1=1.137.4.3&r2=1.137.4.4 Delta lines: +40 -39 --------------------- --- RowSet.cxx 20 Mar 2006 13:44:04 -0000 1.137.4.3 +++ RowSet.cxx 4 Jul 2006 07:25:24 -0000 1.137.4.4 @@ -260,26 +260,26 @@ ORowSet::ORowSet(const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xFac) : ORowSet_BASE1(m_aMutex) , ORowSetBase(ORowSet_BASE1::rBHelper,&m_aMutex) - , m_xServiceManager(_xFac) + ,m_xServiceManager(_xFac) ,m_aRowsetListeners(*m_pMutex) ,m_aApproveListeners(*m_pMutex) + ,m_pTables(NULL) ,m_nFetchDirection(FetchDirection::FORWARD) ,m_nFetchSize(1) - ,m_nCommandType(CommandType::COMMAND) ,m_nMaxFieldSize(0) - ,m_nTransactionIsolation(0) - ,m_nPrivileges(0) ,m_nMaxRows(0) ,m_nQueryTimeOut(0) + ,m_nCommandType(CommandType::COMMAND) + ,m_nTransactionIsolation(0) + ,m_nPrivileges(0) ,m_bUseEscapeProcessing(sal_True) ,m_bApplyFilter(sal_False) ,m_bCreateStatement(sal_True) ,m_bModified(sal_False) ,m_bRebuildConnOnExecute(sal_False) - ,m_bNew(sal_False) ,m_bIsBookmarable(sal_True) + ,m_bNew(sal_False) ,m_bCanUpdateInsertedRows(sal_True) - ,m_pTables(NULL) ,m_bOwnConnection(sal_False) { m_nResultSetType = ResultSetType::SCROLL_SENSITIVE; @@ -1471,27 +1471,28 @@ return ORowSetBase::getCharacterStream(columnIndex); } // ------------------------------------------------------------------------- -Any SAL_CALL ORowSet::getObject( sal_Int32 columnIndex, const Reference< XNameAccess >& typeMap ) throw(SQLException, RuntimeException) +Any SAL_CALL ORowSet::getObject( sal_Int32 columnIndex, const Reference< XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException) { - return Any(); + ::osl::MutexGuard aGuard( *m_pMutex ); + return getInsertValue(columnIndex).makeAny(); } // ------------------------------------------------------------------------- -Reference< XRef > SAL_CALL ORowSet::getRef( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) +Reference< XRef > SAL_CALL ORowSet::getRef( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException) { return Reference< XRef >(); } // ------------------------------------------------------------------------- -Reference< XBlob > SAL_CALL ORowSet::getBlob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) +Reference< XBlob > SAL_CALL ORowSet::getBlob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException) { return Reference< XBlob >(); } // ------------------------------------------------------------------------- -Reference< XClob > SAL_CALL ORowSet::getClob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) +Reference< XClob > SAL_CALL ORowSet::getClob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException) { return Reference< XClob >(); } // ------------------------------------------------------------------------- -Reference< XArray > SAL_CALL ORowSet::getArray( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) +Reference< XArray > SAL_CALL ORowSet::getArray( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException) { return Reference< XArray >(); } @@ -1682,10 +1683,10 @@ { Reference<XParameters> xParam(m_xStatement,UNO_QUERY); - sal_Int32 i = 1; - for(ORowVector< ORowSetValue >::const_iterator aIter = m_aParameterRow.begin(); aIter != m_aParameterRow.end();++aIter,++i) + sal_Int32 index = 1; + for(ORowVector< ORowSetValue >::const_iterator aIter = m_aParameterRow.begin(); aIter != m_aParameterRow.end();++aIter,++index) { - ::dbtools::setObjectWithInfo(xParam,i,aIter->makeAny(),aIter->getTypeKind()); + ::dbtools::setObjectWithInfo(xParam,index,aIter->makeAny(),aIter->getTypeKind()); } Reference< XResultSet> xRs = m_xStatement->executeQuery(); @@ -1694,7 +1695,7 @@ if(m_aUpdateTableName.getLength()) composeTableName(m_xActiveConnection->getMetaData(),m_aUpdateCatalogName,m_aUpdateSchemaName,m_aUpdateTableName,aComposedTableName,sal_False,::dbtools::eInDataManipulation); - m_pCache = new ORowSetCache(xRs,m_xAnalyzer,m_xServiceManager,m_aParameterRow,aComposedTableName,m_bModified,m_bNew); + m_pCache = new ORowSetCache(xRs,m_xAnalyzer,m_xServiceManager,aComposedTableName,m_bModified,m_bNew); if ( m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY ) { m_nPrivileges = Privilege::SELECT; @@ -1745,10 +1746,10 @@ if(aColumnMap.find(sName) != aColumnMap.end()) { ::rtl::OUString sAlias(sName); - sal_Int32 i=1; + sal_Int32 searchIndex=1; while(aColumnMap.find(sAlias) != aColumnMap.end()) { - (sAlias = sName) += ::rtl::OUString::valueOf(i++); + (sAlias = sName) += ::rtl::OUString::valueOf(searchIndex++); } sName = sAlias; } @@ -2278,7 +2279,7 @@ } // ------------------------------------------------------------------------- // XParameters -void SAL_CALL ORowSet::setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) throw(SQLException, RuntimeException) +void SAL_CALL ORowSet::setNull( sal_Int32 parameterIndex, sal_Int32 /*sqlType*/ ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aColumnsMutex ); checkAndResizeParameters(parameterIndex); @@ -2286,9 +2287,8 @@ m_aParameterRow[parameterIndex-1].setNull(); } // ------------------------------------------------------------------------- -void SAL_CALL ORowSet::setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName ) throw(SQLException, RuntimeException) +void SAL_CALL ORowSet::setObjectNull( sal_Int32 parameterIndex, sal_Int32 /*sqlType*/, const ::rtl::OUString& /*typeName*/ ) throw(SQLException, RuntimeException) { - ::osl::MutexGuard aGuard( m_aColumnsMutex ); checkAndResizeParameters(parameterIndex); m_aParameterRow[parameterIndex-1].setNull(); @@ -2411,7 +2411,7 @@ } } // ------------------------------------------------------------------------- -void SAL_CALL ORowSet::setObjectWithInfo( sal_Int32 parameterIndex, const Any& x, sal_Int32 targetSqlType, sal_Int32 scale ) throw(SQLException, RuntimeException) +void SAL_CALL ORowSet::setObjectWithInfo( sal_Int32 parameterIndex, const Any& x, sal_Int32 targetSqlType, sal_Int32 /*scale*/ ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aColumnsMutex ); checkAndResizeParameters(parameterIndex); @@ -2419,24 +2419,24 @@ m_aParameterRow[parameterIndex-1].setTypeKind(targetSqlType); } // ------------------------------------------------------------------------- -void SAL_CALL ORowSet::setRef( sal_Int32 parameterIndex, const Reference< XRef >& x ) throw(SQLException, RuntimeException) +void SAL_CALL ORowSet::setRef( sal_Int32 /*parameterIndex*/, const Reference< XRef >& /*x*/ ) throw(SQLException, RuntimeException) { - throw SQLException(); + ::dbtools::throwFeatureNotImplementedException( "XParameters::setRef", *this ); } // ------------------------------------------------------------------------- -void SAL_CALL ORowSet::setBlob( sal_Int32 parameterIndex, const Reference< XBlob >& x ) throw(SQLException, RuntimeException) +void SAL_CALL ORowSet::setBlob( sal_Int32 /*parameterIndex*/, const Reference< XBlob >& /*x*/ ) throw(SQLException, RuntimeException) { - throw SQLException(); + ::dbtools::throwFeatureNotImplementedException( "XParameters::setBlob", *this ); } // ------------------------------------------------------------------------- -void SAL_CALL ORowSet::setClob( sal_Int32 parameterIndex, const Reference< XClob >& x ) throw(SQLException, RuntimeException) +void SAL_CALL ORowSet::setClob( sal_Int32 /*parameterIndex*/, const Reference< XClob >& /*x*/ ) throw(SQLException, RuntimeException) { - throw SQLException(); + ::dbtools::throwFeatureNotImplementedException( "XParameters::setClob", *this ); } // ------------------------------------------------------------------------- -void SAL_CALL ORowSet::setArray( sal_Int32 parameterIndex, const Reference< XArray >& x ) throw(SQLException, RuntimeException) +void SAL_CALL ORowSet::setArray( sal_Int32 /*parameterIndex*/, const Reference< XArray >& /*x*/ ) throw(SQLException, RuntimeException) { - throw SQLException(); + ::dbtools::throwFeatureNotImplementedException( "XParameters::setArray", *this ); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::clearParameters( ) throw(SQLException, RuntimeException) @@ -2458,15 +2458,16 @@ // ----------------------------------------------------------------------------- void ORowSet::doCancelModification( ) { - OSL_ENSURE( isModification(), "ORowSet::doCancelModification: invalid call (no cache!)!" ); + //OSL_ENSURE( isModification(), "ORowSet::doCancelModification: invalid call (no cache!)!" ); if ( isModification() ) m_pCache->cancelRowModification(); + m_bModified = sal_False; } // ----------------------------------------------------------------------------- sal_Bool ORowSet::isModification( ) { - return m_pCache && m_pCache->m_bNew; + return isNew(); } // ----------------------------------------------------------------------------- @@ -2532,10 +2533,10 @@ ORowSetClone::ORowSetClone(ORowSet& rParent,::osl::Mutex* _pMutex) :OSubComponent(m_aMutex, rParent) ,ORowSetBase(OComponentHelper::rBHelper,_pMutex) + ,m_pParent(&rParent) ,m_nFetchDirection(rParent.m_nFetchDirection) ,m_nFetchSize(rParent.m_nFetchSize) ,m_bIsBookmarable(sal_True) - ,m_pParent(&rParent) { DBG_CTOR(ORowSetClone, NULL); @@ -2749,7 +2750,7 @@ // ----------------------------------------------------------------------------- void ORowSetClone::doCancelModification( ) { - OSL_ENSURE( sal_False, "ORowSetClone::doCancelModification: invalid call!" ); + //OSL_ENSURE( sal_False, "ORowSetClone::doCancelModification: invalid call!" ); } // ----------------------------------------------------------------------------- @@ -2777,13 +2778,13 @@ } // ------------------------------------------------------------------------- -void SAL_CALL ORowSetClone::addRowSetListener( const Reference< XRowSetListener >& listener ) throw(RuntimeException) +void SAL_CALL ORowSetClone::addRowSetListener( const Reference< XRowSetListener >& ) throw(RuntimeException) { throwFunctionNotSupportedException( "RowSetClone::XRowSet", *this ); } // ------------------------------------------------------------------------- -void SAL_CALL ORowSetClone::removeRowSetListener( const Reference< XRowSetListener >& listener ) throw(RuntimeException) +void SAL_CALL ORowSetClone::removeRowSetListener( const Reference< XRowSetListener >& ) throw(RuntimeException) { throwFunctionNotSupportedException( "RowSetClone::XRowSet", *this ); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
