25#include <com/sun/star/beans/PropertyAttribute.hpp>
26#include <com/sun/star/beans/XPropertyState.hpp>
27#include <com/sun/star/beans/XPropertySet.hpp>
32using ::com::sun::star::uno::Any;
33using ::com::sun::star::uno::Reference;
34using ::com::sun::star::beans::Property;
41class WrappedScaleTextProperty :
public WrappedProperty
44 explicit WrappedScaleTextProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact);
46 virtual void setPropertyValue(
const Any& rOuterValue,
const Reference< beans::XPropertySet >& xInnerPropertySet )
const override;
47 virtual Any getPropertyValue(
const Reference< beans::XPropertySet >& xInnerPropertySet )
const override;
48 virtual Any getPropertyDefault(
const Reference< beans::XPropertyState >& xInnerPropertyState )
const override;
56WrappedScaleTextProperty::WrappedScaleTextProperty(std::shared_ptr<Chart2ModelContact> spChart2ModelContact)
57 : ::
chart::WrappedProperty(
"ScaleText" , OUString() )
64 static constexpr OUStringLiteral aRefSizeName =
u"ReferencePageSize";
66 if( !xInnerPropertySet.is() )
69 bool bNewValue =
false;
70 if( ! (rOuterValue >>= bNewValue) )
72 if( rOuterValue.hasValue() )
73 throw lang::IllegalArgumentException(
"Property ScaleText requires value of type boolean",
nullptr, 0 );
81 xInnerPropertySet->setPropertyValue( aRefSizeName,
uno::Any( aRefSize ) );
84 xInnerPropertySet->setPropertyValue( aRefSizeName,
Any() );
86 catch(
const uno::Exception & )
92Any WrappedScaleTextProperty::getPropertyValue(
const Reference< beans::XPropertySet >& xInnerPropertySet )
const
94 Any aRet( getPropertyDefault( Reference< beans::XPropertyState >( xInnerPropertySet, uno::UNO_QUERY ) ) );
95 if( xInnerPropertySet.is() )
97 if( xInnerPropertySet->getPropertyValue(
"ReferencePageSize" ).hasValue() )
106Any WrappedScaleTextProperty::getPropertyDefault(
const Reference< beans::XPropertyState >& )
const
122void WrappedScaleTextProperties::addProperties( std::vector< Property > & rOutProperties )
124 rOutProperties.emplace_back(
"ScaleText",
125 PROP_CHART_SCALE_TEXT,
127 beans::PropertyAttribute::MAYBEVOID
128 | beans::PropertyAttribute::MAYBEDEFAULT );
131void WrappedScaleTextProperties::addWrappedProperties( std::vector< std::unique_ptr<WrappedProperty> >& rList
132 ,
const std::shared_ptr< Chart2ModelContact >& spChart2ModelContact )
134 rList.emplace_back(
new WrappedScaleTextProperty( spChart2ModelContact ) );
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact
#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_SCALE_TEXT_PROP
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)