summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Dürr <hdu@apache.org>2013-05-28 09:52:00 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-05-29 10:03:26 +0100
commit6526fda99f9133736906f326dde5cf48f967fcee (patch)
tree481336c35a4f7a8ef54788d4e2830c5073f9a137
parent07b348f51d4af8b6cf78deaf80f5e05bc550e019 (diff)
Related: #i122378# avoid non-iterator bound std::transform()
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. (cherry picked from commit a599e5242751057537c3de6eb58ceff2a173580e) Conflicts: comphelper/inc/comphelper/namedvaluecollection.hxx Change-Id: I3233116bfb862f6cda038541ffecac492623611c
-rw-r--r--include/comphelper/namedvaluecollection.hxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/comphelper/namedvaluecollection.hxx b/include/comphelper/namedvaluecollection.hxx
index 93b53dd14c6c..26b2760aeeb5 100644
--- a/include/comphelper/namedvaluecollection.hxx
+++ b/include/comphelper/namedvaluecollection.hxx
@@ -356,13 +356,13 @@ 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() );
- ::com::sun::star::uno::Any (* const makeAny)(const VALUE_TYPE&) = ::com::sun::star::uno::makeAny< VALUE_TYPE >;
- ::std::transform(
- aValues.getConstArray(),
- aValues.getConstArray() + aValues.getLength(),
- aWrappedValues.getArray(),
- makeAny
- );
+
+ ::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;
}
};