23#include <com/sun/star/beans/PropertyAttribute.hpp>
24#include <com/sun/star/beans/XPropertyState.hpp>
25#include <com/sun/star/beans/XPropertySet.hpp>
29using ::com::sun::star::uno::Any;
30using ::com::sun::star::uno::Reference;
31using ::com::sun::star::beans::Property;
38class WrappedAutomaticPositionProperty :
public WrappedProperty
41 WrappedAutomaticPositionProperty();
43 virtual void setPropertyValue(
const Any& rOuterValue,
const Reference< beans::XPropertySet >& xInnerPropertySet )
const override;
44 virtual Any getPropertyValue(
const Reference< beans::XPropertySet >& xInnerPropertySet )
const override;
45 virtual Any getPropertyDefault(
const Reference< beans::XPropertyState >& xInnerPropertyState )
const override;
50WrappedAutomaticPositionProperty::WrappedAutomaticPositionProperty()
51 : ::
chart::WrappedProperty(
"AutomaticPosition" , OUString() )
57 if( !xInnerPropertySet.is() )
60 bool bNewValue =
true;
61 if( ! (rOuterValue >>= bNewValue) )
62 throw lang::IllegalArgumentException(
"Property AutomaticPosition requires value of type boolean",
nullptr, 0 );
68 Any aRelativePosition( xInnerPropertySet->getPropertyValue(
"RelativePosition" ) );
69 if( aRelativePosition.hasValue() )
70 xInnerPropertySet->setPropertyValue(
"RelativePosition",
Any() );
73 catch(
const uno::Exception & )
79Any WrappedAutomaticPositionProperty::getPropertyValue(
const Reference< beans::XPropertySet >& xInnerPropertySet )
const
81 Any aRet( getPropertyDefault( Reference< beans::XPropertyState >( xInnerPropertySet, uno::UNO_QUERY ) ) );
82 if( xInnerPropertySet.is() )
84 Any aRelativePosition( xInnerPropertySet->getPropertyValue(
"RelativePosition" ) );
85 if( !aRelativePosition.hasValue() )
91Any WrappedAutomaticPositionProperty::getPropertyDefault(
const Reference< beans::XPropertyState >& )
const
107void WrappedAutomaticPositionProperties::addProperties( std::vector< Property > & rOutProperties )
109 rOutProperties.emplace_back(
"AutomaticPosition",
110 PROP_CHART_AUTOMATIC_POSITION,
112 beans::PropertyAttribute::BOUND
113 | beans::PropertyAttribute::MAYBEDEFAULT );
116void WrappedAutomaticPositionProperties::addWrappedProperties( std::vector< std::unique_ptr<WrappedProperty> >& rList )
118 rList.emplace_back(
new WrappedAutomaticPositionProperty() );
#define DBG_UNHANDLED_EXCEPTION(...)
void setPropertyValue(tPropertyValueMap &rOutMap, tPropertyValueMapKey key, const Value &value)
Set a property to a certain value in the given map.
@ FAST_PROPERTY_ID_START_CHART_AUTOPOSITION_PROP
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)