20 #undef SC_DLLIMPLEMENTATION
26 #include <strings.hrc>
29 #include <officecfg/Office/Calc.hxx>
35 :
SfxTabPage(pPage, pController,
"modules/scalc/ui/optformula.ui",
"OptFormula", &rCoreAttrs)
37 , mxLbFormulaSyntax(m_xBuilder->weld_combo_box(
"formulasyntax"))
38 , mxCbEnglishFuncName(m_xBuilder->weld_check_button(
"englishfuncname"))
39 , mxBtnCustomCalcDefault(m_xBuilder->weld_radio_button(
"calcdefault"))
40 , mxBtnCustomCalcCustom(m_xBuilder->weld_radio_button(
"calccustom"))
41 , mxBtnCustomCalcDetails(m_xBuilder->weld_button(
"details"))
42 , mxEdSepFuncArg(m_xBuilder->weld_entry(
"function"))
43 , mxEdSepArrayCol(m_xBuilder->weld_entry(
"arraycolumn"))
44 , mxEdSepArrayRow(m_xBuilder->weld_entry(
"arrayrow"))
45 , mxBtnSepReset(m_xBuilder->weld_button(
"reset"))
46 , mxLbOOXMLRecalcOptions(m_xBuilder->weld_combo_box(
"ooxmlrecalc"))
47 , mxLbODFRecalcOptions(m_xBuilder->weld_combo_box(
"odfrecalc"))
75 mnDecSep = aSep.isEmpty() ?
u'.' : aSep[0];
78 GetWhich(SID_SCDOCOPTIONS))).GetDocOptions();
87 OUString aFuncArg, aArrayCol, aArrayRow;
101 OUString sSepValue = pEdit->
get_text();
102 if (!sSepValue.isEmpty())
134 if (rSep.getLength() != 1)
138 if (rSep.compareToAscii(
"a") >= 0 && rSep.compareToAscii(
"z") <= 0)
141 if (rSep.compareToAscii(
"A") >= 0 && rSep.compareToAscii(
"Z") <= 0)
172 if (&rBtn == mxBtnSepReset.get())
174 else if (&rBtn == mxBtnCustomCalcDefault.get())
175 UpdateCustomCalcRadioButtons(
true);
176 else if (&rBtn == mxBtnCustomCalcCustom.get())
177 UpdateCustomCalcRadioButtons(
false);
178 else if (&rBtn == mxBtnCustomCalcDetails.get())
179 LaunchCustomCalcSettings();
184 if (!IsValidSeparator(rTest) && !maOldSepValue.isEmpty())
186 rTest = maOldSepValue;
193 if ((!IsValidSeparator(rTest) || rTest == mxEdSepArrayCol->get_text()) && !maOldSepValue.isEmpty())
194 rTest = maOldSepValue;
201 if ((!IsValidSeparator(rTest) || rTest == mxEdSepArrayRow->get_text()) && !maOldSepValue.isEmpty())
202 rTest = maOldSepValue;
208 OnFocusSeparatorInput(&
rEdit);
213 OnFocusSeparatorInput(dynamic_cast<weld::Entry*>(&rControl));
218 return std::make_unique<ScTpFormulaOptions>(pPage, pController, *rCoreSet);
290 if(SfxItemState::SET == rCoreSet->
GetItemState(SID_SCFORMULAOPTIONS,
false , &pItem))
291 aOpt = static_cast<const ScTpFormulaItem*>(pItem)->GetFormulaOptions();
298 case ::formula::FormulaGrammar::GRAM_NATIVE:
301 case ::formula::FormulaGrammar::GRAM_NATIVE_XL_A1:
304 case ::formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1:
312 mxLbFormulaSyntax->set_sensitive( !officecfg::Office::Calc::Formula::Syntax::Grammar::isReadOnly() );
317 mxLbOOXMLRecalcOptions->set_sensitive( !officecfg::Office::Calc::Formula::Load::OOXMLRecalcMode::isReadOnly() );
322 mxLbODFRecalcOptions->set_sensitive( !officecfg::Office::Calc::Formula::Load::ODFRecalcMode::isReadOnly() );
327 mxCbEnglishFuncName->set_sensitive( !officecfg::Office::Calc::Formula::Syntax::EnglishFunctionName::isReadOnly() );
334 if (aSep.getLength() == 1 && aSepArrayRow.getLength() == 1 && aSepArrayCol.getLength() == 1)
348 mxEdSepFuncArg->set_sensitive( !officecfg::Office::Calc::Formula::Syntax::SeparatorArg::isReadOnly() );
349 mxEdSepArrayCol->set_sensitive( !officecfg::Office::Calc::Formula::Syntax::SeparatorArrayCol::isReadOnly() );
350 mxEdSepArrayRow->set_sensitive( !officecfg::Office::Calc::Formula::Syntax::SeparatorArrayRow::isReadOnly() );
351 mxBtnSepReset->set_sensitive ( !officecfg::Office::Calc::Formula::Syntax::SeparatorArg::isReadOnly() &&
352 !officecfg::Office::Calc::Formula::Syntax::SeparatorArrayCol::isReadOnly() &&
353 !officecfg::Office::Calc::Formula::Syntax::SeparatorArrayRow::isReadOnly() );
370 return DeactivateRC::KeepPage;
#define LINK(Instance, Class, Member)
bool IsWriteCalcConfig() const
const OUString & getNumDecimalSep() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
virtual void select_region(int nStartPos, int nEndPos)=0
OUString ScResId(const char *pId)
virtual OUString get_text() const =0
static SC_DLLPUBLIC const LocaleDataWrapper * getLocaleDataPtr()
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
weld::Window * GetFrameWeld() const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void SetWriteCalcConfig(bool bVal)
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const