1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: propertyvalueset.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_ucbhelper.hxx"
34 /**************************************************************************
36 **************************************************************************
38 *************************************************************************/
43 #include <com/sun/star/beans/Property.hpp>
44 #include <com/sun/star/beans/XPropertyAccess.hpp>
45 #include <com/sun/star/beans/XPropertySet.hpp>
46 #include <com/sun/star/beans/XPropertySetInfo.hpp>
47 #include <com/sun/star/script/XTypeConverter.hpp>
49 #include "osl/diagnose.h"
50 #include "osl/mutex.hxx"
51 #include <ucbhelper/propertyvalueset.hxx>
53 using namespace com::sun::star::beans
;
54 using namespace com::sun::star::container
;
55 using namespace com::sun::star::io
;
56 using namespace com::sun::star::lang
;
57 using namespace com::sun::star::script
;
58 using namespace com::sun::star::sdbc
;
59 using namespace com::sun::star::uno
;
60 using namespace com::sun::star::util
;
63 namespace ucbhelper_impl
66 //=========================================================================
70 //=========================================================================
72 const sal_uInt32 NO_VALUE_SET
= 0x00000000;
73 const sal_uInt32 STRING_VALUE_SET
= 0x00000001;
74 const sal_uInt32 BOOLEAN_VALUE_SET
= 0x00000002;
75 const sal_uInt32 BYTE_VALUE_SET
= 0x00000004;
76 const sal_uInt32 SHORT_VALUE_SET
= 0x00000008;
77 const sal_uInt32 INT_VALUE_SET
= 0x00000010;
78 const sal_uInt32 LONG_VALUE_SET
= 0x00000020;
79 const sal_uInt32 FLOAT_VALUE_SET
= 0x00000040;
80 const sal_uInt32 DOUBLE_VALUE_SET
= 0x00000080;
81 const sal_uInt32 BYTES_VALUE_SET
= 0x00000100;
82 const sal_uInt32 DATE_VALUE_SET
= 0x00000200;
83 const sal_uInt32 TIME_VALUE_SET
= 0x00000400;
84 const sal_uInt32 TIMESTAMP_VALUE_SET
= 0x00000800;
85 const sal_uInt32 BINARYSTREAM_VALUE_SET
= 0x00001000;
86 const sal_uInt32 CHARACTERSTREAM_VALUE_SET
= 0x00002000;
87 const sal_uInt32 REF_VALUE_SET
= 0x00004000;
88 const sal_uInt32 BLOB_VALUE_SET
= 0x00008000;
89 const sal_uInt32 CLOB_VALUE_SET
= 0x00010000;
90 const sal_uInt32 ARRAY_VALUE_SET
= 0x00020000;
91 const sal_uInt32 OBJECT_VALUE_SET
= 0x00040000;
98 sal_uInt32 nOrigValue
;
100 OUString aString
; // getString
101 sal_Bool bBoolean
; // getBoolean
102 sal_Int8 nByte
; // getByte
103 sal_Int16 nShort
; // getShort
104 sal_Int32 nInt
; // getInt
105 sal_Int64 nLong
; // getLong
106 float nFloat
; // getFloat
107 double nDouble
; // getDouble
109 Sequence
< sal_Int8
> aBytes
; // getBytes
110 Date aDate
; // getDate
111 Time aTime
; // getTime
112 DateTime aTimestamp
; // getTimestamp
113 Reference
< XInputStream
> xBinaryStream
; // getBinaryStream
114 Reference
< XInputStream
> xCharacterStream
; // getCharacterStream
115 Reference
< XRef
> xRef
; // getRef
116 Reference
< XBlob
> xBlob
; // getBlob
117 Reference
< XClob
> xClob
; // getClob
118 Reference
< XArray
> xArray
; // getArray
119 Any aObject
; // getObject
121 inline PropertyValue()
122 : nPropsSet( NO_VALUE_SET
), nOrigValue( NO_VALUE_SET
),
132 } // namespace ucbhelper_impl
134 using namespace ucbhelper_impl
;
139 //=========================================================================
141 // class PropertyValues.
143 //=========================================================================
145 typedef std::vector
< ucbhelper_impl::PropertyValue
> PropertyValuesVector
;
147 class PropertyValues
: public PropertyValuesVector
{};
149 } // namespace ucbhelper
151 //=========================================================================
153 // Welcome to the macro hell...
155 //=========================================================================
157 #define GETVALUE_IMPL_TYPE( _type_, _type_name_, _member_name_, _cppu_type_ ) \
159 osl::MutexGuard aGuard( m_aMutex ); \
161 _type_ aValue = _type_(); /* default ctor */ \
163 m_bWasNull = sal_True; \
165 if ( ( columnIndex < 1 ) \
166 || ( columnIndex > sal_Int32( m_pValues->size() ) ) ) \
168 OSL_ENSURE( sal_False, "PropertyValueSet - index out of range!" ); \
172 ucbhelper_impl::PropertyValue& rValue \
173 = (*m_pValues)[ columnIndex - 1 ]; \
175 if ( rValue.nOrigValue != NO_VALUE_SET ) \
177 if ( rValue.nPropsSet & _type_name_ ) \
179 /* Values is present natively... */ \
180 aValue = rValue._member_name_; \
181 m_bWasNull = sal_False; \
185 if ( !(rValue.nPropsSet & OBJECT_VALUE_SET) ) \
187 /* Value is not (yet) available as Any. Create it. */ \
188 getObject( columnIndex, Reference< XNameAccess >() ); \
191 if ( rValue.nPropsSet & OBJECT_VALUE_SET ) \
193 /* Value is available as Any. */ \
195 if ( rValue.aObject.hasValue() ) \
197 /* Try to convert into native value. */ \
198 if ( rValue.aObject >>= aValue ) \
200 rValue._member_name_ = aValue; \
201 rValue.nPropsSet |= _type_name_; \
202 m_bWasNull = sal_False; \
206 /* Last chance. Try type converter service... */ \
208 Reference< XTypeConverter > xConverter \
209 = getTypeConverter(); \
210 if ( xConverter.is() ) \
214 Any aConvAny = xConverter->convertTo( \
218 if ( aConvAny >>= aValue ) \
220 rValue._member_name_ = aValue; \
221 rValue.nPropsSet |= _type_name_; \
222 m_bWasNull = sal_False; \
225 catch ( IllegalArgumentException ) \
228 catch ( CannotConvertException ) \
240 #define GETVALUE_IMPL( _type_, _type_name_, _member_name_ ) \
241 GETVALUE_IMPL_TYPE( _type_, \
244 getCppuType( static_cast< const _type_ * >( 0 ) ) )
246 #define SETVALUE_IMPL( _property_, _type_name_, _member_name_, _value_ ) \
248 osl::MutexGuard aGuard( m_aMutex ); \
250 ucbhelper_impl::PropertyValue aNewValue; \
251 aNewValue.aProperty = _property_; \
252 aNewValue.nPropsSet = _type_name_; \
253 aNewValue.nOrigValue = _type_name_; \
254 aNewValue._member_name_ = _value_; \
256 m_pValues->push_back( aNewValue );
258 namespace ucbhelper
{
260 //=========================================================================
261 //=========================================================================
263 // PropertyValueSet Implementation.
265 //=========================================================================
266 //=========================================================================
268 #define PROPERTYVALUESET_INIT() \
270 m_pValues( new PropertyValues ), \
271 m_bWasNull( sal_False ), \
272 m_bTriedToGetTypeConverter( sal_False )
274 //=========================================================================
275 PropertyValueSet::PropertyValueSet(
276 const Reference
< XMultiServiceFactory
>& rxSMgr
)
277 : PROPERTYVALUESET_INIT()
281 //=========================================================================
282 PropertyValueSet::PropertyValueSet(
283 const Reference
< XMultiServiceFactory
>& rxSMgr
,
284 const Sequence
< com::sun::star::beans::PropertyValue
>& rValues
)
285 : PROPERTYVALUESET_INIT()
287 sal_Int32 nCount
= rValues
.getLength();
290 const com::sun::star::beans::PropertyValue
* pValues
291 = rValues
.getConstArray();
293 for ( sal_Int32 n
= 0; n
< nCount
; ++n
)
295 const com::sun::star::beans::PropertyValue
& rValue
= pValues
[ n
];
296 appendObject( Property( rValue
.Name
,
298 rValue
.Value
.getValueType(),
305 //=========================================================================
307 PropertyValueSet::~PropertyValueSet()
312 //=========================================================================
314 // XInterface methods.
316 //=========================================================================
318 XINTERFACE_IMPL_3( PropertyValueSet
,
323 //=========================================================================
325 // XTypeProvider methods.
327 //=========================================================================
329 XTYPEPROVIDER_IMPL_3( PropertyValueSet
,
334 //=========================================================================
338 //=========================================================================
341 sal_Bool SAL_CALL
PropertyValueSet::wasNull()
342 throw( SQLException
, RuntimeException
)
344 // This method can not be implemented correctly!!! Imagine different
345 // threads doing a getXYZ - wasNull calling sequence on the same
346 // implementation object...
350 //=========================================================================
352 OUString SAL_CALL
PropertyValueSet::getString( sal_Int32 columnIndex
)
353 throw( SQLException
, RuntimeException
)
355 GETVALUE_IMPL( OUString
, STRING_VALUE_SET
, aString
);
358 //=========================================================================
360 sal_Bool SAL_CALL
PropertyValueSet::getBoolean( sal_Int32 columnIndex
)
361 throw( SQLException
, RuntimeException
)
364 sal_Bool
, BOOLEAN_VALUE_SET
, bBoolean
, getCppuBooleanType() );
367 //=========================================================================
369 sal_Int8 SAL_CALL
PropertyValueSet::getByte( sal_Int32 columnIndex
)
370 throw( SQLException
, RuntimeException
)
372 GETVALUE_IMPL( sal_Int8
, BYTE_VALUE_SET
, nByte
);
375 //=========================================================================
377 sal_Int16 SAL_CALL
PropertyValueSet::getShort( sal_Int32 columnIndex
)
378 throw( SQLException
, RuntimeException
)
380 GETVALUE_IMPL( sal_Int16
, SHORT_VALUE_SET
, nShort
);
383 //=========================================================================
385 sal_Int32 SAL_CALL
PropertyValueSet::getInt( sal_Int32 columnIndex
)
386 throw( SQLException
, RuntimeException
)
388 GETVALUE_IMPL( sal_Int32
, INT_VALUE_SET
, nInt
);
391 //=========================================================================
393 sal_Int64 SAL_CALL
PropertyValueSet::getLong( sal_Int32 columnIndex
)
394 throw( SQLException
, RuntimeException
)
396 GETVALUE_IMPL( sal_Int64
, LONG_VALUE_SET
, nLong
);
399 //=========================================================================
401 float SAL_CALL
PropertyValueSet::getFloat( sal_Int32 columnIndex
)
402 throw( SQLException
, RuntimeException
)
404 GETVALUE_IMPL( float, FLOAT_VALUE_SET
, nFloat
);
407 //=========================================================================
409 double SAL_CALL
PropertyValueSet::getDouble( sal_Int32 columnIndex
)
410 throw( SQLException
, RuntimeException
)
412 GETVALUE_IMPL( double, DOUBLE_VALUE_SET
, nDouble
);
415 //=========================================================================
417 Sequence
< sal_Int8
> SAL_CALL
418 PropertyValueSet::getBytes( sal_Int32 columnIndex
)
419 throw( SQLException
, RuntimeException
)
421 GETVALUE_IMPL( Sequence
< sal_Int8
>, BYTES_VALUE_SET
, aBytes
);
424 //=========================================================================
426 Date SAL_CALL
PropertyValueSet::getDate( sal_Int32 columnIndex
)
427 throw( SQLException
, RuntimeException
)
429 GETVALUE_IMPL( Date
, DATE_VALUE_SET
, aDate
);
432 //=========================================================================
434 Time SAL_CALL
PropertyValueSet::getTime( sal_Int32 columnIndex
)
435 throw( SQLException
, RuntimeException
)
437 GETVALUE_IMPL( Time
, TIME_VALUE_SET
, aTime
);
440 //=========================================================================
442 DateTime SAL_CALL
PropertyValueSet::getTimestamp( sal_Int32 columnIndex
)
443 throw( SQLException
, RuntimeException
)
445 GETVALUE_IMPL( DateTime
, TIMESTAMP_VALUE_SET
, aTimestamp
);
448 //=========================================================================
450 Reference
< XInputStream
> SAL_CALL
451 PropertyValueSet::getBinaryStream( sal_Int32 columnIndex
)
452 throw( SQLException
, RuntimeException
)
455 Reference
< XInputStream
>, BINARYSTREAM_VALUE_SET
, xBinaryStream
);
458 //=========================================================================
460 Reference
< XInputStream
> SAL_CALL
461 PropertyValueSet::getCharacterStream( sal_Int32 columnIndex
)
462 throw( SQLException
, RuntimeException
)
465 Reference
< XInputStream
>, CHARACTERSTREAM_VALUE_SET
, xCharacterStream
);
468 //=========================================================================
470 Any SAL_CALL
PropertyValueSet::getObject(
471 sal_Int32 columnIndex
,
472 const Reference
< XNameAccess
>& )
473 throw( SQLException
, RuntimeException
)
475 osl::MutexGuard
aGuard( m_aMutex
);
479 m_bWasNull
= sal_True
;
481 if ( ( columnIndex
< 1 )
482 || ( columnIndex
> sal_Int32( m_pValues
->size() ) ) )
484 OSL_ENSURE( sal_False
, "PropertyValueSet - index out of range!" );
488 ucbhelper_impl::PropertyValue
& rValue
489 = (*m_pValues
)[ columnIndex
- 1 ];
491 if ( rValue
.nPropsSet
& OBJECT_VALUE_SET
)
493 // Values is present natively...
494 aValue
= rValue
.aObject
;
495 m_bWasNull
= sal_False
;
499 // Make Any from original value.
501 switch ( rValue
.nOrigValue
)
506 case STRING_VALUE_SET
:
507 aValue
<<= rValue
.aString
;
510 case BOOLEAN_VALUE_SET
:
511 aValue
<<= rValue
.bBoolean
;
515 aValue
<<= rValue
.nByte
;
518 case SHORT_VALUE_SET
:
519 aValue
<<= rValue
.nShort
;
523 aValue
<<= rValue
.nInt
;
527 aValue
<<= rValue
.nLong
;
530 case FLOAT_VALUE_SET
:
531 aValue
<<= rValue
.nFloat
;
534 case DOUBLE_VALUE_SET
:
535 aValue
<<= rValue
.nDouble
;
538 case BYTES_VALUE_SET
:
539 aValue
<<= rValue
.aBytes
;
543 aValue
<<= rValue
.aDate
;
547 aValue
<<= rValue
.aTime
;
550 case TIMESTAMP_VALUE_SET
:
551 aValue
<<= rValue
.aTimestamp
;
554 case BINARYSTREAM_VALUE_SET
:
555 aValue
<<= rValue
.xBinaryStream
;
558 case CHARACTERSTREAM_VALUE_SET
:
559 aValue
<<= rValue
.xCharacterStream
;
563 aValue
<<= rValue
.xRef
;
567 aValue
<<= rValue
.xBlob
;
571 aValue
<<= rValue
.xClob
;
574 case ARRAY_VALUE_SET
:
575 aValue
<<= rValue
.xArray
;
578 case OBJECT_VALUE_SET
:
579 // Fall-through is intended!
581 OSL_ENSURE( sal_False
,
582 "PropertyValueSet::getObject - "
583 "Wrong original type" );
587 if ( aValue
.hasValue() )
589 rValue
.aObject
= aValue
;
590 rValue
.nPropsSet
|= OBJECT_VALUE_SET
;
591 m_bWasNull
= sal_False
;
599 //=========================================================================
601 Reference
< XRef
> SAL_CALL
PropertyValueSet::getRef( sal_Int32 columnIndex
)
602 throw( SQLException
, RuntimeException
)
604 GETVALUE_IMPL( Reference
< XRef
>, REF_VALUE_SET
, xRef
);
607 //=========================================================================
609 Reference
< XBlob
> SAL_CALL
PropertyValueSet::getBlob( sal_Int32 columnIndex
)
610 throw( SQLException
, RuntimeException
)
612 GETVALUE_IMPL( Reference
< XBlob
>, BLOB_VALUE_SET
, xBlob
);
615 //=========================================================================
617 Reference
< XClob
> SAL_CALL
PropertyValueSet::getClob( sal_Int32 columnIndex
)
618 throw( SQLException
, RuntimeException
)
620 GETVALUE_IMPL( Reference
< XClob
>, CLOB_VALUE_SET
, xClob
);
623 //=========================================================================
625 Reference
< XArray
> SAL_CALL
PropertyValueSet::getArray( sal_Int32 columnIndex
)
626 throw( SQLException
, RuntimeException
)
628 GETVALUE_IMPL( Reference
< XArray
>, ARRAY_VALUE_SET
, xArray
);
631 //=========================================================================
633 // XColumnLocate methods.
635 //=========================================================================
638 sal_Int32 SAL_CALL
PropertyValueSet::findColumn( const OUString
& columnName
)
639 throw( SQLException
, RuntimeException
)
641 osl::MutexGuard
aGuard( m_aMutex
);
643 if ( columnName
.getLength() )
645 sal_Int32 nCount
= m_pValues
->size();
646 for ( sal_Int32 n
= 0; n
< nCount
; ++n
)
648 if ( (*m_pValues
)[ n
].aProperty
.Name
.equals( columnName
) )
649 return sal_Int32( n
+ 1 ); // Index is 1-based.
655 //=========================================================================
657 // Non-interface methods.
659 //=========================================================================
661 const Reference
< XTypeConverter
>& PropertyValueSet::getTypeConverter()
663 osl::MutexGuard
aGuard( m_aMutex
);
665 if ( !m_bTriedToGetTypeConverter
&& !m_xTypeConverter
.is() )
667 m_bTriedToGetTypeConverter
= sal_True
;
668 m_xTypeConverter
= Reference
< XTypeConverter
>(
669 m_xSMgr
->createInstance(
670 OUString::createFromAscii(
671 "com.sun.star.script.Converter" ) ),
674 OSL_ENSURE( m_xTypeConverter
.is(),
675 "PropertyValueSet::getTypeConverter() - "
676 "Service 'com.sun.star.script.Converter' n/a!" );
678 return m_xTypeConverter
;
681 //=========================================================================
682 sal_Int32
PropertyValueSet::getLength() const
684 return m_pValues
->size();
687 //=========================================================================
688 void PropertyValueSet::appendString( const Property
& rProp
,
689 const OUString
& rValue
)
691 SETVALUE_IMPL( rProp
, STRING_VALUE_SET
, aString
, rValue
);
694 //=========================================================================
695 void PropertyValueSet::appendBoolean( const Property
& rProp
,
698 SETVALUE_IMPL( rProp
, BOOLEAN_VALUE_SET
, bBoolean
, bValue
);
701 //=========================================================================
702 void PropertyValueSet::appendByte( const Property
& rProp
,
705 SETVALUE_IMPL( rProp
, BYTE_VALUE_SET
, nByte
, nValue
);
708 //=========================================================================
709 void PropertyValueSet::appendShort( const Property
& rProp
,
712 SETVALUE_IMPL( rProp
, SHORT_VALUE_SET
, nShort
, nValue
);
715 //=========================================================================
716 void PropertyValueSet::appendInt( const Property
& rProp
,
719 SETVALUE_IMPL( rProp
, INT_VALUE_SET
, nInt
, nValue
);
722 //=========================================================================
723 void PropertyValueSet::appendLong( const Property
& rProp
,
726 SETVALUE_IMPL( rProp
, LONG_VALUE_SET
, nLong
, nValue
);
729 //=========================================================================
730 void PropertyValueSet::appendFloat( const Property
& rProp
,
733 SETVALUE_IMPL( rProp
, FLOAT_VALUE_SET
, nFloat
, nValue
);
736 //=========================================================================
737 void PropertyValueSet::appendDouble( const Property
& rProp
,
740 SETVALUE_IMPL( rProp
, DOUBLE_VALUE_SET
, nDouble
, nValue
);
743 //=========================================================================
744 void PropertyValueSet::appendBytes( const Property
& rProp
,
745 const Sequence
< sal_Int8
>& rValue
)
747 SETVALUE_IMPL( rProp
, BYTES_VALUE_SET
, aBytes
, rValue
);
750 //=========================================================================
751 void PropertyValueSet::appendDate( const Property
& rProp
,
754 SETVALUE_IMPL( rProp
, DATE_VALUE_SET
, aDate
, rValue
);
757 //=========================================================================
758 void PropertyValueSet::appendTime( const Property
& rProp
,
761 SETVALUE_IMPL( rProp
, TIME_VALUE_SET
, aTime
, rValue
);
764 //=========================================================================
765 void PropertyValueSet::appendTimestamp( const Property
& rProp
,
766 const DateTime
& rValue
)
768 SETVALUE_IMPL( rProp
, TIMESTAMP_VALUE_SET
, aTimestamp
, rValue
);
771 //=========================================================================
772 void PropertyValueSet::appendBinaryStream(
773 const Property
& rProp
,
774 const Reference
< XInputStream
>& rValue
)
776 SETVALUE_IMPL( rProp
, BINARYSTREAM_VALUE_SET
, xBinaryStream
, rValue
);
779 //=========================================================================
780 void PropertyValueSet::appendCharacterStream(
781 const Property
& rProp
,
782 const Reference
< XInputStream
>& rValue
)
784 SETVALUE_IMPL( rProp
, CHARACTERSTREAM_VALUE_SET
, xCharacterStream
, rValue
);
787 //=========================================================================
788 void PropertyValueSet::appendObject( const Property
& rProp
,
791 SETVALUE_IMPL( rProp
, OBJECT_VALUE_SET
, aObject
, rValue
);
794 //=========================================================================
795 void PropertyValueSet::appendRef( const Property
& rProp
,
796 const Reference
< XRef
>& rValue
)
798 SETVALUE_IMPL( rProp
, REF_VALUE_SET
, xRef
, rValue
);
801 //=========================================================================
802 void PropertyValueSet::appendBlob( const Property
& rProp
,
803 const Reference
< XBlob
>& rValue
)
805 SETVALUE_IMPL( rProp
, BLOB_VALUE_SET
, xBlob
, rValue
);
808 //=========================================================================
809 void PropertyValueSet::appendClob( const Property
& rProp
,
810 const Reference
< XClob
>& rValue
)
812 SETVALUE_IMPL( rProp
, CLOB_VALUE_SET
, xClob
, rValue
);
815 //=========================================================================
816 void PropertyValueSet::appendArray( const Property
& rProp
,
817 const Reference
< XArray
>& rValue
)
819 SETVALUE_IMPL( rProp
, ARRAY_VALUE_SET
, xArray
, rValue
);
822 //=========================================================================
823 void PropertyValueSet::appendVoid( const Property
& rProp
)
825 SETVALUE_IMPL( rProp
, NO_VALUE_SET
, aObject
, Any() );
828 //=========================================================================
829 void PropertyValueSet::appendPropertySet(
830 const Reference
< XPropertySet
>& rxSet
)
834 Reference
< XPropertySetInfo
> xInfo
= rxSet
->getPropertySetInfo();
837 Sequence
< Property
> aProps
= xInfo
->getProperties();
838 const Property
* pProps
= aProps
.getConstArray();
839 sal_Int32 nPropsCount
= aProps
.getLength();
841 Reference
< XPropertyAccess
> xPropertyAccess( rxSet
, UNO_QUERY
);
842 if ( xPropertyAccess
.is() )
844 // Efficient: Get all prop values with one ( remote) call.
846 Sequence
< ::com::sun::star::beans::PropertyValue
> aPropValues
847 = xPropertyAccess
->getPropertyValues();
849 const ::com::sun::star::beans::PropertyValue
* pPropValues
850 = aPropValues
.getConstArray();
852 sal_Int32 nValuesCount
= aPropValues
.getLength();
853 for ( sal_Int32 n
= 0; n
< nValuesCount
; ++n
)
855 const ::com::sun::star::beans::PropertyValue
& rPropValue
858 // Find info for current property value.
859 for ( sal_Int32 m
= 0; m
< nPropsCount
; ++m
)
861 const Property
& rProp
= pProps
[ m
];
862 if ( rProp
.Name
== rPropValue
.Name
)
865 appendObject( rProp
, rPropValue
.Value
);
873 // Get every single prop value with one ( remote) call.
875 for ( sal_Int32 n
= 0; n
< nPropsCount
; ++n
)
877 const Property
& rProp
= pProps
[ n
];
881 Any aValue
= rxSet
->getPropertyValue( rProp
.Name
);
883 if ( aValue
.hasValue() )
884 appendObject( rProp
, aValue
);
886 catch ( UnknownPropertyException
)
889 catch ( WrappedTargetException
)
898 //=========================================================================
899 sal_Bool
PropertyValueSet::appendPropertySetValue(
900 const Reference
< XPropertySet
>& rxSet
,
901 const Property
& rProperty
)
907 Any aValue
= rxSet
->getPropertyValue( rProperty
.Name
);
908 if ( aValue
.hasValue() )
910 appendObject( rProperty
, aValue
);
914 catch ( UnknownPropertyException
)
917 catch ( WrappedTargetException
)
926 } // namespace ucbhelper