Tag: cws_src680_dba201 User: oj Date: 05/04/29 01:18:18 Modified: /dba/dbaccess/source/core/api/ CacheSet.cxx, CacheSet.hxx, KeySet.cxx
Log: #i43667# new method for RowSetValue now allows to fill from a row with type info File Changes: Directory: /dba/dbaccess/source/core/api/ ========================================= File [changed]: CacheSet.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/CacheSet.cxx?r1=1.38.42.1&r2=1.38.42.2 Delta lines: +3 -83 -------------------- --- CacheSet.cxx 29 Apr 2005 05:58:38 -0000 1.38.42.1 +++ CacheSet.cxx 29 Apr 2005 08:18:14 -0000 1.38.42.2 @@ -2,9 +2,9 @@ * * $RCSfile: CacheSet.cxx,v $ * - * $Revision: 1.38.42.1 $ + * $Revision: 1.38.42.2 $ * - * last change: $Author: oj $ $Date: 2005/04/29 05:58:38 $ + * last change: $Author: oj $ $Date: 2005/04/29 08:18:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -611,7 +611,7 @@ { sal_Int32 nType = m_xSetMetaData->getColumnType(i); aIter->setSigned(m_aSignedFlags[i-1]); - fetchValue(i,nType,this,*aIter); + aIter->fill(i,nType,this); } } // ----------------------------------------------------------------------------- @@ -814,83 +814,3 @@ return m_xDriverSet->getStatement(); } // ----------------------------------------------------------------------------- -void OCacheSet::fetchValue(sal_Int32 _nPos,sal_Int32 _nType,const Reference<XRow>& _xRow,ORowSetValue& _rValue) -{ - sal_Bool bReadData = sal_True; - switch(_nType) - { - case DataType::CHAR: - case DataType::VARCHAR: - case DataType::DECIMAL: - case DataType::NUMERIC: - case DataType::LONGVARCHAR: - _rValue = _xRow->getString(_nPos); - break; - case DataType::BIGINT: - if ( _rValue.isSigned() ) - _rValue = _xRow->getLong(_nPos); - else - _rValue = _xRow->getString(_nPos); - break; - case DataType::FLOAT: - _rValue = _xRow->getFloat(_nPos); - break; - case DataType::DOUBLE: - case DataType::REAL: - _rValue = _xRow->getDouble(_nPos); - break; - case DataType::DATE: - _rValue = _xRow->getDate(_nPos); - break; - case DataType::TIME: - _rValue = _xRow->getTime(_nPos); - break; - case DataType::TIMESTAMP: - _rValue = _xRow->getTimestamp(_nPos); - break; - case DataType::BINARY: - case DataType::VARBINARY: - case DataType::LONGVARBINARY: - _rValue = _xRow->getBytes(_nPos); - break; - case DataType::BIT: - case DataType::BOOLEAN: - _rValue = _xRow->getBoolean(_nPos); - break; - case DataType::TINYINT: - if ( _rValue.isSigned() ) - _rValue = _xRow->getByte(_nPos); - else - _rValue = _xRow->getShort(_nPos); - break; - case DataType::SMALLINT: - if ( _rValue.isSigned() ) - _rValue = _xRow->getShort(_nPos); - else - _rValue = _xRow->getInt(_nPos); - break; - case DataType::INTEGER: - if ( _rValue.isSigned() ) - _rValue = _xRow->getInt(_nPos); - else - _rValue = _xRow->getLong(_nPos); - break; - case DataType::CLOB: - _rValue = makeAny(_xRow->getCharacterStream(_nPos)); - _rValue.setTypeKind(DataType::CLOB); - break; - case DataType::BLOB: - _rValue = makeAny(_xRow->getBinaryStream(_nPos)); - _rValue.setTypeKind(DataType::BLOB); - break; - default: - bReadData = sal_False; - break; - } - if ( bReadData && _xRow->wasNull() ) - _rValue.setNull(); - _rValue.setTypeKind(_nType); -} -// ----------------------------------------------------------------------------- - - File [changed]: CacheSet.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/CacheSet.hxx?r1=1.16.130.1&r2=1.16.130.2 Delta lines: +2 -15 -------------------- --- CacheSet.hxx 29 Apr 2005 05:58:38 -0000 1.16.130.1 +++ CacheSet.hxx 29 Apr 2005 08:18:14 -0000 1.16.130.2 @@ -2,9 +2,9 @@ * * $RCSfile: CacheSet.hxx,v $ * - * $Revision: 1.16.130.1 $ + * $Revision: 1.16.130.2 $ * - * last change: $Author: oj $ $Date: 2005/04/29 05:58:38 $ + * last change: $Author: oj $ $Date: 2005/04/29 08:18:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -130,19 +130,6 @@ ,::rtl::OUString& _sParameter ,::std::list< sal_Int32>& _rOrgValues); void fillTableName(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xTable) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - - /** - fetchValue fetches a single value out of the current row - @param _nPos the current column position - @param _nType the type of the current column - @param _xRow the row where to fetch the data from - - @param _rValue out - value which was fetched - */ - void fetchValue(sal_Int32 _nPos, - sal_Int32 _nType, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow>& _xRow, - ::connectivity::ORowSetValue& _rValue); ::rtl::OUString getIdentifierQuoteString() const; public: File [changed]: KeySet.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/KeySet.cxx?r1=1.57.22.1&r2=1.57.22.2 Delta lines: +6 -6 ------------------- --- KeySet.cxx 29 Apr 2005 05:58:38 -0000 1.57.22.1 +++ KeySet.cxx 29 Apr 2005 08:18:15 -0000 1.57.22.2 @@ -2,9 +2,9 @@ * * $RCSfile: KeySet.cxx,v $ * - * $Revision: 1.57.22.1 $ + * $Revision: 1.57.22.2 $ * - * last change: $Author: oj $ $Date: 2005/04/29 05:58:38 $ + * last change: $Author: oj $ $Date: 2005/04/29 08:18:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -652,8 +652,8 @@ ::rtl::OUString sColumnName( xMd->getColumnName(i) ); #endif OColumnNamePos::iterator aFind = m_pKeyColumnNames->find(*aAutoIter); - if(aFind != m_pKeyColumnNames->end()) - fetchValue(i,aFind->second.second.first,xRow,(*_rInsertRow)[aFind->second.first]); + if ( aFind != m_pKeyColumnNames->end() ) + (*_rInsertRow)[aFind->second.first].fill(i,aFind->second.second.first,xRow); } bAutoValuesFetched = sal_True; } @@ -706,7 +706,7 @@ // we will only fetch values which are keycolumns OColumnNamePos::iterator aFind = m_pKeyColumnNames->find(*aAutoIter); if(aFind != m_pKeyColumnNames->end()) - fetchValue(i,aFind->second.second.first,xRow,(*_rInsertRow)[aFind->second.first]); + (*_rInsertRow)[aFind->second.first].fill(i,aFind->second.second.first,xRow); } } ::comphelper::disposeComponent(xStatement); @@ -1071,7 +1071,7 @@ for(;aPosIter != (*m_pKeyColumnNames).end();++aPosIter,++aIter) { const TPositionTypePair& rPair = aPosIter->second; - fetchValue(rPair.first,rPair.second.first,m_xDriverRow,*aIter); + aIter->fill(rPair.first,rPair.second.first,m_xDriverRow); } m_aKeyIter = m_aKeyMap.insert(OKeySetMatrix::value_type(m_aKeyMap.rbegin()->first+1,OKeySetValue(aKeyRow,0))).first; } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
