diff options
author | Ocke Janssen <oj@openoffice.org> | 2001-10-18 12:24:06 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2001-10-18 12:24:06 +0000 |
commit | 630b707f5229efa7d6278deab6d860697bc61e86 (patch) | |
tree | 5d444a5614367f1acf5e5add6171bde78cfce5f9 /connectivity/source/drivers/flat | |
parent | f1381d4c7283a89fe241eebd59476cdd53f0b186 (diff) |
#93302# correct getTypes
Diffstat (limited to 'connectivity/source/drivers/flat')
-rw-r--r-- | connectivity/source/drivers/flat/EResultSet.cxx | 12 | ||||
-rw-r--r-- | connectivity/source/drivers/flat/ETable.cxx | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/connectivity/source/drivers/flat/EResultSet.cxx b/connectivity/source/drivers/flat/EResultSet.cxx index 3b95a416568b..8f0d564ee332 100644 --- a/connectivity/source/drivers/flat/EResultSet.cxx +++ b/connectivity/source/drivers/flat/EResultSet.cxx @@ -2,9 +2,9 @@ * * $RCSfile: EResultSet.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: hr $ $Date: 2001-10-18 12:17:36 $ + * last change: $Author: oj $ $Date: 2001-10-18 13:17:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -135,20 +135,20 @@ Any SAL_CALL OFlatResultSet::queryInterface( const Type & rType ) throw(RuntimeE Sequence< Type > SAL_CALL OFlatResultSet::getTypes( ) throw( RuntimeException) { Sequence< Type > aTypes = OResultSet::getTypes(); - Sequence< Type > aRet(aTypes.getLength()-2); + ::std::vector<Type> aOwnTypes; + aOwnTypes.reserve(aTypes.getLength()); const Type* pBegin = aTypes.getConstArray(); const Type* pEnd = pBegin + aTypes.getLength(); - sal_Int32 i=0; for(;pBegin != pEnd;++pBegin) { if(!(*pBegin == ::getCppuType((const Reference<XDeleteRows>*)0) || *pBegin == ::getCppuType((const Reference<XResultSetUpdate>*)0) || *pBegin == ::getCppuType((const Reference<XRowUpdate>*)0))) { - aRet.getArray()[i++] = *pBegin; + aOwnTypes.push_back(*pBegin); } } - + Sequence< Type > aRet(aOwnTypes.begin(),aOwnTypes.size()); return ::comphelper::concatSequences(aRet,OFlatResultSet_BASE::getTypes()); } diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index 508d65a641a3..2ea6d4fffde2 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ETable.cxx,v $ * - * $Revision: 1.35 $ + * $Revision: 1.36 $ * - * last change: $Author: oj $ $Date: 2001-09-25 13:12:50 $ + * last change: $Author: oj $ $Date: 2001-10-18 13:17:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -501,10 +501,10 @@ void SAL_CALL OFlatTable::disposing(void) Sequence< Type > SAL_CALL OFlatTable::getTypes( ) throw(RuntimeException) { Sequence< Type > aTypes = OTable_TYPEDEF::getTypes(); - Sequence< Type > aRet(aTypes.getLength()-4); + ::std::vector<Type> aOwnTypes; + aOwnTypes.reserve(aTypes.getLength()); const Type* pBegin = aTypes.getConstArray(); const Type* pEnd = pBegin + aTypes.getLength(); - sal_Int32 i=0; for(;pBegin != pEnd;++pBegin) { if(!(*pBegin == ::getCppuType((const Reference<XKeysSupplier>*)0) || @@ -513,10 +513,10 @@ Sequence< Type > SAL_CALL OFlatTable::getTypes( ) throw(RuntimeException) *pBegin == ::getCppuType((const Reference<XAlterTable>*)0) || *pBegin == ::getCppuType((const Reference<XDataDescriptorFactory>*)0))) { - aRet.getArray()[i++] = *pBegin; + aOwnTypes.push_back(*pBegin); } } - return aRet; + return Sequence< Type >(aOwnTypes.begin(),aOwnTypes.size()); } // ------------------------------------------------------------------------- |