diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-03-06 19:00:01 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-03-06 19:00:01 +0000 |
commit | 48328e7989ea79d3d0badcfac3ab5f8a0622aec9 (patch) | |
tree | 793b011fcbd9c560977399211316ad36afd8d5e0 /comphelper | |
parent | 64b0d617700b2bbfe6852118ebd4ab8476af73d9 (diff) |
INTEGRATION: CWS odbmacros2 (1.8.10); FILE MERGED
2008/01/30 13:17:33 fs 1.8.10.2: #i49133# new ctor taking an Any
2007/12/06 13:31:20 fs 1.8.10.1: #i49133# operator >>= is const
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/namedvaluecollection.cxx | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/comphelper/source/misc/namedvaluecollection.cxx b/comphelper/source/misc/namedvaluecollection.cxx index c0d924b52a67..3ee50a9d3f51 100644 --- a/comphelper/source/misc/namedvaluecollection.cxx +++ b/comphelper/source/misc/namedvaluecollection.cxx @@ -4,9 +4,9 @@ * * $RCSfile: namedvaluecollection.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: ihi $ $Date: 2007-11-21 16:53:08 $ + * last change: $Author: kz $ $Date: 2008-03-06 20:00:01 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -92,6 +92,27 @@ namespace comphelper } //-------------------------------------------------------------------- + NamedValueCollection::NamedValueCollection( const Any& _rElements ) + :m_pImpl( new NamedValueCollection_Impl ) + { + Sequence< NamedValue > aNamedValues; + Sequence< PropertyValue > aPropertyValues; + NamedValue aNamedValue; + PropertyValue aPropertyValue; + + if ( _rElements >>= aNamedValues ) + impl_assign( aNamedValues ); + else if ( _rElements >>= aPropertyValues ) + impl_assign( aPropertyValues ); + else if ( _rElements >>= aNamedValue ) + impl_assign( Sequence< NamedValue >( &aNamedValue, 1 ) ); + else if ( _rElements >>= aPropertyValue ) + impl_assign( Sequence< PropertyValue >( &aPropertyValue, 1 ) ); + else + OSL_ENSURE( false, "NamedValueCollection::NamedValueCollection(Any): unsupported type!" ); + } + + //-------------------------------------------------------------------- NamedValueCollection::NamedValueCollection( const Sequence< Any >& _rArguments ) :m_pImpl( new NamedValueCollection_Impl ) { @@ -270,7 +291,7 @@ namespace comphelper } //-------------------------------------------------------------------- - sal_Int32 NamedValueCollection::operator >>= ( Sequence< PropertyValue >& _out_rValues ) + sal_Int32 NamedValueCollection::operator >>= ( Sequence< PropertyValue >& _out_rValues ) const { _out_rValues.realloc( m_pImpl->aValues.size() ); ::std::transform( m_pImpl->aValues.begin(), m_pImpl->aValues.end(), _out_rValues.getArray(), Value2PropertyValue() ); @@ -278,7 +299,7 @@ namespace comphelper } //-------------------------------------------------------------------- - sal_Int32 NamedValueCollection::operator >>= ( Sequence< NamedValue >& _out_rValues ) + sal_Int32 NamedValueCollection::operator >>= ( Sequence< NamedValue >& _out_rValues ) const { _out_rValues.realloc( m_pImpl->aValues.size() ); ::std::transform( m_pImpl->aValues.begin(), m_pImpl->aValues.end(), _out_rValues.getArray(), Value2NamedValue() ); |