27#include <com/sun/star/chart2/LegendPosition.hpp>
28#include <com/sun/star/chart/ChartLegendExpansion.hpp>
45 : m_xRbtLeft(rBuilder.weld_radio_button(
"left"))
46 , m_xRbtRight(rBuilder.weld_radio_button(
"right"))
47 , m_xRbtTop(rBuilder.weld_radio_button(
"top"))
48 , m_xRbtBottom(rBuilder.weld_radio_button(
"bottom"))
55 : m_xCC(
std::move(xCC))
56 , m_xCbxShow(rBuilder.weld_check_button(
"show"))
57 , m_xRbtLeft(rBuilder.weld_radio_button(
"left"))
58 , m_xRbtRight(rBuilder.weld_radio_button(
"right"))
59 , m_xRbtTop(rBuilder.weld_radio_button(
"top"))
60 , m_xRbtBottom(rBuilder.weld_radio_button(
"bottom"))
87 bool bShowLegend =
false;
88 xLegend->getPropertyValue(
"Show" ) >>= bShowLegend;
94 chart2::LegendPosition
ePos;
95 xLegend->getPropertyValue(
"AnchorPosition" ) >>=
ePos;
98 case chart2::LegendPosition_LINE_START:
101 case chart2::LegendPosition_PAGE_START:
104 case chart2::LegendPosition_PAGE_END:
107 case chart2::LegendPosition_LINE_END:
114 catch(
const uno::Exception & )
125 ChartModel& rModel = *xChartModel;
130 xProp->setPropertyValue(
"Show" ,
uno::Any( bShowLegend ));
133 chart2::LegendPosition eNewPos;
134 css::chart::ChartLegendExpansion eExp = css::chart::ChartLegendExpansion_HIGH;
137 eNewPos = chart2::LegendPosition_LINE_START;
140 eNewPos = chart2::LegendPosition_LINE_END;
144 eNewPos = chart2::LegendPosition_PAGE_START;
145 eExp = css::chart::ChartLegendExpansion_WIDE;
149 eNewPos = chart2::LegendPosition_PAGE_END;
150 eExp = css::chart::ChartLegendExpansion_WIDE;
153 xProp->setPropertyValue(
"AnchorPosition" ,
uno::Any( eNewPos ));
154 xProp->setPropertyValue(
"Expansion" ,
uno::Any( eExp ));
155 xProp->setPropertyValue(
"RelativePosition" ,
uno::Any());
158 catch(
const uno::Exception & )
185 chart2::LegendPosition nLegendPosition =
static_cast<chart2::LegendPosition
>(pPosItem->GetValue());
186 switch( nLegendPosition )
188 case chart2::LegendPosition_LINE_START:
191 case chart2::LegendPosition_PAGE_START:
194 case chart2::LegendPosition_LINE_END:
197 case chart2::LegendPosition_PAGE_END:
214 chart2::LegendPosition nLegendPosition = chart2::LegendPosition_LINE_END;
216 nLegendPosition = chart2::LegendPosition_LINE_START;
218 nLegendPosition = chart2::LegendPosition_PAGE_START;
220 nLegendPosition = chart2::LegendPosition_LINE_END;
222 nLegendPosition = chart2::LegendPosition_PAGE_END;
233 if( rRadio.get_active() )
234 m_aChangeLink.Call(
nullptr);
css::chart::ChartAxisLabelPosition ePos
constexpr TypedWhichId< SfxInt32Item > SCHATTR_LEGEND_POS(SCHATTR_LEGEND_START)
constexpr TypedWhichId< SfxBoolItem > SCHATTR_LEGEND_SHOW(SCHATTR_LEGEND_START+1)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
static rtl::Reference< ::chart::Legend > getLegend(ChartModel &rModel, const css::uno::Reference< css::uno::XComponentContext > &xContext=nullptr, bool bCreate=false)
Link< LinkParamNone *, void > m_aChangeLink
void SetChangeHdl(const Link< LinkParamNone *, void > &rLink)
std::unique_ptr< weld::RadioButton > m_xRbtTop
std::unique_ptr< weld::CheckButton > m_xCbxShow
void writeToModel(const rtl::Reference<::chart::ChartModel > &xChartModel) const
std::unique_ptr< weld::RadioButton > m_xRbtLeft
void writeToItemSet(SfxItemSet &rOutAttrs) const
~LegendPositionResources()
void writeToResources(const rtl::Reference<::chart::ChartModel > &xChartModel)
css::uno::Reference< css::uno::XComponentContext > m_xCC
void impl_setRadioButtonToggleHdl()
std::unique_ptr< weld::RadioButton > m_xRbtBottom
LegendPositionResources(weld::Builder &rBuilder)
void initFromItemSet(const SfxItemSet &rInAttrs)
std::unique_ptr< weld::RadioButton > m_xRbtRight
#define DBG_UNHANDLED_EXCEPTION(...)
#define LINK(Instance, Class, Member)
IMPL_LINK(StackingResourceGroup, StackingChangeHdl, weld::Toggleable &, rRadio, void)
IMPL_LINK_NOARG(SplinePropertiesDialog, SplineTypeListBoxHdl, weld::ComboBox &, void)