diff options
author | Herbert Dürr <hdu@apache.org> | 2013-05-28 09:52:00 +0000 |
---|---|---|
committer | Herbert Dürr <hdu@apache.org> | 2013-05-28 09:52:00 +0000 |
commit | a599e5242751057537c3de6eb58ceff2a173580e (patch) | |
tree | d9edb10273df17b5d717bfa101be6aafdb7eb01a | |
parent | 5ed6de1d9a29e061d115bca0805680d4ecd66518 (diff) |
#i122378# avoid non-iterator bound std::transform() in namedvaluecollection.hxx
in some build environments the use of std::transform() with plain pointers as
input iterators results in many warnings about how unsafe such a construct is.
The warnings could be suppressed e.g. on MSVC with the SCL_SECURE_NO_WARNINGS
define. Open coding the construct makes it cleaner and more debugable though.
Notes
merged as: 6526fda99f9133736906f326dde5cf48f967fcee
-rw-r--r-- | comphelper/inc/comphelper/namedvaluecollection.hxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/comphelper/inc/comphelper/namedvaluecollection.hxx b/comphelper/inc/comphelper/namedvaluecollection.hxx index 04386ec5b7c9..d22446b8eaf1 100644 --- a/comphelper/inc/comphelper/namedvaluecollection.hxx +++ b/comphelper/inc/comphelper/namedvaluecollection.hxx @@ -353,12 +353,12 @@ namespace comphelper ::com::sun::star::uno::Sequence< VALUE_TYPE > aValues; *this >>= aValues; ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aWrappedValues( aValues.getLength() ); - ::std::transform( - aValues.getConstArray(), - aValues.getConstArray() + aValues.getLength(), - aWrappedValues.getArray(), - ::com::sun::star::uno::makeAny< VALUE_TYPE > - ); + + ::com::sun::star::uno::Any* pO = aWrappedValues.getArray(); + const VALUE_TYPE* pV = aValues.getConstArray(); + const sal_Int32 nLen = aValues.getLength(); + for( sal_Int32 i = 0; i < nLen; ++i ) + *(pO++) = ::com::sun::star::uno::makeAny<VALUE_TYPE>( *(pV++) ); return aWrappedValues; } }; |