From 297b2fd5412fa92c79deb68f01b1c37268e1a209 Mon Sep 17 00:00:00 2001 From: RĂ¼diger Timm Date: Fri, 6 Jun 2008 13:35:23 +0000 Subject: INTEGRATION: CWS dba30c (1.10.2); FILE MERGED 2008/05/13 06:51:16 fs 1.10.2.1: joining changes from CWS odbmacros3 to CWS dba30c 2008/05/07 08:17:14 fs 1.9.6.1: #i49133# +wrap: wrap into a sequence of Anys 2008/05/09 09:28:56 fs 1.9.6.2: RESYNC: (1.9-1.10); FILE MERGED --- comphelper/inc/comphelper/namedvaluecollection.hxx | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/comphelper/inc/comphelper/namedvaluecollection.hxx b/comphelper/inc/comphelper/namedvaluecollection.hxx index 0a8d87cb9ee4..4b6c779ef3bc 100644 --- a/comphelper/inc/comphelper/namedvaluecollection.hxx +++ b/comphelper/inc/comphelper/namedvaluecollection.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: namedvaluecollection.hxx,v $ - * $Revision: 1.10 $ + * $Revision: 1.11 $ * * This file is part of OpenOffice.org. * @@ -41,6 +41,7 @@ /** === end UNO includes === **/ #include +#include //........................................................................ namespace comphelper @@ -280,6 +281,14 @@ namespace comphelper return aValues; } + /** returns a Sequence< Any >, as to be used for i.e. XInitialization::initialize + */ + inline ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > + getWrappedPropertyValues() const + { + return impl_wrap< ::com::sun::star::beans::PropertyValue >(); + } + /** transforms the collection into a sequence of NamedValues */ inline ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > @@ -309,6 +318,21 @@ namespace comphelper bool impl_put( const ::rtl::OUString& _rValueName, const ::com::sun::star::uno::Any& _rValue ); bool impl_remove( const ::rtl::OUString& _rValueName ); + + template< class VALUE_TYPE > + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > impl_wrap() const + { + ::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 > + ); + return aWrappedValues; + } }; //........................................................................ -- cgit v1.2.3