summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Dürr <hdu@apache.org>2013-05-28 09:52:00 +0000
committerHerbert Dürr <hdu@apache.org>2013-05-28 09:52:00 +0000
commita599e5242751057537c3de6eb58ceff2a173580e (patch)
treed9edb10273df17b5d717bfa101be6aafdb7eb01a
parent5ed6de1d9a29e061d115bca0805680d4ecd66518 (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
-rw-r--r--comphelper/inc/comphelper/namedvaluecollection.hxx12
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;
}
};