summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2008-06-06 13:35:23 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2008-06-06 13:35:23 +0000
commit297b2fd5412fa92c79deb68f01b1c37268e1a209 (patch)
tree3af0079d81f9a3977458a6f5144a3da1a4efc9a7
parentf9035343b1b276eb46601168832e01a11e179293 (diff)
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
-rw-r--r--comphelper/inc/comphelper/namedvaluecollection.hxx26
1 files changed, 25 insertions, 1 deletions
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 <memory>
+#include <algorithm>
//........................................................................
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;
+ }
};
//........................................................................