24#include <com/sun/star/chart2/LegendPosition.hpp>
25#include <com/sun/star/chart/ChartLegendExpansion.hpp>
26#include <com/sun/star/beans/XPropertySet.hpp>
40 const css::uno::Reference< css::beans::XPropertySet > & rPropertySet,
44 const awt::Size* pRefSize ) :
48 rPropertySet, rItemPool, rDrawModel, xNamedPropertyContainerFactory,
51 rPropertySet, rItemPool, pRefSize,
52 "ReferencePageSize" ));
62 pConv->FillItemSet( rOutItemSet );
73 bResult = pConv->ApplyItemSet( rItemSet ) || bResult;
93 bool bChanged =
false;
101 bool bShow = pShowItem->GetValue();
102 bool bWasShown =
true;
104 ( bWasShown != bShow ))
117 chart2::LegendPosition eNewPos =
static_cast<chart2::LegendPosition
>(pPosItem->GetValue());
119 css::chart::ChartLegendExpansion eExpansion = css::chart::ChartLegendExpansion_HIGH;
122 case chart2::LegendPosition_LINE_START:
123 case chart2::LegendPosition_LINE_END:
124 eExpansion = css::chart::ChartLegendExpansion_HIGH;
126 case chart2::LegendPosition_PAGE_START:
127 case chart2::LegendPosition_PAGE_END:
128 eExpansion = css::chart::ChartLegendExpansion_WIDE;
136 chart2::LegendPosition eOldPos;
138 ( eOldPos != eNewPos ))
146 catch(
const uno::Exception & )
157 bool bOverlay = !pNoOverlayItem->GetValue();
158 bool bOldOverlay =
false;
160 (bOldOverlay != bOverlay))
175 sal_uInt16 nWhichId,
SfxItemSet & rOutItemSet )
const
188 chart2::LegendPosition eLegendPos( chart2::LegendPosition_LINE_END );
189 GetPropertySet()->getPropertyValue(
"AnchorPosition" ) >>= eLegendPos;
195 bool bOverlay =
false;
constexpr TypedWhichId< SfxInt32Item > SCHATTR_LEGEND_POS(SCHATTR_LEGEND_START)
constexpr TypedWhichId< SfxBoolItem > SCHATTR_LEGEND_SHOW(SCHATTR_LEGEND_START+1)
constexpr TypedWhichId< SfxBoolItem > SCHATTR_LEGEND_NO_OVERLAY(SCHATTR_LEGEND_START+2)
const WhichRangesContainer nLegendWhichPairs(svl::Items< SCHATTR_LEGEND_START, SCHATTR_LEGEND_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 T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
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...
LegendItemConverter(const css::uno::Reference< css::beans::XPropertySet > &rPropertySet, SfxItemPool &rItemPool, SdrModel &rDrawModel, const css::uno::Reference< css::lang::XMultiServiceFactory > &xNamedPropertyContainerFactory, const css::awt::Size *pRefSize)
virtual bool ApplySpecialItem(sal_uInt16 nWhichId, const SfxItemSet &rItemSet) override
for items that can not be mapped directly to a property.
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 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.
virtual ~LegendItemConverter() override
virtual void FillItemSet(SfxItemSet &rOutItemSet) const override
applies all properties that can be mapped to items into the given item set.
#define DBG_UNHANDLED_EXCEPTION(...)
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)