diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2006-08-04 12:58:47 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2006-08-04 12:58:47 +0000 |
commit | 410003a315a1080e7dc5aad118df827e951d49e9 (patch) | |
tree | 661632f167c327e4b69e04f3ad81810d4c0df850 /comphelper | |
parent | cab981674e055e5f9286aa9167abbd9fbf79f0d3 (diff) |
INTEGRATION: CWS dba204c (1.2.14); FILE MERGED
2006/07/26 08:29:55 fs 1.2.14.1: #i67595# added construction from Sequence< PropertyValue >
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/inc/comphelper/namedvaluecollection.hxx | 22 | ||||
-rw-r--r-- | comphelper/source/misc/namedvaluecollection.cxx | 28 |
2 files changed, 42 insertions, 8 deletions
diff --git a/comphelper/inc/comphelper/namedvaluecollection.hxx b/comphelper/inc/comphelper/namedvaluecollection.hxx index 9351a347db0f..3457682c8b29 100644 --- a/comphelper/inc/comphelper/namedvaluecollection.hxx +++ b/comphelper/inc/comphelper/namedvaluecollection.hxx @@ -4,9 +4,9 @@ * * $RCSfile: namedvaluecollection.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: obo $ $Date: 2006-07-10 16:15:07 $ + * last change: $Author: ihi $ $Date: 2006-08-04 13:58:34 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -47,6 +47,9 @@ #ifndef _COM_SUN_STAR_UNO_ANY_HXX_ #include <com/sun/star/uno/Any.hxx> #endif +#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ +#include <com/sun/star/beans/PropertyValue.hpp> +#endif /** === end UNO includes === **/ #include <memory> @@ -75,9 +78,21 @@ namespace comphelper a sequence of Any's containing either PropertyValue's or NamedValue's. */ NamedValueCollection( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments ); + + /** constructs a collection + @param _rArguments + a sequence of PropertyValues's + */ + NamedValueCollection( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArguments ); + ~NamedValueCollection(); - void assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments ) + inline void assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments ) + { + impl_assign( _rArguments ); + } + + inline void assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArguments ) { impl_assign( _rArguments ); } @@ -145,6 +160,7 @@ namespace comphelper private: void impl_assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments ); + void impl_assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArguments ); bool getIfExists_ensureType( const ::rtl::OUString& _rValueName, diff --git a/comphelper/source/misc/namedvaluecollection.cxx b/comphelper/source/misc/namedvaluecollection.cxx index f90e6d018554..e3061b99fb8a 100644 --- a/comphelper/source/misc/namedvaluecollection.cxx +++ b/comphelper/source/misc/namedvaluecollection.cxx @@ -4,9 +4,9 @@ * * $RCSfile: namedvaluecollection.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: obo $ $Date: 2006-07-10 16:15:46 $ + * last change: $Author: ihi $ $Date: 2006-08-04 13:58:47 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -38,9 +38,6 @@ #endif /** === begin UNO includes === **/ -#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ -#include <com/sun/star/beans/PropertyValue.hpp> -#endif #ifndef _COM_SUN_STAR_BEANS_NAMEDVALUE_HPP_ #include <com/sun/star/beans/NamedValue.hpp> #endif @@ -95,6 +92,13 @@ namespace comphelper } //-------------------------------------------------------------------- + NamedValueCollection::NamedValueCollection( const Sequence< PropertyValue >& _rArguments ) + :m_pImpl( new NamedValueCollection_Impl ) + { + impl_assign( _rArguments ); + } + + //-------------------------------------------------------------------- NamedValueCollection::~NamedValueCollection() { } @@ -124,6 +128,20 @@ namespace comphelper } //-------------------------------------------------------------------- + void NamedValueCollection::impl_assign( const Sequence< PropertyValue >& _rArguments ) + { + { + NamedValueRepository empty; + m_pImpl->aValues.swap( empty ); + } + + const PropertyValue* pArgument = _rArguments.getConstArray(); + const PropertyValue* pArgumentEnd = _rArguments.getConstArray() + _rArguments.getLength(); + for ( ; pArgument != pArgumentEnd; ++pArgument ) + m_pImpl->aValues[ pArgument->Name ] = pArgument->Value; + } + + //-------------------------------------------------------------------- bool NamedValueCollection::getIfExists_ensureType( const ::rtl::OUString& _rValueName, void* _pValueLocation, const Type& _rExpectedValueType ) const { NamedValueRepository::const_iterator pos = m_pImpl->aValues.find( _rValueName ); |