openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject svn commit: r1486840 - /openoffice/trunk/main/comphelper/inc/comphelper/namedvaluecollection.hxx
Date Tue, 28 May 2013 09:52:00 GMT
Author: hdu
Date: Tue May 28 09:52:00 2013
New Revision: 1486840

URL: http://svn.apache.org/r1486840
Log:
#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.

Modified:
    openoffice/trunk/main/comphelper/inc/comphelper/namedvaluecollection.hxx

Modified: openoffice/trunk/main/comphelper/inc/comphelper/namedvaluecollection.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/comphelper/inc/comphelper/namedvaluecollection.hxx?rev=1486840&r1=1486839&r2=1486840&view=diff
==============================================================================
--- openoffice/trunk/main/comphelper/inc/comphelper/namedvaluecollection.hxx (original)
+++ openoffice/trunk/main/comphelper/inc/comphelper/namedvaluecollection.hxx Tue May 28 09:52:00
2013
@@ -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;
         }
     };



Mime
View raw message