22#include <com/sun/star/beans/XPropertySetInfo.hpp>
23#include <com/sun/star/beans/XPropertySet.hpp>
24#include <com/sun/star/beans/XMultiPropertySet.hpp>
28using ::com::sun::star::beans::XMultiPropertySet;
29using ::com::sun::star::beans::XPropertySet;
30using ::com::sun::star::beans::XPropertySetInfo;
31using ::com::sun::star::uno::Any;
32using ::com::sun::star::uno::Reference;
33using ::com::sun::star::uno::UNO_QUERY;
37 const char** pNames ) :
42 for(
const char** pPtr = pNames; *pPtr !=
nullptr; pPtr++ )
59 const Reference<XPropertySetInfo> & rInfo )
61 SAL_WARN_IF( !rInfo.is(),
"xmloff",
"I'd really like an XPropertySetInfo here." );
68 sal_Int16 nNumberOfProperties = 0;
80 nNumberOfProperties++;
102 const Reference<XMultiPropertySet> & rMultiPropertySet )
104 SAL_WARN_IF( !rMultiPropertySet.is(),
"xmloff",
"We need an XMultiPropertySet." );
111 const Reference<XPropertySet> & rPropertySet )
113 SAL_WARN_IF( !rPropertySet.is(),
"xmloff",
"We need an XPropertySet." );
116 sal_Int16 nSupportedPropertiesCount =
118 if (
aValues.getLength() != nSupportedPropertiesCount )
119 aValues.realloc( nSupportedPropertiesCount );
121 for( sal_Int16 i = 0;
i < nSupportedPropertiesCount;
i++ )
123 pMutableArray[
i] = rPropertySet->getPropertyValue(
133 const Reference< XPropertySet> & rPropSet,
140 Reference < XMultiPropertySet > xMultiPropSet( rPropSet,
142 if( xMultiPropSet.is() )
157 const Reference< XMultiPropertySet> & rMultiPropSet )
const PropertyValue * pValues
MultiPropertySetHelper(const char **pNames)
std::unique_ptr< OUString[]> pPropertyNames
names of all properties
void hasProperties(const css::uno::Reference< css::beans::XPropertySetInfo > &)
Call hasPropertiesByName for the provided XPropertySetInfo and build list of allowed properties.
const css::uno::Any & getValue(sal_Int16 nIndex)
Get a value from the values array.
void getValues(const css::uno::Reference< css::beans::XMultiPropertySet > &)
Get values from the XMultiPropertySet.
bool checkedProperties()
Return whether hasProperties was called (i.e.
const css::uno::Any * pValues
result of aValues.getConstArray()
~MultiPropertySetHelper()
css::uno::Sequence< css::uno::Any > aValues
the last set of values retrieved by getValues
css::uno::Sequence< OUString > aPropertySequence
the sequence of property names that the current (multi) property set implementation supports
sal_Int16 nLength
length of pPropertyNames array
std::unique_ptr< sal_Int16[]> pSequenceIndex
an array of indices that maps from pPropertyNames indices to aPropertySequence indices
#define SAL_WARN_IF(condition, area, stream)