1dde7d3faSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3dde7d3faSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4dde7d3faSAndrew Rist * or more contributor license agreements. See the NOTICE file 5dde7d3faSAndrew Rist * distributed with this work for additional information 6dde7d3faSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7dde7d3faSAndrew Rist * to you under the Apache License, Version 2.0 (the 8dde7d3faSAndrew Rist * "License"); you may not use this file except in compliance 9dde7d3faSAndrew Rist * with the License. You may obtain a copy of the License at 10dde7d3faSAndrew Rist * 11dde7d3faSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12dde7d3faSAndrew Rist * 13dde7d3faSAndrew Rist * Unless required by applicable law or agreed to in writing, 14dde7d3faSAndrew Rist * software distributed under the License is distributed on an 15dde7d3faSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16dde7d3faSAndrew Rist * KIND, either express or implied. See the License for the 17dde7d3faSAndrew Rist * specific language governing permissions and limitations 18dde7d3faSAndrew Rist * under the License. 19dde7d3faSAndrew Rist * 20dde7d3faSAndrew Rist *************************************************************/ 21dde7d3faSAndrew Rist 22dde7d3faSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_comphelper.hxx" 26cdf0e10cSrcweir #include <comphelper/namedvaluecollection.hxx> 27cdf0e10cSrcweir 28cdf0e10cSrcweir /** === begin UNO includes === **/ 29cdf0e10cSrcweir #include <com/sun/star/beans/NamedValue.hpp> 30cdf0e10cSrcweir #include <com/sun/star/lang/IllegalArgumentException.hpp> 31cdf0e10cSrcweir #include <com/sun/star/beans/PropertyState.hpp> 32cdf0e10cSrcweir /** === end UNO includes === **/ 33cdf0e10cSrcweir 34cdf0e10cSrcweir #include <rtl/ustrbuf.hxx> 35cdf0e10cSrcweir #include <rtl/strbuf.hxx> 36cdf0e10cSrcweir #include <osl/diagnose.h> 37cdf0e10cSrcweir 38cdf0e10cSrcweir #include <hash_map> 39cdf0e10cSrcweir #include <functional> 40cdf0e10cSrcweir #include <algorithm> 41cdf0e10cSrcweir 42cdf0e10cSrcweir //........................................................................ 43cdf0e10cSrcweir namespace comphelper 44cdf0e10cSrcweir { 45cdf0e10cSrcweir //........................................................................ 46cdf0e10cSrcweir 47cdf0e10cSrcweir /** === begin UNO using === **/ 48cdf0e10cSrcweir using ::com::sun::star::uno::Any; 49cdf0e10cSrcweir using ::com::sun::star::uno::Sequence; 50cdf0e10cSrcweir using ::com::sun::star::beans::PropertyValue; 51cdf0e10cSrcweir using ::com::sun::star::beans::NamedValue; 52cdf0e10cSrcweir using ::com::sun::star::uno::Type; 53cdf0e10cSrcweir using ::com::sun::star::uno::cpp_acquire; 54cdf0e10cSrcweir using ::com::sun::star::uno::cpp_release; 55cdf0e10cSrcweir using ::com::sun::star::uno::cpp_queryInterface; 56cdf0e10cSrcweir using ::com::sun::star::lang::IllegalArgumentException; 57cdf0e10cSrcweir using ::com::sun::star::beans::NamedValue; 58cdf0e10cSrcweir using ::com::sun::star::beans::PropertyState_DIRECT_VALUE; 59cdf0e10cSrcweir /** === end UNO using === **/ 60cdf0e10cSrcweir 61cdf0e10cSrcweir //==================================================================== 62cdf0e10cSrcweir //= NamedValueCollection_Impl 63cdf0e10cSrcweir //==================================================================== 64cdf0e10cSrcweir typedef ::std::hash_map< ::rtl::OUString, Any, ::rtl::OUStringHash > NamedValueRepository; 65cdf0e10cSrcweir 66cdf0e10cSrcweir struct NamedValueCollection_Impl 67cdf0e10cSrcweir { 68cdf0e10cSrcweir NamedValueRepository aValues; 69cdf0e10cSrcweir }; 70cdf0e10cSrcweir 71cdf0e10cSrcweir //==================================================================== 72cdf0e10cSrcweir //= NamedValueCollection 73cdf0e10cSrcweir //==================================================================== 74cdf0e10cSrcweir //-------------------------------------------------------------------- NamedValueCollection()75cdf0e10cSrcweir NamedValueCollection::NamedValueCollection() 76cdf0e10cSrcweir :m_pImpl( new NamedValueCollection_Impl ) 77cdf0e10cSrcweir { 78cdf0e10cSrcweir } 79cdf0e10cSrcweir 80cdf0e10cSrcweir //-------------------------------------------------------------------- NamedValueCollection(const NamedValueCollection & _rCopySource)81cdf0e10cSrcweir NamedValueCollection::NamedValueCollection( const NamedValueCollection& _rCopySource ) 82cdf0e10cSrcweir :m_pImpl( new NamedValueCollection_Impl ) 83cdf0e10cSrcweir { 84cdf0e10cSrcweir *this = _rCopySource; 85cdf0e10cSrcweir } 86cdf0e10cSrcweir 87cdf0e10cSrcweir //-------------------------------------------------------------------- operator =(const NamedValueCollection & i_rCopySource)88cdf0e10cSrcweir NamedValueCollection& NamedValueCollection::operator=( const NamedValueCollection& i_rCopySource ) 89cdf0e10cSrcweir { 90cdf0e10cSrcweir m_pImpl->aValues = i_rCopySource.m_pImpl->aValues; 91cdf0e10cSrcweir return *this; 92cdf0e10cSrcweir } 93cdf0e10cSrcweir 94cdf0e10cSrcweir //-------------------------------------------------------------------- NamedValueCollection(const Any & _rElements)95cdf0e10cSrcweir NamedValueCollection::NamedValueCollection( const Any& _rElements ) 96cdf0e10cSrcweir :m_pImpl( new NamedValueCollection_Impl ) 97cdf0e10cSrcweir { 98cdf0e10cSrcweir impl_assign( _rElements ); 99cdf0e10cSrcweir } 100cdf0e10cSrcweir 101cdf0e10cSrcweir //-------------------------------------------------------------------- NamedValueCollection(const Sequence<Any> & _rArguments)102cdf0e10cSrcweir NamedValueCollection::NamedValueCollection( const Sequence< Any >& _rArguments ) 103cdf0e10cSrcweir :m_pImpl( new NamedValueCollection_Impl ) 104cdf0e10cSrcweir { 105cdf0e10cSrcweir impl_assign( _rArguments ); 106cdf0e10cSrcweir } 107cdf0e10cSrcweir 108cdf0e10cSrcweir //-------------------------------------------------------------------- NamedValueCollection(const Sequence<PropertyValue> & _rArguments)109cdf0e10cSrcweir NamedValueCollection::NamedValueCollection( const Sequence< PropertyValue >& _rArguments ) 110cdf0e10cSrcweir :m_pImpl( new NamedValueCollection_Impl ) 111cdf0e10cSrcweir { 112cdf0e10cSrcweir impl_assign( _rArguments ); 113cdf0e10cSrcweir } 114cdf0e10cSrcweir 115cdf0e10cSrcweir //-------------------------------------------------------------------- NamedValueCollection(const Sequence<NamedValue> & _rArguments)116cdf0e10cSrcweir NamedValueCollection::NamedValueCollection( const Sequence< NamedValue >& _rArguments ) 117cdf0e10cSrcweir :m_pImpl( new NamedValueCollection_Impl ) 118cdf0e10cSrcweir { 119cdf0e10cSrcweir impl_assign( _rArguments ); 120cdf0e10cSrcweir } 121cdf0e10cSrcweir 122cdf0e10cSrcweir //-------------------------------------------------------------------- ~NamedValueCollection()123cdf0e10cSrcweir NamedValueCollection::~NamedValueCollection() 124cdf0e10cSrcweir { 125cdf0e10cSrcweir } 126cdf0e10cSrcweir 1271b257601SMichael Stahl //-------------------------------------------------------------------- canExtractFrom(::com::sun::star::uno::Any const & i_value)1281b257601SMichael Stahl bool NamedValueCollection::canExtractFrom( ::com::sun::star::uno::Any const & i_value ) 1291b257601SMichael Stahl { 1301b257601SMichael Stahl Type const & aValueType = i_value.getValueType(); 1311b257601SMichael Stahl if ( aValueType.equals( ::cppu::UnoType< PropertyValue >::get() ) 1321b257601SMichael Stahl || aValueType.equals( ::cppu::UnoType< NamedValue >::get() ) 1331b257601SMichael Stahl || aValueType.equals( ::cppu::UnoType< Sequence< PropertyValue > >::get() ) 1341b257601SMichael Stahl || aValueType.equals( ::cppu::UnoType< Sequence< NamedValue > >::get() ) 1351b257601SMichael Stahl ) 1361b257601SMichael Stahl return true; 1371b257601SMichael Stahl return false; 1381b257601SMichael Stahl } 1391b257601SMichael Stahl 140cdf0e10cSrcweir //-------------------------------------------------------------------- merge(const NamedValueCollection & _rAdditionalValues,bool _bOverwriteExisting)141cdf0e10cSrcweir NamedValueCollection& NamedValueCollection::merge( const NamedValueCollection& _rAdditionalValues, bool _bOverwriteExisting ) 142cdf0e10cSrcweir { 143cdf0e10cSrcweir for ( NamedValueRepository::const_iterator namedValue = _rAdditionalValues.m_pImpl->aValues.begin(); 144cdf0e10cSrcweir namedValue != _rAdditionalValues.m_pImpl->aValues.end(); 145cdf0e10cSrcweir ++namedValue 146cdf0e10cSrcweir ) 147cdf0e10cSrcweir { 148cdf0e10cSrcweir if ( _bOverwriteExisting || !impl_has( namedValue->first ) ) 149cdf0e10cSrcweir impl_put( namedValue->first, namedValue->second ); 150cdf0e10cSrcweir } 151cdf0e10cSrcweir 152cdf0e10cSrcweir return *this; 153cdf0e10cSrcweir } 154cdf0e10cSrcweir 155cdf0e10cSrcweir //-------------------------------------------------------------------- size() const156cdf0e10cSrcweir size_t NamedValueCollection::size() const 157cdf0e10cSrcweir { 158cdf0e10cSrcweir return m_pImpl->aValues.size(); 159cdf0e10cSrcweir } 160cdf0e10cSrcweir 161cdf0e10cSrcweir //-------------------------------------------------------------------- empty() const162cdf0e10cSrcweir bool NamedValueCollection::empty() const 163cdf0e10cSrcweir { 164cdf0e10cSrcweir return m_pImpl->aValues.empty(); 165cdf0e10cSrcweir } 166cdf0e10cSrcweir 167cdf0e10cSrcweir //-------------------------------------------------------------------- getNames() const168cdf0e10cSrcweir ::std::vector< ::rtl::OUString > NamedValueCollection::getNames() const 169cdf0e10cSrcweir { 170cdf0e10cSrcweir ::std::vector< ::rtl::OUString > aNames( m_pImpl->aValues.size() ); 171cdf0e10cSrcweir ::std::transform( 172cdf0e10cSrcweir m_pImpl->aValues.begin(), 173cdf0e10cSrcweir m_pImpl->aValues.end(), 174cdf0e10cSrcweir aNames.begin(), 175cdf0e10cSrcweir ::std::select1st< NamedValueRepository::value_type >() 176cdf0e10cSrcweir ); 177cdf0e10cSrcweir return aNames; 178cdf0e10cSrcweir } 179cdf0e10cSrcweir 180cdf0e10cSrcweir //-------------------------------------------------------------------- impl_assign(const Any & i_rWrappedElements)181cdf0e10cSrcweir void NamedValueCollection::impl_assign( const Any& i_rWrappedElements ) 182cdf0e10cSrcweir { 183cdf0e10cSrcweir Sequence< NamedValue > aNamedValues; 184cdf0e10cSrcweir Sequence< PropertyValue > aPropertyValues; 185cdf0e10cSrcweir NamedValue aNamedValue; 186cdf0e10cSrcweir PropertyValue aPropertyValue; 187cdf0e10cSrcweir 188cdf0e10cSrcweir if ( i_rWrappedElements >>= aNamedValues ) 189cdf0e10cSrcweir impl_assign( aNamedValues ); 190cdf0e10cSrcweir else if ( i_rWrappedElements >>= aPropertyValues ) 191cdf0e10cSrcweir impl_assign( aPropertyValues ); 192cdf0e10cSrcweir else if ( i_rWrappedElements >>= aNamedValue ) 193cdf0e10cSrcweir impl_assign( Sequence< NamedValue >( &aNamedValue, 1 ) ); 194cdf0e10cSrcweir else if ( i_rWrappedElements >>= aPropertyValue ) 195cdf0e10cSrcweir impl_assign( Sequence< PropertyValue >( &aPropertyValue, 1 ) ); 196cdf0e10cSrcweir else 197cdf0e10cSrcweir OSL_ENSURE( !i_rWrappedElements.hasValue(), "NamedValueCollection::impl_assign(Any): unsupported type!" ); 198cdf0e10cSrcweir } 199cdf0e10cSrcweir 200cdf0e10cSrcweir //-------------------------------------------------------------------- impl_assign(const Sequence<Any> & _rArguments)201cdf0e10cSrcweir void NamedValueCollection::impl_assign( const Sequence< Any >& _rArguments ) 202cdf0e10cSrcweir { 203cdf0e10cSrcweir { 204cdf0e10cSrcweir NamedValueRepository aEmpty; 205cdf0e10cSrcweir m_pImpl->aValues.swap( aEmpty ); 206cdf0e10cSrcweir } 207cdf0e10cSrcweir 208cdf0e10cSrcweir PropertyValue aPropertyValue; 209cdf0e10cSrcweir NamedValue aNamedValue; 210cdf0e10cSrcweir 211cdf0e10cSrcweir const Any* pArgument = _rArguments.getConstArray(); 212cdf0e10cSrcweir const Any* pArgumentEnd = _rArguments.getConstArray() + _rArguments.getLength(); 213cdf0e10cSrcweir for ( ; pArgument != pArgumentEnd; ++pArgument ) 214cdf0e10cSrcweir { 215cdf0e10cSrcweir if ( *pArgument >>= aPropertyValue ) 216cdf0e10cSrcweir m_pImpl->aValues[ aPropertyValue.Name ] = aPropertyValue.Value; 217cdf0e10cSrcweir else if ( *pArgument >>= aNamedValue ) 218cdf0e10cSrcweir m_pImpl->aValues[ aNamedValue.Name ] = aNamedValue.Value; 219cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 0 220cdf0e10cSrcweir else if ( pArgument->hasValue() ) 221cdf0e10cSrcweir { 222cdf0e10cSrcweir ::rtl::OStringBuffer message; 223cdf0e10cSrcweir message.append( "NamedValueCollection::impl_assign: encountered a value type which I cannot handle:\n" ); 224cdf0e10cSrcweir message.append( ::rtl::OUStringToOString( pArgument->getValueTypeName(), RTL_TEXTENCODING_ASCII_US ) ); 225*24c56ab9SHerbert Dürr OSL_ENSURE( false, message.getStr() ); 226cdf0e10cSrcweir } 227cdf0e10cSrcweir #endif 228cdf0e10cSrcweir } 229cdf0e10cSrcweir } 230cdf0e10cSrcweir 231cdf0e10cSrcweir //-------------------------------------------------------------------- impl_assign(const Sequence<PropertyValue> & _rArguments)232cdf0e10cSrcweir void NamedValueCollection::impl_assign( const Sequence< PropertyValue >& _rArguments ) 233cdf0e10cSrcweir { 234cdf0e10cSrcweir { 235cdf0e10cSrcweir NamedValueRepository aEmpty; 236cdf0e10cSrcweir m_pImpl->aValues.swap( aEmpty ); 237cdf0e10cSrcweir } 238cdf0e10cSrcweir 239cdf0e10cSrcweir const PropertyValue* pArgument = _rArguments.getConstArray(); 240cdf0e10cSrcweir const PropertyValue* pArgumentEnd = _rArguments.getConstArray() + _rArguments.getLength(); 241cdf0e10cSrcweir for ( ; pArgument != pArgumentEnd; ++pArgument ) 242cdf0e10cSrcweir m_pImpl->aValues[ pArgument->Name ] = pArgument->Value; 243cdf0e10cSrcweir } 244cdf0e10cSrcweir 245cdf0e10cSrcweir //-------------------------------------------------------------------- impl_assign(const Sequence<NamedValue> & _rArguments)246cdf0e10cSrcweir void NamedValueCollection::impl_assign( const Sequence< NamedValue >& _rArguments ) 247cdf0e10cSrcweir { 248cdf0e10cSrcweir { 249cdf0e10cSrcweir NamedValueRepository aEmpty; 250cdf0e10cSrcweir m_pImpl->aValues.swap( aEmpty ); 251cdf0e10cSrcweir } 252cdf0e10cSrcweir 253cdf0e10cSrcweir const NamedValue* pArgument = _rArguments.getConstArray(); 254cdf0e10cSrcweir const NamedValue* pArgumentEnd = _rArguments.getConstArray() + _rArguments.getLength(); 255cdf0e10cSrcweir for ( ; pArgument != pArgumentEnd; ++pArgument ) 256cdf0e10cSrcweir m_pImpl->aValues[ pArgument->Name ] = pArgument->Value; 257cdf0e10cSrcweir } 258cdf0e10cSrcweir 259cdf0e10cSrcweir //-------------------------------------------------------------------- get_ensureType(const::rtl::OUString & _rValueName,void * _pValueLocation,const Type & _rExpectedValueType) const260cdf0e10cSrcweir bool NamedValueCollection::get_ensureType( const ::rtl::OUString& _rValueName, void* _pValueLocation, const Type& _rExpectedValueType ) const 261cdf0e10cSrcweir { 262cdf0e10cSrcweir NamedValueRepository::const_iterator pos = m_pImpl->aValues.find( _rValueName ); 263cdf0e10cSrcweir if ( pos != m_pImpl->aValues.end() ) 264cdf0e10cSrcweir { 265cdf0e10cSrcweir if ( uno_type_assignData( 266cdf0e10cSrcweir _pValueLocation, _rExpectedValueType.getTypeLibType(), 267cdf0e10cSrcweir const_cast< void* >( pos->second.getValue() ), pos->second.getValueType().getTypeLibType(), 268cdf0e10cSrcweir reinterpret_cast< uno_QueryInterfaceFunc >( cpp_queryInterface ), 269cdf0e10cSrcweir reinterpret_cast< uno_AcquireFunc >( cpp_acquire ), 270cdf0e10cSrcweir reinterpret_cast< uno_ReleaseFunc >( cpp_release ) 271cdf0e10cSrcweir ) ) 272cdf0e10cSrcweir // argument exists, and could be extracted 273cdf0e10cSrcweir return true; 274cdf0e10cSrcweir 275cdf0e10cSrcweir // argument exists, but is of wrong type 276cdf0e10cSrcweir ::rtl::OUStringBuffer aBuffer; 277cdf0e10cSrcweir aBuffer.appendAscii( "Invalid value type for '" ); 278cdf0e10cSrcweir aBuffer.append ( _rValueName ); 279cdf0e10cSrcweir aBuffer.appendAscii( "'.\nExpected: " ); 280cdf0e10cSrcweir aBuffer.append ( _rExpectedValueType.getTypeName() ); 281cdf0e10cSrcweir aBuffer.appendAscii( "\nFound: " ); 282cdf0e10cSrcweir aBuffer.append ( pos->second.getValueType().getTypeName() ); 283cdf0e10cSrcweir throw IllegalArgumentException( aBuffer.makeStringAndClear(), NULL, 0 ); 284cdf0e10cSrcweir } 285cdf0e10cSrcweir 286cdf0e10cSrcweir // argument does not exist 287cdf0e10cSrcweir return false; 288cdf0e10cSrcweir } 289cdf0e10cSrcweir 290cdf0e10cSrcweir //-------------------------------------------------------------------- impl_get(const::rtl::OUString & _rValueName) const291cdf0e10cSrcweir const Any& NamedValueCollection::impl_get( const ::rtl::OUString& _rValueName ) const 292cdf0e10cSrcweir { 293cdf0e10cSrcweir NamedValueRepository::const_iterator pos = m_pImpl->aValues.find( _rValueName ); 294cdf0e10cSrcweir if ( pos != m_pImpl->aValues.end() ) 295cdf0e10cSrcweir return pos->second; 296cdf0e10cSrcweir 297cdf0e10cSrcweir static Any aEmptyDefault; 298cdf0e10cSrcweir return aEmptyDefault; 299cdf0e10cSrcweir } 300cdf0e10cSrcweir 301cdf0e10cSrcweir //-------------------------------------------------------------------- impl_has(const::rtl::OUString & _rValueName) const302cdf0e10cSrcweir bool NamedValueCollection::impl_has( const ::rtl::OUString& _rValueName ) const 303cdf0e10cSrcweir { 304cdf0e10cSrcweir NamedValueRepository::const_iterator pos = m_pImpl->aValues.find( _rValueName ); 305cdf0e10cSrcweir return ( pos != m_pImpl->aValues.end() ); 306cdf0e10cSrcweir } 307cdf0e10cSrcweir 308cdf0e10cSrcweir //-------------------------------------------------------------------- impl_put(const::rtl::OUString & _rValueName,const Any & _rValue)309cdf0e10cSrcweir bool NamedValueCollection::impl_put( const ::rtl::OUString& _rValueName, const Any& _rValue ) 310cdf0e10cSrcweir { 311cdf0e10cSrcweir bool bHas = impl_has( _rValueName ); 312cdf0e10cSrcweir m_pImpl->aValues[ _rValueName ] = _rValue; 313cdf0e10cSrcweir return bHas; 314cdf0e10cSrcweir } 315cdf0e10cSrcweir 316cdf0e10cSrcweir //-------------------------------------------------------------------- impl_remove(const::rtl::OUString & _rValueName)317cdf0e10cSrcweir bool NamedValueCollection::impl_remove( const ::rtl::OUString& _rValueName ) 318cdf0e10cSrcweir { 319cdf0e10cSrcweir NamedValueRepository::iterator pos = m_pImpl->aValues.find( _rValueName ); 320cdf0e10cSrcweir if ( pos == m_pImpl->aValues.end() ) 321cdf0e10cSrcweir return false; 322cdf0e10cSrcweir m_pImpl->aValues.erase( pos ); 323cdf0e10cSrcweir return true; 324cdf0e10cSrcweir } 325cdf0e10cSrcweir 326cdf0e10cSrcweir //-------------------------------------------------------------------- 327cdf0e10cSrcweir namespace 328cdf0e10cSrcweir { 329cdf0e10cSrcweir struct Value2PropertyValue : public ::std::unary_function< NamedValueRepository::value_type, PropertyValue > 330cdf0e10cSrcweir { operator ()comphelper::__anoned7bc07f0111::Value2PropertyValue331cdf0e10cSrcweir PropertyValue operator()( const NamedValueRepository::value_type& _rValue ) 332cdf0e10cSrcweir { 333cdf0e10cSrcweir return PropertyValue( 334cdf0e10cSrcweir _rValue.first, 0, _rValue.second, PropertyState_DIRECT_VALUE ); 335cdf0e10cSrcweir } 336cdf0e10cSrcweir }; 337cdf0e10cSrcweir 338cdf0e10cSrcweir struct Value2NamedValue : public ::std::unary_function< NamedValueRepository::value_type, NamedValue > 339cdf0e10cSrcweir { operator ()comphelper::__anoned7bc07f0111::Value2NamedValue340cdf0e10cSrcweir NamedValue operator()( const NamedValueRepository::value_type& _rValue ) 341cdf0e10cSrcweir { 342cdf0e10cSrcweir return NamedValue( _rValue.first, _rValue.second ); 343cdf0e10cSrcweir } 344cdf0e10cSrcweir }; 345cdf0e10cSrcweir } 346cdf0e10cSrcweir 347cdf0e10cSrcweir //-------------------------------------------------------------------- operator >>=(Sequence<PropertyValue> & _out_rValues) const348cdf0e10cSrcweir sal_Int32 NamedValueCollection::operator >>= ( Sequence< PropertyValue >& _out_rValues ) const 349cdf0e10cSrcweir { 350cdf0e10cSrcweir _out_rValues.realloc( m_pImpl->aValues.size() ); 351cdf0e10cSrcweir ::std::transform( m_pImpl->aValues.begin(), m_pImpl->aValues.end(), _out_rValues.getArray(), Value2PropertyValue() ); 352cdf0e10cSrcweir return _out_rValues.getLength(); 353cdf0e10cSrcweir } 354cdf0e10cSrcweir 355cdf0e10cSrcweir //-------------------------------------------------------------------- operator >>=(Sequence<NamedValue> & _out_rValues) const356cdf0e10cSrcweir sal_Int32 NamedValueCollection::operator >>= ( Sequence< NamedValue >& _out_rValues ) const 357cdf0e10cSrcweir { 358cdf0e10cSrcweir _out_rValues.realloc( m_pImpl->aValues.size() ); 359cdf0e10cSrcweir ::std::transform( m_pImpl->aValues.begin(), m_pImpl->aValues.end(), _out_rValues.getArray(), Value2NamedValue() ); 360cdf0e10cSrcweir return _out_rValues.getLength(); 361cdf0e10cSrcweir } 362cdf0e10cSrcweir 363cdf0e10cSrcweir //........................................................................ 364cdf0e10cSrcweir } // namespace comphelper 365cdf0e10cSrcweir //........................................................................ 366cdf0e10cSrcweir 367