Kaydet (Commit) 410003a3 authored tarafından Ivo Hinkelmann's avatar Ivo Hinkelmann

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 >
üst cab98167
......@@ -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,
......
......@@ -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
......@@ -94,6 +91,13 @@ namespace comphelper
impl_assign( _rArguments );
}
//--------------------------------------------------------------------
NamedValueCollection::NamedValueCollection( const Sequence< PropertyValue >& _rArguments )
:m_pImpl( new NamedValueCollection_Impl )
{
impl_assign( _rArguments );
}
//--------------------------------------------------------------------
NamedValueCollection::~NamedValueCollection()
{
......@@ -123,6 +127,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
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment