Kaydet (Commit) 6526fda9 authored tarafından Herbert Dürr's avatar Herbert Dürr Kaydeden (comit) Caolán McNamara

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 a599e524)

Conflicts:
	comphelper/inc/comphelper/namedvaluecollection.hxx

Change-Id: I3233116bfb862f6cda038541ffecac492623611c
üst 07b348f5
......@@ -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;
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment