38#include <svx/svxids.hrc>
39#include <osl/diagnose.h>
47const std::u16string_view our_aLBEntryMap[] = {
u" ",
u", ",
u"; ",
u"\n",
u". "};
54 rnFormatKeyOut = pNumItem->GetValue();
58 rbSourceFormatMixedStateOut=
true;
61 rbSourceFormatOut = pBoolItem->GetValue();
62 rbSourceFormatMixedStateOut=
false;
84 : m_pNumberFormatter(nullptr)
85 , m_bNumberFormatMixedState(true)
86 , m_bPercentFormatMixedState(true)
87 , m_nNumberFormatForValue(0)
88 , m_nNumberFormatForPercent(11)
89 , m_bSourceFormatMixedState(true)
90 , m_bPercentSourceMixedState(true)
91 , m_bSourceFormatForValue(true)
92 , m_bSourceFormatForPercent(true)
94 , m_pPool(rInAttrs.GetPool())
95 , m_xCBNumber(pBuilder->weld_check_button(
"CB_VALUE_AS_NUMBER"))
96 , m_xPB_NumberFormatForValue(pBuilder->weld_button(
"PB_NUMBERFORMAT"))
97 , m_xCBPercent(pBuilder->weld_check_button(
"CB_VALUE_AS_PERCENTAGE"))
98 , m_xPB_NumberFormatForPercent(pBuilder->weld_button(
"PB_PERCENT_NUMBERFORMAT"))
99 , m_xFT_NumberFormatForPercent(pBuilder->weld_label(
"STR_DLG_NUMBERFORMAT_FOR_PERCENTAGE_VALUE"))
100 , m_xCBCategory(pBuilder->weld_check_button(
"CB_CATEGORY"))
101 , m_xCBSymbol(pBuilder->weld_check_button(
"CB_SYMBOL"))
102 , m_xCBDataSeries(pBuilder->weld_check_button(
"CB_DATA_SERIES_NAME"))
103 , m_xCBWrapText(pBuilder->weld_check_button(
"CB_WRAP_TEXT"))
104 , m_xLB_Separator(pBuilder->weld_combo_box(
"LB_TEXT_SEPARATOR"))
105 , m_xLB_LabelPlacement(pBuilder->weld_combo_box(
"LB_LABEL_PLACEMENT"))
106 , m_xBxOrientation(pBuilder->weld_widget(
"boxORIENTATION"))
107 , m_xFT_Dial(pBuilder->weld_label(
"CT_LABEL_DIAL"))
108 , m_xNF_Degrees(pBuilder->weld_metric_spin_button(
"NF_LABEL_DEGREES",
FieldUnit::
DEGREE))
109 , m_xBxTextDirection(pBuilder->weld_widget(
"boxTXT_DIRECTION"))
110 , m_aLB_TextDirection(pBuilder->weld_combo_box(
"LB_LABEL_TEXTDIR"))
111 , m_xDC_Dial(new
svx::DialControl)
112 , m_xDC_DialWin(new
weld::CustomWeld(*pBuilder,
"CT_DIAL", *m_xDC_Dial))
113 , m_xCBCustomLeaderLines(pBuilder->weld_check_button(
"CB_CUSTOM_LEADER_LINES"))
118 std::map< sal_Int32, OUString > aPlacementToStringMap;
123 std::vector< sal_Int32 > aAvailablePlacementList;
125 aAvailablePlacementList = pPlacementsItem->GetList();
128 for(
size_t nN=0; nN<aAvailablePlacementList.size(); ++nN )
130 sal_uInt16 nListBoxPos =
static_cast<sal_uInt16
>( nN );
131 sal_Int32 nPlacement = aAvailablePlacementList[nN];
153 bool bForbidPercentValue = pNoPercentValueItem->GetValue();
154 if( bForbidPercentValue )
172 if( !m_pPool || !m_pNumberFormatter )
174 OSL_FAIL(
"Missing item pool or number formatter");
178 if (&rButton == m_xPB_NumberFormatForValue.get() && !m_xCBNumber->get_active())
180 m_xCBNumber->set_active(
true);
181 m_aNumberState.bTriStateEnabled =
false;
183 else if (&rButton == m_xPB_NumberFormatForPercent.get() && !m_xCBPercent->get_active())
185 m_xCBPercent->set_active(
true);
186 m_aPercentState.bTriStateEnabled =
false;
192 bool bPercent = (&rButton == m_xPB_NumberFormatForPercent.get());
194 sal_uInt32& rnFormatKey = bPercent ? m_nNumberFormatForPercent : m_nNumberFormatForValue;
195 bool& rUseSourceFormat = bPercent ? m_bSourceFormatForPercent : m_bSourceFormatForValue;
196 bool& rbMixedState = bPercent ? m_bPercentFormatMixedState : m_bNumberFormatMixedState;
197 bool& rbSourceMixedState = bPercent ? m_bPercentSourceMixedState : m_bSourceFormatMixedState;
201 aNumberSet.
Put(
SfxBoolItem( SID_ATTR_NUMBERFORMAT_SOURCE, rUseSourceFormat ));
205 aDlg.set_title(m_xFT_NumberFormatForPercent->get_label());
212 bool bOldSource = rUseSourceFormat;
213 sal_uInt32 nOldFormat = rnFormatKey;
214 bool bOldMixedState = rbMixedState || rbSourceMixedState;
216 rbMixedState = !lcl_ReadNumberFormatFromItemSet( *pResult, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_SOURCE, rnFormatKey, rUseSourceFormat, rbSourceMixedState );
219 if( bOldMixedState && bOldSource == rUseSourceFormat && nOldFormat == rnFormatKey )
220 rbMixedState = rbSourceMixedState =
true;
226 if (&rToggle == m_xCBNumber.get())
227 m_aNumberState.ButtonToggled(rToggle);
228 else if (&rToggle == m_xCBPercent.get())
229 m_aPercentState.ButtonToggled(rToggle);
230 else if (&rToggle == m_xCBCategory.get())
231 m_aCategoryState.ButtonToggled(rToggle);
232 else if (&rToggle == m_xCBSymbol.get())
233 m_aSymbolState.ButtonToggled(rToggle);
234 else if (&rToggle == m_xCBDataSeries.get())
235 m_aDataSeriesState.ButtonToggled(rToggle);
236 else if (&rToggle == m_xCBWrapText.get())
237 m_aWrapTextState.ButtonToggled(rToggle);
238 else if (&rToggle == m_xCBCustomLeaderLines.get())
239 m_aCustomLeaderLinesState.ButtonToggled(rToggle);
256 ++nNumberOfCheckedLabelParts;
258 ++nNumberOfCheckedLabelParts;
260 ++nNumberOfCheckedLabelParts;
262 ++nNumberOfCheckedLabelParts;
266 bool bEnableTextDir = nNumberOfCheckedLabelParts > 0;
318 sal_Int32
nValue = aIt->second;
349 for(
size_t i=0;
i < std::size(our_aLBEntryMap); ++
i )
351 if( our_aLBEntryMap[
i] == pSeparatorItem->GetValue())
359 sal_Int32 nPlacement = pPlacementItem->GetValue();
363 sal_uInt16
nPos = aIt->second;
377 Degree100 nDegrees = pAngleItem->GetValue();
constexpr TypedWhichId< SfxBoolItem > SCHATTR_DATADESCR_SHOW_SYMBOL(SCHATTR_DATADESCR_START+3)
constexpr TypedWhichId< SfxInt32Item > SCHATTR_DATADESCR_PLACEMENT(SCHATTR_DATADESCR_START+6)
constexpr TypedWhichId< SfxBoolItem > SCHATTR_DATADESCR_CUSTOM_LEADER_LINES(SCHATTR_DATADESCR_START+9)
constexpr TypedWhichId< SfxBoolItem > SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME(SCHATTR_DATADESCR_START+12)
constexpr TypedWhichId< SfxBoolItem > SCHATTR_PERCENT_NUMBERFORMAT_SOURCE(SCHATTR_DATADESCR_START+11)
constexpr TypedWhichId< SfxStringItem > SCHATTR_DATADESCR_SEPARATOR(SCHATTR_DATADESCR_START+5)
constexpr TypedWhichId< SfxUInt32Item > SCHATTR_PERCENT_NUMBERFORMAT_VALUE(SCHATTR_DATADESCR_START+10)
constexpr TypedWhichId< SfxIntegerListItem > SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS(SCHATTR_DATADESCR_START+7)
constexpr TypedWhichId< SdrAngleItem > SCHATTR_TEXT_DEGREES(SCHATTR_TEXT_START)
constexpr TypedWhichId< SfxBoolItem > SCHATTR_DATADESCR_NO_PERCENTVALUE(SCHATTR_DATADESCR_START+8)
constexpr TypedWhichId< SfxBoolItem > SCHATTR_DATADESCR_SHOW_NUMBER(SCHATTR_DATADESCR_START)
constexpr TypedWhichId< SfxBoolItem > SCHATTR_DATADESCR_WRAP_TEXT(SCHATTR_DATADESCR_START+4)
constexpr TypedWhichId< SfxBoolItem > SCHATTR_DATADESCR_SHOW_PERCENTAGE(SCHATTR_DATADESCR_START+1)
constexpr TypedWhichId< SfxBoolItem > SCHATTR_DATADESCR_SHOW_CATEGORY(SCHATTR_DATADESCR_START+2)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxItemSet * GetOutputItemSet() const
std::unique_ptr< weld::Button > m_xPB_NumberFormatForPercent
std::unique_ptr< weld::ComboBox > m_xLB_Separator
std::map< sal_uInt16, sal_Int32 > m_aListBoxToPlacementMap
void Reset(const SfxItemSet &rInAttrs)
std::unique_ptr< weld::CheckButton > m_xCBDataSeries
std::unique_ptr< weld::MetricSpinButton > m_xNF_Degrees
std::unique_ptr< weld::Label > m_xFT_Dial
weld::TriStateEnabled m_aNumberState
std::unique_ptr< weld::CheckButton > m_xCBCategory
std::unique_ptr< weld::Widget > m_xBxOrientation
weld::TriStateEnabled m_aPercentState
std::unique_ptr< weld::CheckButton > m_xCBCustomLeaderLines
SvNumberFormatter * m_pNumberFormatter
std::unique_ptr< weld::Widget > m_xBxTextDirection
std::unique_ptr< weld::CheckButton > m_xCBPercent
sal_uInt32 m_nNumberFormatForValue
std::unique_ptr< weld::CheckButton > m_xCBNumber
bool m_bSourceFormatForValue
weld::TriStateEnabled m_aWrapTextState
bool m_bPercentSourceMixedState
TextDirectionListBox m_aLB_TextDirection
weld::TriStateEnabled m_aDataSeriesState
bool m_bSourceFormatMixedState
std::unique_ptr< weld::ComboBox > m_xLB_LabelPlacement
std::map< sal_Int32, sal_uInt16 > m_aPlacementToListBoxMap
DataLabelResources(weld::Builder *pBuilder, weld::Window *pParent, const SfxItemSet &rInAttrs)
std::unique_ptr< svx::DialControl > m_xDC_Dial
void SetNumberFormatter(SvNumberFormatter *pFormatter)
sal_uInt32 m_nNumberFormatForPercent
std::unique_ptr< weld::Button > m_xPB_NumberFormatForValue
weld::TriStateEnabled m_aCustomLeaderLinesState
weld::TriStateEnabled m_aSymbolState
std::unique_ptr< weld::CheckButton > m_xCBWrapText
bool m_bNumberFormatMixedState
bool m_bSourceFormatForPercent
void FillItemSet(SfxItemSet *rOutAttrs) const
bool m_bPercentFormatMixedState
weld::TriStateEnabled m_aCategoryState
std::unique_ptr< weld::CheckButton > m_xCBSymbol
SvxFrameDirection get_active_id() const
void set_active_id(SvxFrameDirection eDir)
virtual void set_active(bool active)=0
void set_state(TriState eState)
constexpr TypedWhichId< SvxFrameDirectionItem > EE_PARA_WRITINGDIR(EE_PARA_START+0)
#define LINK(Instance, Class, Member)
IMPL_LINK(StackingResourceGroup, StackingChangeHdl, weld::Toggleable &, rRadio, void)