Kaydet (Commit) a599e524 authored tarafından Herbert Dürr's avatar Herbert Dürr

#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.
üst 5ed6de1d
...@@ -353,12 +353,12 @@ namespace comphelper ...@@ -353,12 +353,12 @@ namespace comphelper
::com::sun::star::uno::Sequence< VALUE_TYPE > aValues; ::com::sun::star::uno::Sequence< VALUE_TYPE > aValues;
*this >>= aValues; *this >>= aValues;
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aWrappedValues( aValues.getLength() ); ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aWrappedValues( aValues.getLength() );
::std::transform(
aValues.getConstArray(), ::com::sun::star::uno::Any* pO = aWrappedValues.getArray();
aValues.getConstArray() + aValues.getLength(), const VALUE_TYPE* pV = aValues.getConstArray();
aWrappedValues.getArray(), const sal_Int32 nLen = aValues.getLength();
::com::sun::star::uno::makeAny< VALUE_TYPE > for( sal_Int32 i = 0; i < nLen; ++i )
); *(pO++) = ::com::sun::star::uno::makeAny<VALUE_TYPE>( *(pV++) );
return aWrappedValues; 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