27#include <rtl/math.hxx>
29#include <com/sun/star/chart2/XTitle.hpp>
30#include <com/sun/star/beans/XPropertySet.hpp>
44 return aTitlePropertyMap;
47class FormattedStringsConverter :
public MultipleItemConverter
50 FormattedStringsConverter(
51 const uno::Sequence< uno::Reference< chart2::XFormattedString > > & aStrings,
53 const awt::Size* pRefSize,
54 const uno::Reference< beans::XPropertySet > & xParentProp );
62FormattedStringsConverter::FormattedStringsConverter(
63 const uno::Sequence< uno::Reference< chart2::XFormattedString > > & aStrings,
65 const awt::Size* pRefSize,
66 const uno::Reference< beans::XPropertySet > & xParentProp ) :
67 MultipleItemConverter( rItemPool )
69 bool bHasRefSize = (pRefSize && xParentProp.is());
70 for( uno::Reference< chart2::XFormattedString >
const & formattedStr : aStrings )
72 uno::Reference< beans::XPropertySet > xProp( formattedStr, uno::UNO_QUERY );
76 m_aConverters.emplace_back(
77 new CharacterPropertyItemConverter(
78 xProp, rItemPool, pRefSize,
"ReferencePageSize", xParentProp));
80 m_aConverters.emplace_back(
new CharacterPropertyItemConverter( xProp, rItemPool ));
90TitleItemConverter::TitleItemConverter(
95 const awt::Size* pRefSize ) :
99 rPropertySet, rItemPool, rDrawModel,
100 xNamedPropertyContainerFactory,
109 if( aStringSeq.hasElements() )
112 new FormattedStringsConverter( aStringSeq, rItemPool, pRefSize, rPropertySet ));
124 pConv->FillItemSet( rOutItemSet );
132 bool bResult =
false;
135 bResult = pConv->ApplyItemSet( rItemSet ) || bResult;
150 ItemPropertyMapType::const_iterator aIt( rMap.find( nWhichId ));
152 if( aIt == rMap.end())
155 rOutProperty =(*aIt).second;
160 sal_uInt16 nWhichId,
const SfxItemSet & rItemSet )
162 bool bChanged =
false;
169 double fVal =
static_cast< double >(
171 rItemSet.
Get( nWhichId )).
GetValue().get()) / 100.0;
172 double fOldVal = 0.0;
174 (
GetPropertySet()->getPropertyValue(
"TextRotation" ) >>= fOldVal );
176 if( ! bPropExisted || fOldVal != fVal )
189 sal_uInt16 nWhichId,
SfxItemSet & rOutItemSet )
const
201 ::rtl::math::round( fVal * 100.0 ) ) )));
constexpr TypedWhichId< SfxBoolItem > SCHATTR_TEXT_STACKED(SCHATTR_TEXT_START+1)
constexpr TypedWhichId< SdrAngleItem > SCHATTR_TEXT_DEGREES(SCHATTR_TEXT_START)
const WhichRangesContainer nCharacterPropertyWhichPairs(svl::Items< EE_ITEMS_START, EE_ITEMS_END, SID_CHAR_DLG_PREVIEW_STRING, SID_CHAR_DLG_PREVIEW_STRING >)
const WhichRangesContainer nTitleWhichPairs(svl::Items< SCHATTR_TEXT_START, SCHATTR_TEXT_END, XATTR_LINE_FIRST, XATTR_LINE_LAST, XATTR_FILL_FIRST, XATTR_FILL_LAST, SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST, EE_ITEMS_START, EE_ITEMS_END, SID_CHAR_DLG_PREVIEW_STRING, SID_CHAR_DLG_PREVIEW_STRING >)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
This class serves for conversion between properties of an XPropertySet and SfxItems in SfxItemSets.
virtual void FillItemSet(SfxItemSet &rOutItemSet) const
applies all properties that can be mapped to items into the given item set.
std::pair< tPropertyNameType, tMemberIdType > tPropertyNameWithMemberId
const css::uno::Reference< css::beans::XPropertySet > & GetPropertySet() const
Returns the XPropertySet that was given in the CTOR and is used to apply items in ApplyItemSet().
virtual bool ApplyItemSet(const SfxItemSet &rItemSet)
applies all properties that are results of a conversion from all items in rItemSet to the internal XP...
virtual bool ApplyItemSet(const SfxItemSet &rItemSet) override
applies all properties that are results of a conversion from all items in rItemSet to the internal XP...
std::vector< std::unique_ptr< ItemConverter > > m_aConverters
virtual bool GetItemProperty(tWhichIdType nWhichId, tPropertyNameWithMemberId &rOutProperty) const override
implement this method to return a Property object for a given which id.
virtual void FillItemSet(SfxItemSet &rOutItemSet) const override
applies all properties that can be mapped to items into the given item set.
virtual ~TitleItemConverter() override
virtual bool ApplySpecialItem(sal_uInt16 nWhichId, const SfxItemSet &rItemSet) override
for items that can not be mapped directly to a property.
virtual const WhichRangesContainer & GetWhichPairs() const override
implement this method to provide an array of which-ranges
virtual void FillSpecialItem(sal_uInt16 nWhichId, SfxItemSet &rOutItemSet) const override
for items that can not be mapped directly to a property.
std::map< ItemConverter::tWhichIdType, std::pair< ItemConverter::tPropertyNameType, ItemConverter::tMemberIdType > > ItemPropertyMapType
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)