[Libreoffice-commits] .: 15 commits - officecfg/registry sc/AllLangResTarget_sc.mk sc/inc sc/Library_sc.mk sc/Library_scui.mk sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Wed May 30 08:36:45 PDT 2012
officecfg/registry/schema/org/openoffice/Office/Calc.xcs | 29 +
sc/AllLangResTarget_sc.mk | 1
sc/Library_sc.mk | 1
sc/Library_scui.mk | 1
sc/inc/calcconfig.hxx | 52 +++
sc/inc/formulaopt.hxx | 7
sc/inc/sc.hrc | 8
sc/source/core/inc/interpre.hxx | 7
sc/source/core/tool/calcconfig.cxx | 49 +++
sc/source/core/tool/formulaopt.cxx | 56 +++
sc/source/core/tool/interpr1.cxx | 20 -
sc/source/core/tool/interpr4.cxx | 9
sc/source/ui/docshell/docsh6.cxx | 7
sc/source/ui/inc/optdlg.hrc | 4
sc/source/ui/inc/tpformula.hxx | 14
sc/source/ui/optdlg/calcoptionsdlg.cxx | 221 +++++++++++++++
sc/source/ui/optdlg/calcoptionsdlg.hrc | 46 +++
sc/source/ui/optdlg/calcoptionsdlg.hxx | 81 +++++
sc/source/ui/optdlg/calcoptionsdlg.src | 106 +++++++
sc/source/ui/optdlg/tpformula.cxx | 75 ++++-
sc/source/ui/src/optdlg.src | 34 +-
sc/source/ui/src/scstring.src | 15 +
22 files changed, 811 insertions(+), 32 deletions(-)
New commits:
commit 78ed21e078aa7c8aa863594c9a4f6c2c7863cb0f
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed May 30 11:00:58 2012 -0400
Share common localized strings: Calc A1, Excel A1, and Excel R1C1.
Change-Id: Ia3fbdd8770ca2e2a0125bd39550ab44c1776e6d8
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 6939856..936de6e 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -1021,8 +1021,11 @@
#define SCSTR_QHELP_COLLAPSE_FORMULA (STR_START + 407)
#define SCSTR_EXTDOC_NOT_LOADED (STR_START + 408)
+#define SCSTR_FORMULA_SYNTAX_CALC_A1 (STR_START + 409)
+#define SCSTR_FORMULA_SYNTAX_XL_A1 (STR_START + 410)
+#define SCSTR_FORMULA_SYNTAX_XL_R1C1 (STR_START + 411)
-#define STR_END (SCSTR_EXTDOC_NOT_LOADED)
+#define STR_END (SCSTR_FORMULA_SYNTAX_XL_R1C1)
#define BMP_START (STR_END)
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index a661adc..d3eeaa5 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -91,6 +91,9 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(Window* pParent, const ScCalcConfig& rC
maFtAnnotation(this, ScResId(FT_ANNOTATION)),
maBtnOK(this, ScResId(BTN_OK)),
maBtnCancel(this, ScResId(BTN_CANCEL)),
+ maCalcA1(ScResId(SCSTR_FORMULA_SYNTAX_CALC_A1).toString()),
+ maExcelA1(ScResId(SCSTR_FORMULA_SYNTAX_XL_A1).toString()),
+ maExcelR1C1(ScResId(SCSTR_FORMULA_SYNTAX_XL_R1C1).toString()),
maCaptionIndirectSyntax(ScResId(STR_INDIRECT_SYNTAX_CAPTION).toString()),
maDescIndirectSyntax(ScResId(STR_INDIRECT_SYNTAX_DESC).toString()),
maUseFormulaSyntax(ScResId(STR_USE_FORMULA_SYNTAX).toString()),
@@ -143,9 +146,9 @@ void ScCalcOptionsDialog::SelectionChanged()
// Formula syntax for INDIRECT function.
maLbOptionEdit.Clear();
maLbOptionEdit.InsertEntry(maUseFormulaSyntax);
- maLbOptionEdit.InsertEntry(rtl::OUString("Calc A1"));
- maLbOptionEdit.InsertEntry(rtl::OUString("Excel A1"));
- maLbOptionEdit.InsertEntry(rtl::OUString("Excel R1C1"));
+ maLbOptionEdit.InsertEntry(maCalcA1);
+ maLbOptionEdit.InsertEntry(maExcelA1);
+ maLbOptionEdit.InsertEntry(maExcelR1C1);
switch (maConfig.meIndirectRefSyntax)
{
case formula::FormulaGrammar::CONV_OOO:
@@ -193,11 +196,11 @@ rtl::OUString ScCalcOptionsDialog::toString(formula::FormulaGrammar::AddressConv
switch (eConv)
{
case formula::FormulaGrammar::CONV_OOO:
- return rtl::OUString("Calc A1");
+ return maCalcA1;
case formula::FormulaGrammar::CONV_XL_A1:
- return rtl::OUString ("Excel A1");
+ return maExcelA1;
case formula::FormulaGrammar::CONV_XL_R1C1:
- return rtl::OUString("Excel R1C1");
+ return maExcelR1C1;
case formula::FormulaGrammar::CONV_UNSPECIFIED:
default:
;
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hxx b/sc/source/ui/optdlg/calcoptionsdlg.hxx
index 51781a6..d80def8 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.hxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.hxx
@@ -65,6 +65,10 @@ private:
OKButton maBtnOK;
CancelButton maBtnCancel;
+ rtl::OUString maCalcA1;
+ rtl::OUString maExcelA1;
+ rtl::OUString maExcelR1C1;
+
rtl::OUString maCaptionIndirectSyntax;
rtl::OUString maDescIndirectSyntax;
rtl::OUString maUseFormulaSyntax;
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index cb15a00..61d05fe 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -75,6 +75,10 @@ ScTpFormulaOptions::ScTpFormulaOptions(Window* pParent, const SfxItemSet& rCoreA
mnDecSep(0)
{
+ maLbFormulaSyntax.InsertEntry(ScResId(SCSTR_FORMULA_SYNTAX_CALC_A1).toString());
+ maLbFormulaSyntax.InsertEntry(ScResId(SCSTR_FORMULA_SYNTAX_XL_A1).toString());
+ maLbFormulaSyntax.InsertEntry(ScResId(SCSTR_FORMULA_SYNTAX_XL_R1C1).toString());
+
FreeResource();
Link aLink = LINK( this, ScTpFormulaOptions, ButtonHdl );
diff --git a/sc/source/ui/src/optdlg.src b/sc/source/ui/src/optdlg.src
index eddda53..4e00b1d 100644
--- a/sc/source/ui/src/optdlg.src
+++ b/sc/source/ui/src/optdlg.src
@@ -213,12 +213,6 @@ TabPage RID_SCPAGE_FORMULA
Pos = MAP_APPFONT ( 105, 20 ) ;
Size = MAP_APPFONT ( 60, 46 ) ;
DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "Calc A1" ; Default ; > ;
- < "Excel A1" ; Default ; > ;
- < "Excel R1C1" ; Default ; > ;
- };
};
CheckBox CB_ENGLISH_FUNC_NAME
diff --git a/sc/source/ui/src/scstring.src b/sc/source/ui/src/scstring.src
index c3f3e00..84b20eb 100644
--- a/sc/source/ui/src/scstring.src
+++ b/sc/source/ui/src/scstring.src
@@ -824,3 +824,18 @@ String SCSTR_EXTDOC_NOT_LOADED
{
Text [ en-US ] = "The following external file could not be loaded. Data linked from this file did not get updated." ;
};
+
+String SCSTR_FORMULA_SYNTAX_CALC_A1
+{
+ Text [ en-US ] = "Calc A1";
+};
+
+String SCSTR_FORMULA_SYNTAX_XL_A1
+{
+ Text [ en-US ] = "Excel A1";
+};
+
+String SCSTR_FORMULA_SYNTAX_XL_R1C1
+{
+ Text [ en-US ] = "Excel R1C1";
+};
commit 33d57704c6d79dbd806caf94124776a6a05152a1
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed May 30 10:03:05 2012 -0400
Reset the calc settings to default when the 'Default' button is checked.
Change-Id: Ia7eda2d9ff29b5997654fef1a01d637f474b06cc
diff --git a/sc/inc/calcconfig.hxx b/sc/inc/calcconfig.hxx
index 4af6222..7dd52ce 100644
--- a/sc/inc/calcconfig.hxx
+++ b/sc/inc/calcconfig.hxx
@@ -41,6 +41,8 @@ struct SC_DLLPUBLIC ScCalcConfig
ScCalcConfig();
+ void reset();
+
bool operator== (const ScCalcConfig& r) const;
bool operator!= (const ScCalcConfig& r) const;
};
diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx
index e4efbca..3f0fd35 100644
--- a/sc/source/core/tool/calcconfig.cxx
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -31,6 +31,11 @@
ScCalcConfig::ScCalcConfig() :
meIndirectRefSyntax(formula::FormulaGrammar::CONV_UNSPECIFIED) {}
+void ScCalcConfig::reset()
+{
+ *this = ScCalcConfig();
+}
+
bool ScCalcConfig::operator== (const ScCalcConfig& r) const
{
return meIndirectRefSyntax == r.meIndirectRefSyntax;
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index 6eb00b9..cb15a00 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -254,6 +254,12 @@ sal_Bool ScTpFormulaOptions::FillItemSet(SfxItemSet& rCoreSet)
OUString aSepArrayCol = maEdSepArrayCol.GetText();
OUString aSepArrayRow = maEdSepArrayRow.GetText();
+ if (maBtnCustomCalcDefault.IsChecked())
+ {
+ // When Default is selected, reset all the calc config settings to default.
+ maCurrentConfig.reset();
+ }
+
if ( maLbFormulaSyntax.GetSavedValue() != aSyntaxPos
|| maCbEnglishFuncName.GetSavedValue() != bEnglishFuncName
|| static_cast<OUString>(maEdSepFuncArg.GetSavedValue()) != aSep
commit 60ab58a17d39c84ddcad5789b0c7d60179286e1f
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed May 30 00:44:24 2012 -0400
Localize a string & more efficient list value update.
Change-Id: I061ded32454d2aca1eea7ad586de815d34cf386a
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index 83e1971..a661adc 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -62,23 +62,6 @@ void OptionString::Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 /*nFlags*/,
rDev.SetFont(aOldFont);
}
-rtl::OUString toString(formula::FormulaGrammar::AddressConvention eConv)
-{
- switch (eConv)
- {
- case formula::FormulaGrammar::CONV_OOO:
- return rtl::OUString("Calc A1");
- case formula::FormulaGrammar::CONV_XL_A1:
- return rtl::OUString ("Excel A1");
- case formula::FormulaGrammar::CONV_XL_R1C1:
- return rtl::OUString("Excel R1C1");
- case formula::FormulaGrammar::CONV_UNSPECIFIED:
- default:
- ;
- }
- return rtl::OUString("Use formula syntax");
-}
-
formula::FormulaGrammar::AddressConvention toAddressConvention(sal_uInt16 nPos)
{
switch (nPos)
@@ -110,6 +93,7 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(Window* pParent, const ScCalcConfig& rC
maBtnCancel(this, ScResId(BTN_CANCEL)),
maCaptionIndirectSyntax(ScResId(STR_INDIRECT_SYNTAX_CAPTION).toString()),
maDescIndirectSyntax(ScResId(STR_INDIRECT_SYNTAX_DESC).toString()),
+ maUseFormulaSyntax(ScResId(STR_USE_FORMULA_SYNTAX).toString()),
maConfig(rConfig)
{
maLbSettings.SetStyle(maLbSettings.GetStyle() | WB_CLIPCHILDREN | WB_FORCE_MAKEVISIBLE);
@@ -158,7 +142,7 @@ void ScCalcOptionsDialog::SelectionChanged()
{
// Formula syntax for INDIRECT function.
maLbOptionEdit.Clear();
- maLbOptionEdit.InsertEntry(rtl::OUString("Use formula syntax"));
+ maLbOptionEdit.InsertEntry(maUseFormulaSyntax);
maLbOptionEdit.InsertEntry(rtl::OUString("Calc A1"));
maLbOptionEdit.InsertEntry(rtl::OUString("Excel A1"));
maLbOptionEdit.InsertEntry(rtl::OUString("Excel R1C1"));
@@ -188,8 +172,37 @@ void ScCalcOptionsDialog::ListOptionValueChanged()
// Formula syntax for INDIRECT function.
sal_uInt16 nPos = maLbOptionEdit.GetSelectEntryPos();
maConfig.meIndirectRefSyntax = toAddressConvention(nPos);
- FillOptionsList();
+
+ maLbSettings.SetUpdateMode(false);
+
+ SvLBoxTreeList* pModel = maLbSettings.GetModel();
+ SvLBoxEntry* pEntry = pModel->GetEntry(NULL, 0);
+ if (!pEntry)
+ return;
+
+ OptionString* pItem = new OptionString(
+ maCaptionIndirectSyntax, toString(maConfig.meIndirectRefSyntax));
+ pEntry->ReplaceItem(pItem, 2);
+
+ maLbSettings.SetUpdateMode(true);
+ }
+}
+
+rtl::OUString ScCalcOptionsDialog::toString(formula::FormulaGrammar::AddressConvention eConv) const
+{
+ switch (eConv)
+ {
+ case formula::FormulaGrammar::CONV_OOO:
+ return rtl::OUString("Calc A1");
+ case formula::FormulaGrammar::CONV_XL_A1:
+ return rtl::OUString ("Excel A1");
+ case formula::FormulaGrammar::CONV_XL_R1C1:
+ return rtl::OUString("Excel R1C1");
+ case formula::FormulaGrammar::CONV_UNSPECIFIED:
+ default:
+ ;
}
+ return maUseFormulaSyntax;
}
IMPL_LINK(ScCalcOptionsDialog, SettingsSelHdl, Control*, pCtrl)
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hrc b/sc/source/ui/optdlg/calcoptionsdlg.hrc
index d0049b9..9620d49 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.hrc
+++ b/sc/source/ui/optdlg/calcoptionsdlg.hrc
@@ -41,4 +41,6 @@
#define STR_INDIRECT_SYNTAX_CAPTION 22
#define STR_INDIRECT_SYNTAX_DESC 23
+#define STR_USE_FORMULA_SYNTAX 24
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hxx b/sc/source/ui/optdlg/calcoptionsdlg.hxx
index fbd4ba5..51781a6 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.hxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.hxx
@@ -51,6 +51,8 @@ private:
void SelectionChanged();
void ListOptionValueChanged();
+ rtl::OUString toString(formula::FormulaGrammar::AddressConvention eConv) const;
+
private:
SvxCheckListBox maLbSettings;
@@ -65,6 +67,7 @@ private:
rtl::OUString maCaptionIndirectSyntax;
rtl::OUString maDescIndirectSyntax;
+ rtl::OUString maUseFormulaSyntax;
ScCalcConfig maConfig;
};
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.src b/sc/source/ui/optdlg/calcoptionsdlg.src
index a420f6e..7c8c1d9 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.src
+++ b/sc/source/ui/optdlg/calcoptionsdlg.src
@@ -98,4 +98,9 @@ ModalDialog RID_SCDLG_FORMULA_CALCOPTIONS
{
Text [ en-US ] = "Formula syntax that built-in function INDIRECT expects.";
};
+
+ String STR_USE_FORMULA_SYNTAX
+ {
+ Text [ en-US ] = "Use formula syntax";
+ };
};
commit ef3fd657ba4d12062609e42f0ec19a9aa71b1c9c
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed May 30 00:19:30 2012 -0400
Get the sub dialog functional.
Change-Id: Ib3311f64417b68cf94505aeb7f8b153cf5fcdbff
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index 2e22da6..83e1971 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -62,6 +62,41 @@ void OptionString::Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 /*nFlags*/,
rDev.SetFont(aOldFont);
}
+rtl::OUString toString(formula::FormulaGrammar::AddressConvention eConv)
+{
+ switch (eConv)
+ {
+ case formula::FormulaGrammar::CONV_OOO:
+ return rtl::OUString("Calc A1");
+ case formula::FormulaGrammar::CONV_XL_A1:
+ return rtl::OUString ("Excel A1");
+ case formula::FormulaGrammar::CONV_XL_R1C1:
+ return rtl::OUString("Excel R1C1");
+ case formula::FormulaGrammar::CONV_UNSPECIFIED:
+ default:
+ ;
+ }
+ return rtl::OUString("Use formula syntax");
+}
+
+formula::FormulaGrammar::AddressConvention toAddressConvention(sal_uInt16 nPos)
+{
+ switch (nPos)
+ {
+ case 1:
+ return formula::FormulaGrammar::CONV_OOO;
+ case 2:
+ return formula::FormulaGrammar::CONV_XL_A1;
+ case 3:
+ return formula::FormulaGrammar::CONV_XL_R1C1;
+ case 0:
+ default:
+ ;
+ }
+
+ return formula::FormulaGrammar::CONV_UNSPECIFIED;
+}
+
}
ScCalcOptionsDialog::ScCalcOptionsDialog(Window* pParent, const ScCalcConfig& rConfig) :
@@ -80,8 +115,9 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(Window* pParent, const ScCalcConfig& rC
maLbSettings.SetStyle(maLbSettings.GetStyle() | WB_CLIPCHILDREN | WB_FORCE_MAKEVISIBLE);
maLbSettings.SetHighlightRange();
- maLbSettings.SetSelectHdl(LINK(this, ScCalcOptionsDialog, SettingsSelHdl));
- maLbSettings.SetDoubleClickHdl(LINK(this, ScCalcOptionsDialog, SettingsDoubleClickHdl));
+ Link aLink = LINK(this, ScCalcOptionsDialog, SettingsSelHdl);
+ maLbSettings.SetSelectHdl(aLink);
+ maLbOptionEdit.SetSelectHdl(aLink);
FillOptionsList();
FreeResource();
@@ -90,18 +126,28 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(Window* pParent, const ScCalcConfig& rC
ScCalcOptionsDialog::~ScCalcOptionsDialog() {}
+const ScCalcConfig& ScCalcOptionsDialog::GetConfig() const
+{
+ return maConfig;
+}
+
void ScCalcOptionsDialog::FillOptionsList()
{
maLbSettings.SetUpdateMode(false);
+ maLbSettings.Clear();
SvLBoxTreeList* pModel = maLbSettings.GetModel();
- SvLBoxEntry* pEntry = new SvLBoxEntry;
- pEntry->AddItem(new SvLBoxString(pEntry, 0, rtl::OUString()));
- pEntry->AddItem(new SvLBoxContextBmp(pEntry, 0, Image(), Image(), 0));
- OptionString* pItem = new OptionString(maCaptionIndirectSyntax, "Calc A1");
- pEntry->AddItem(pItem);
- pModel->Insert(pEntry);
+ {
+ // Syntax for INDIRECT function.
+ SvLBoxEntry* pEntry = new SvLBoxEntry;
+ pEntry->AddItem(new SvLBoxString(pEntry, 0, rtl::OUString()));
+ pEntry->AddItem(new SvLBoxContextBmp(pEntry, 0, Image(), Image(), 0));
+ OptionString* pItem = new OptionString(
+ maCaptionIndirectSyntax, toString(maConfig.meIndirectRefSyntax));
+ pEntry->AddItem(pItem);
+ pModel->Insert(pEntry);
+ }
maLbSettings.SetUpdateMode(true);
}
@@ -112,27 +158,47 @@ void ScCalcOptionsDialog::SelectionChanged()
{
// Formula syntax for INDIRECT function.
maLbOptionEdit.Clear();
+ maLbOptionEdit.InsertEntry(rtl::OUString("Use formula syntax"));
maLbOptionEdit.InsertEntry(rtl::OUString("Calc A1"));
maLbOptionEdit.InsertEntry(rtl::OUString("Excel A1"));
maLbOptionEdit.InsertEntry(rtl::OUString("Excel R1C1"));
- maLbOptionEdit.SelectEntryPos(0);
+ switch (maConfig.meIndirectRefSyntax)
+ {
+ case formula::FormulaGrammar::CONV_OOO:
+ maLbOptionEdit.SelectEntryPos(1);
+ break;
+ case formula::FormulaGrammar::CONV_XL_A1:
+ maLbOptionEdit.SelectEntryPos(2);
+ break;
+ case formula::FormulaGrammar::CONV_XL_R1C1:
+ maLbOptionEdit.SelectEntryPos(3);
+ break;
+ case formula::FormulaGrammar::CONV_UNSPECIFIED:
+ default:
+ maLbOptionEdit.SelectEntryPos(0);
+ }
maFtAnnotation.SetText(maDescIndirectSyntax);
}
}
-void ScCalcOptionsDialog::EditOption()
+void ScCalcOptionsDialog::ListOptionValueChanged()
{
+ if (true)
+ {
+ // Formula syntax for INDIRECT function.
+ sal_uInt16 nPos = maLbOptionEdit.GetSelectEntryPos();
+ maConfig.meIndirectRefSyntax = toAddressConvention(nPos);
+ FillOptionsList();
+ }
}
-IMPL_LINK_NOARG(ScCalcOptionsDialog, SettingsSelHdl)
+IMPL_LINK(ScCalcOptionsDialog, SettingsSelHdl, Control*, pCtrl)
{
- SelectionChanged();
- return 0;
-}
+ if (pCtrl == &maLbSettings)
+ SelectionChanged();
+ else if (pCtrl == &maLbOptionEdit)
+ ListOptionValueChanged();
-IMPL_LINK_NOARG(ScCalcOptionsDialog, SettingsDoubleClickHdl)
-{
- EditOption();
return 0;
}
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hxx b/sc/source/ui/optdlg/calcoptionsdlg.hxx
index b7263c8..fbd4ba5 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.hxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.hxx
@@ -42,13 +42,14 @@ public:
ScCalcOptionsDialog(Window* pParent, const ScCalcConfig& rConfig);
virtual ~ScCalcOptionsDialog();
- DECL_LINK( SettingsSelHdl, void* );
- DECL_LINK( SettingsDoubleClickHdl, void* );
+ DECL_LINK( SettingsSelHdl, Control* );
+
+ const ScCalcConfig& GetConfig() const;
private:
void FillOptionsList();
void SelectionChanged();
- void EditOption();
+ void ListOptionValueChanged();
private:
SvxCheckListBox maLbSettings;
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.src b/sc/source/ui/optdlg/calcoptionsdlg.src
index cb0571b..a420f6e 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.src
+++ b/sc/source/ui/optdlg/calcoptionsdlg.src
@@ -54,8 +54,8 @@ ModalDialog RID_SCDLG_FORMULA_CALCOPTIONS
ListBox LB_OPTION_EDIT
{
- Pos = MAP_APPFONT ( 50 , 82 ) ;
- Size = MAP_APPFONT ( 60, 46 ) ;
+ Pos = MAP_APPFONT ( 50, 82 ) ;
+ Size = MAP_APPFONT ( 100, 46 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
};
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index 0632705..6eb00b9 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -144,7 +144,7 @@ void ScTpFormulaOptions::LaunchCustomCalcSettings()
ScCalcOptionsDialog aDlg(this, maCurrentConfig);
if (aDlg.Execute() == RET_OK)
{
-
+ maCurrentConfig = aDlg.GetConfig();
}
}
commit 7dd9054bdef2ac169212a74e1eff52c8f0847e8f
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue May 29 23:33:17 2012 -0400
Pass the config data to the sub-dialog.
Change-Id: I7d5e5cd22a64446c379446372f29bf1c597bd783
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index be6803b..2e22da6 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -64,7 +64,7 @@ void OptionString::Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 /*nFlags*/,
}
-ScCalcOptionsDialog::ScCalcOptionsDialog(Window* pParent) :
+ScCalcOptionsDialog::ScCalcOptionsDialog(Window* pParent, const ScCalcConfig& rConfig) :
ModalDialog(pParent, ScResId(RID_SCDLG_FORMULA_CALCOPTIONS)),
maLbSettings(this, ScResId(LB_SETTINGS)),
maFtOptionEditCaption(this, ScResId(FT_OPTION_EDIT_CAPTION)),
@@ -74,7 +74,8 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(Window* pParent) :
maBtnOK(this, ScResId(BTN_OK)),
maBtnCancel(this, ScResId(BTN_CANCEL)),
maCaptionIndirectSyntax(ScResId(STR_INDIRECT_SYNTAX_CAPTION).toString()),
- maDescIndirectSyntax(ScResId(STR_INDIRECT_SYNTAX_DESC).toString())
+ maDescIndirectSyntax(ScResId(STR_INDIRECT_SYNTAX_DESC).toString()),
+ maConfig(rConfig)
{
maLbSettings.SetStyle(maLbSettings.GetStyle() | WB_CLIPCHILDREN | WB_FORCE_MAKEVISIBLE);
maLbSettings.SetHighlightRange();
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hxx b/sc/source/ui/optdlg/calcoptionsdlg.hxx
index a812d92..b7263c8 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.hxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.hxx
@@ -34,10 +34,12 @@
#include "vcl/fixed.hxx"
#include "svx/checklbx.hxx"
+#include "calcconfig.hxx"
+
class ScCalcOptionsDialog : public ModalDialog
{
public:
- ScCalcOptionsDialog(Window* pParent);
+ ScCalcOptionsDialog(Window* pParent, const ScCalcConfig& rConfig);
virtual ~ScCalcOptionsDialog();
DECL_LINK( SettingsSelHdl, void* );
@@ -62,6 +64,8 @@ private:
rtl::OUString maCaptionIndirectSyntax;
rtl::OUString maDescIndirectSyntax;
+
+ ScCalcConfig maConfig;
};
#endif
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index eb88215..0632705 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -141,7 +141,7 @@ void ScTpFormulaOptions::UpdateCustomCalcRadioButtons(bool bDefault)
void ScTpFormulaOptions::LaunchCustomCalcSettings()
{
- ScCalcOptionsDialog aDlg(this);
+ ScCalcOptionsDialog aDlg(this, maCurrentConfig);
if (aDlg.Execute() == RET_OK)
{
commit b52fc9ad0469f5a16496b2eb5a6b77e3028814ee
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue May 29 23:25:06 2012 -0400
Create a common struct for interpreter config options.
And use it both in the core interpreter and the configuration UI.
Change-Id: Ia2a16fcb53025840d906864b564255cd3c53e8e9
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 20a5eaf..72d9da3 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -158,6 +158,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/core/tool/adiasync \
sc/source/core/tool/appoptio \
sc/source/core/tool/autoform \
+ sc/source/core/tool/calcconfig \
sc/source/core/tool/callform \
sc/source/core/tool/cellform \
sc/source/core/tool/cellkeytranslator \
diff --git a/sc/inc/calcconfig.hxx b/sc/inc/calcconfig.hxx
new file mode 100644
index 0000000..4af6222
--- /dev/null
+++ b/sc/inc/calcconfig.hxx
@@ -0,0 +1,50 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Kohei Yoshida <kohei.yoshida at suse.com>
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef __SC_CALCCONFIG_HXX__
+#define __SC_CALCCONFIG_HXX__
+
+#include "scdllapi.h"
+#include "formula/grammar.hxx"
+
+/**
+ * Configuration options for formula interpreter.
+ */
+struct SC_DLLPUBLIC ScCalcConfig
+{
+ formula::FormulaGrammar::AddressConvention meIndirectRefSyntax;
+
+ ScCalcConfig();
+
+ bool operator== (const ScCalcConfig& r) const;
+ bool operator!= (const ScCalcConfig& r) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 1833a65..c92ad0c 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -37,6 +37,7 @@
#include "document.hxx"
#include "scmatrix.hxx"
#include "externalrefmgr.hxx"
+#include "calcconfig.hxx"
#include <math.h>
#include <map>
@@ -98,14 +99,8 @@ public:
DECL_FIXEDMEMPOOL_NEWDEL( ScInterpreter )
- struct Config
- {
- formula::FormulaGrammar::AddressConvention meIndirectRefSyntax;
- Config();
- };
-
- static void SetGlobalConfig(const Config& rConfig);
- static const Config& GetGlobalConfig();
+ static void SetGlobalConfig(const ScCalcConfig& rConfig);
+ static const ScCalcConfig& GetGlobalConfig();
static void GlobalExit(); // aus ScGlobal::Clear() gerufen
@@ -130,7 +125,7 @@ public:
VolatileType GetVolatileType() const;
private:
- static Config maGlobalConfig;
+ static ScCalcConfig maGlobalConfig;
static ScTokenStack* pGlobalStack;
static bool bGlobalStackInUse;
diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx
new file mode 100644
index 0000000..e4efbca
--- /dev/null
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Kohei Yoshida <kohei.yoshida at suse.com>
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include "calcconfig.hxx"
+
+ScCalcConfig::ScCalcConfig() :
+ meIndirectRefSyntax(formula::FormulaGrammar::CONV_UNSPECIFIED) {}
+
+bool ScCalcConfig::operator== (const ScCalcConfig& r) const
+{
+ return meIndirectRefSyntax == r.meIndirectRefSyntax;
+}
+
+bool ScCalcConfig::operator!= (const ScCalcConfig& r) const
+{
+ return !operator==(r);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index a145dd6..c689df9 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -82,7 +82,7 @@ static const sal_uInt64 n2power48 = SAL_CONST_UINT64( 281474976710656); // 2^48
IMPL_FIXEDMEMPOOL_NEWDEL( ScTokenStack )
IMPL_FIXEDMEMPOOL_NEWDEL( ScInterpreter )
-ScInterpreter::Config ScInterpreter::maGlobalConfig;
+ScCalcConfig ScInterpreter::maGlobalConfig;
ScTokenStack* ScInterpreter::pGlobalStack = NULL;
bool ScInterpreter::bGlobalStackInUse = false;
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index fe75f61..4a10201 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -3692,15 +3692,12 @@ ScInterpreter::~ScInterpreter()
delete pTokenMatrixMap;
}
-ScInterpreter::Config::Config() :
- meIndirectRefSyntax(formula::FormulaGrammar::CONV_UNSPECIFIED) {}
-
-void ScInterpreter::SetGlobalConfig(const Config& rConfig)
+void ScInterpreter::SetGlobalConfig(const ScCalcConfig& rConfig)
{
maGlobalConfig = rConfig;
}
-const ScInterpreter::Config& ScInterpreter::GetGlobalConfig()
+const ScCalcConfig& ScInterpreter::GetGlobalConfig()
{
return maGlobalConfig;
}
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index 5ca7d45..1cdaf4a 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -51,6 +51,7 @@
#include "scmod.hxx"
#include "compiler.hxx"
#include "interpre.hxx"
+#include "calcconfig.hxx"
#include "formula/FormulaCompiler.hxx"
#include "comphelper/processfactory.hxx"
@@ -507,7 +508,7 @@ void ScDocShell::SetFormulaOptions(const ScFormulaOptions& rOpt )
rOpt.GetFormulaSepArg(), rOpt.GetFormulaSepArrayCol(), rOpt.GetFormulaSepArrayRow());
// Global interpreter settings.
- ScInterpreter::Config aConfig;
+ ScCalcConfig aConfig;
aConfig.meIndirectRefSyntax = rOpt.GetIndirectFuncSyntax();
ScInterpreter::SetGlobalConfig(aConfig);
}
diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx
index bf90825..ea9ea6a 100644
--- a/sc/source/ui/inc/tpformula.hxx
+++ b/sc/source/ui/inc/tpformula.hxx
@@ -35,6 +35,8 @@
#include <vcl/edit.hxx>
#include <vcl/button.hxx>
+#include "calcconfig.hxx"
+
class ScTpFormulaOptions : public SfxTabPage
{
public:
@@ -86,6 +88,9 @@ private:
This value is used to revert undesired value change. */
::rtl::OUString maOldSepValue;
+ ScCalcConfig maSavedConfig;
+ ScCalcConfig maCurrentConfig;
+
sal_Unicode mnDecSep;
};
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index 814e328..eb88215 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -246,7 +246,7 @@ SfxTabPage* ScTpFormulaOptions::Create(Window* pParent, const SfxItemSet& rCoreS
sal_Bool ScTpFormulaOptions::FillItemSet(SfxItemSet& rCoreSet)
{
- sal_Bool bRet = false;
+ bool bRet = false;
ScFormulaOptions aOpt;
sal_Bool bEnglishFuncName = maCbEnglishFuncName.IsChecked();
sal_Int16 aSyntaxPos = maLbFormulaSyntax.GetSelectEntryPos();
@@ -258,7 +258,8 @@ sal_Bool ScTpFormulaOptions::FillItemSet(SfxItemSet& rCoreSet)
|| maCbEnglishFuncName.GetSavedValue() != bEnglishFuncName
|| static_cast<OUString>(maEdSepFuncArg.GetSavedValue()) != aSep
|| static_cast<OUString>(maEdSepArrayCol.GetSavedValue()) != aSepArrayCol
- || static_cast<OUString>(maEdSepArrayRow.GetSavedValue()) != aSepArrayRow )
+ || static_cast<OUString>(maEdSepArrayRow.GetSavedValue()) != aSepArrayRow
+ || maSavedConfig != maCurrentConfig )
{
::formula::FormulaGrammar::Grammar eGram = ::formula::FormulaGrammar::GRAM_DEFAULT;
@@ -280,6 +281,7 @@ sal_Bool ScTpFormulaOptions::FillItemSet(SfxItemSet& rCoreSet)
aOpt.SetFormulaSepArg(aSep);
aOpt.SetFormulaSepArrayCol(aSepArrayCol);
aOpt.SetFormulaSepArrayRow(aSepArrayRow);
+ aOpt.SetIndirectFuncSyntax(maCurrentConfig.meIndirectRefSyntax);
rCoreSet.Put( ScTpFormulaItem( SID_SCFORMULAOPTIONS, aOpt ) );
bRet = true;
@@ -340,9 +342,12 @@ void ScTpFormulaOptions::Reset(const SfxItemSet& rCoreSet)
// detailed calc settings.
ScFormulaOptions aDefaults;
- formula::FormulaGrammar::AddressConvention eConv = aOpt.GetIndirectFuncSyntax();
- bool bDefault = aDefaults.GetIndirectFuncSyntax() == eConv;
+
+ maSavedConfig.meIndirectRefSyntax = aOpt.GetIndirectFuncSyntax();
+ bool bDefault = aDefaults.GetIndirectFuncSyntax() == maSavedConfig.meIndirectRefSyntax;
UpdateCustomCalcRadioButtons(bDefault);
+
+ maCurrentConfig = maSavedConfig;
}
int ScTpFormulaOptions::DeactivatePage(SfxItemSet* /*pSet*/)
commit bebc0e4286edefc20e31b554bccb867274e82a5c
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue May 29 22:33:09 2012 -0400
Update the buttons for calc settings on various events.
Change-Id: Icd9de3b714da29df95912ff27b25223c306f1962
diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx
index a498991..bc706dc 100644
--- a/sc/source/core/tool/formulaopt.cxx
+++ b/sc/source/core/tool/formulaopt.cxx
@@ -55,6 +55,7 @@ ScFormulaOptions::ScFormulaOptions()
ScFormulaOptions::ScFormulaOptions( const ScFormulaOptions& rCpy ) :
bUseEnglishFuncName ( rCpy.bUseEnglishFuncName ),
eFormulaGrammar ( rCpy.eFormulaGrammar ),
+ eIndirectFuncRefSyntax(rCpy.eIndirectFuncRefSyntax),
aFormulaSepArg ( rCpy.aFormulaSepArg ),
aFormulaSepArrayRow ( rCpy.aFormulaSepArrayRow ),
aFormulaSepArrayCol ( rCpy.aFormulaSepArrayCol )
@@ -143,6 +144,7 @@ ScFormulaOptions& ScFormulaOptions::operator=( const ScFormulaOptions& rCpy )
{
bUseEnglishFuncName = rCpy.bUseEnglishFuncName;
eFormulaGrammar = rCpy.eFormulaGrammar;
+ eIndirectFuncRefSyntax = rCpy.eIndirectFuncRefSyntax;
aFormulaSepArg = rCpy.aFormulaSepArg;
aFormulaSepArrayRow = rCpy.aFormulaSepArrayRow;
aFormulaSepArrayCol = rCpy.aFormulaSepArrayCol;
@@ -153,6 +155,7 @@ bool ScFormulaOptions::operator==( const ScFormulaOptions& rOpt ) const
{
return bUseEnglishFuncName == rOpt.bUseEnglishFuncName
&& eFormulaGrammar == rOpt.eFormulaGrammar
+ && eIndirectFuncRefSyntax == rOpt.eIndirectFuncRefSyntax
&& aFormulaSepArg == rOpt.aFormulaSepArg
&& aFormulaSepArrayRow == rOpt.aFormulaSepArrayRow
&& aFormulaSepArrayCol == rOpt.aFormulaSepArrayCol;
@@ -304,6 +307,7 @@ ScFormulaCfg::ScFormulaCfg() :
if ((pValues[nProp] >>= aSep) && !aSep.isEmpty())
SetFormulaSepArrayCol(aSep);
}
+ break;
case SCFORMULAOPT_INDIRECT_GRAMMAR:
{
// Get default value in case this option is not set.
@@ -337,7 +341,6 @@ ScFormulaCfg::ScFormulaCfg() :
SetIndirectFuncSyntax(eConv);
}
break;
- break;
}
}
}
diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx
index 808e0ef..bf90825 100644
--- a/sc/source/ui/inc/tpformula.hxx
+++ b/sc/source/ui/inc/tpformula.hxx
@@ -52,12 +52,13 @@ private:
void ResetSeparators();
void OnFocusSeparatorInput(Edit* pEdit);
+ void UpdateCustomCalcRadioButtons(bool bDefault);
void LaunchCustomCalcSettings();
bool IsValidSeparator(const ::rtl::OUString& rSep) const;
bool IsValidSeparatorSet() const;
- DECL_LINK( ButtonHdl, PushButton* );
+ DECL_LINK( ButtonHdl, Button* );
DECL_LINK( SepModifyHdl, Edit* );
DECL_LINK( SepEditOnFocusHdl, Edit* );
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index b75c739..814e328 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -79,6 +79,8 @@ ScTpFormulaOptions::ScTpFormulaOptions(Window* pParent, const SfxItemSet& rCoreA
Link aLink = LINK( this, ScTpFormulaOptions, ButtonHdl );
maBtnSepReset.SetClickHdl(aLink);
+ maBtnCustomCalcDefault.SetClickHdl(aLink);
+ maBtnCustomCalcCustom.SetClickHdl(aLink);
maBtnCustomCalcDetails.SetClickHdl(aLink);
aLink = LINK( this, ScTpFormulaOptions, SepModifyHdl );
@@ -121,6 +123,22 @@ void ScTpFormulaOptions::OnFocusSeparatorInput(Edit* pEdit)
maOldSepValue = pEdit->GetText();
}
+void ScTpFormulaOptions::UpdateCustomCalcRadioButtons(bool bDefault)
+{
+ if (bDefault)
+ {
+ maBtnCustomCalcDefault.Check(true);
+ maBtnCustomCalcCustom.Check(false);
+ maBtnCustomCalcDetails.Disable();
+ }
+ else
+ {
+ maBtnCustomCalcDefault.Check(false);
+ maBtnCustomCalcCustom.Check(true);
+ maBtnCustomCalcDetails.Enable();
+ }
+}
+
void ScTpFormulaOptions::LaunchCustomCalcSettings()
{
ScCalcOptionsDialog aDlg(this);
@@ -179,10 +197,14 @@ bool ScTpFormulaOptions::IsValidSeparatorSet() const
return true;
}
-IMPL_LINK( ScTpFormulaOptions, ButtonHdl, PushButton*, pBtn )
+IMPL_LINK( ScTpFormulaOptions, ButtonHdl, Button*, pBtn )
{
if (pBtn == &maBtnSepReset)
ResetSeparators();
+ else if (pBtn == &maBtnCustomCalcDefault)
+ UpdateCustomCalcRadioButtons(true);
+ else if (pBtn == &maBtnCustomCalcCustom)
+ UpdateCustomCalcRadioButtons(false);
else if (pBtn == &maBtnCustomCalcDetails)
LaunchCustomCalcSettings();
@@ -315,6 +337,12 @@ void ScTpFormulaOptions::Reset(const SfxItemSet& rCoreSet)
}
else
ResetSeparators();
+
+ // detailed calc settings.
+ ScFormulaOptions aDefaults;
+ formula::FormulaGrammar::AddressConvention eConv = aOpt.GetIndirectFuncSyntax();
+ bool bDefault = aDefaults.GetIndirectFuncSyntax() == eConv;
+ UpdateCustomCalcRadioButtons(bDefault);
}
int ScTpFormulaOptions::DeactivatePage(SfxItemSet* /*pSet*/)
commit 682a81352f6ce9d743ca73c02df5c36b0c6f1253
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue May 29 21:48:23 2012 -0400
Get the current decimal separator from ScGlobal.
Change-Id: I6d7bf97d856272810d8ef5eb382d7b299b74d16e
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index 4ed483d..b75c739 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -92,13 +92,7 @@ ScTpFormulaOptions::ScTpFormulaOptions(Window* pParent, const SfxItemSet& rCoreA
maEdSepArrayRow.SetGetFocusHdl(aLink);
// Get the decimal separator for current locale.
- ScFormulaOptions aOpt;
- const SfxPoolItem* pItem = NULL;
-
- if(SFX_ITEM_SET == rCoreAttrs.GetItemState(SID_SCFORMULAOPTIONS, false , &pItem))
- aOpt = ((const ScTpFormulaItem*)pItem)->GetFormulaOptions();
-
- rtl::OUString aSep = aOpt.GetLocaleDataWrapper().getNumDecimalSep();
+ rtl::OUString aSep = ScGlobal::GetpLocaleData()->getNumDecimalSep();
mnDecSep = aSep.isEmpty() ? sal_Unicode('.') : aSep[0];
}
commit 05a2a99dd7ee9e7bfb2797e33c5ae04e4b6e3686
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue May 29 21:39:15 2012 -0400
Reset option.
Change-Id: Id800b3590425ddb3cc804dabf842b700dc27db43
diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx
index 5b8ec5e..a498991 100644
--- a/sc/source/core/tool/formulaopt.cxx
+++ b/sc/source/core/tool/formulaopt.cxx
@@ -70,6 +70,9 @@ void ScFormulaOptions::SetDefaults()
bUseEnglishFuncName = false;
eFormulaGrammar = ::formula::FormulaGrammar::GRAM_NATIVE;
+ // unspecified means use the current formula syntax.
+ eIndirectFuncRefSyntax = formula::FormulaGrammar::CONV_UNSPECIFIED;
+
ResetFormulaSeparators();
}
commit 9e4a067a9713dd4d03495d6a0e18d5f95e973692
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue May 29 21:18:20 2012 -0400
Use the new option when interpreting INDIRECT function.
Change-Id: Ic9ba214e5bbee64287934437fcdb63117a1146f6
diff --git a/sc/inc/formulaopt.hxx b/sc/inc/formulaopt.hxx
index 50d3b9c..8186d8a 100644
--- a/sc/inc/formulaopt.hxx
+++ b/sc/inc/formulaopt.hxx
@@ -40,7 +40,8 @@ class SC_DLLPUBLIC ScFormulaOptions
{
private:
bool bUseEnglishFuncName; // use English function name even if the locale is not English.
- ::formula::FormulaGrammar::Grammar eFormulaGrammar; // formula grammar used to switch different formula syntax
+ formula::FormulaGrammar::Grammar eFormulaGrammar; // formula grammar used to switch different formula syntax
+ formula::FormulaGrammar::AddressConvention eIndirectFuncRefSyntax;
::rtl::OUString aFormulaSepArg;
::rtl::OUString aFormulaSepArrayRow;
@@ -56,6 +57,9 @@ public:
void SetFormulaSyntax( ::formula::FormulaGrammar::Grammar eGram ) { eFormulaGrammar = eGram; }
::formula::FormulaGrammar::Grammar GetFormulaSyntax() const { return eFormulaGrammar; }
+ void SetIndirectFuncSyntax(formula::FormulaGrammar::AddressConvention eConv) { eIndirectFuncRefSyntax = eConv; }
+ formula::FormulaGrammar::AddressConvention GetIndirectFuncSyntax() const { return eIndirectFuncRefSyntax; }
+
void SetUseEnglishFuncName( bool bVal ) { bUseEnglishFuncName = bVal; }
bool GetUseEnglishFuncName() const { return bUseEnglishFuncName; }
@@ -77,7 +81,6 @@ public:
ScFormulaOptions& operator= ( const ScFormulaOptions& rCpy );
bool operator== ( const ScFormulaOptions& rOpt ) const;
bool operator!= ( const ScFormulaOptions& rOpt ) const;
-
};
//==================================================================
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 5f57fef..1833a65 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -95,8 +95,18 @@ class ScInterpreter
friend class ScChiSqDistFunction;
public:
+
DECL_FIXEDMEMPOOL_NEWDEL( ScInterpreter )
+ struct Config
+ {
+ formula::FormulaGrammar::AddressConvention meIndirectRefSyntax;
+ Config();
+ };
+
+ static void SetGlobalConfig(const Config& rConfig);
+ static const Config& GetGlobalConfig();
+
static void GlobalExit(); // aus ScGlobal::Clear() gerufen
/// Could string be a regular expression?
@@ -120,6 +130,8 @@ public:
VolatileType GetVolatileType() const;
private:
+ static Config maGlobalConfig;
+
static ScTokenStack* pGlobalStack;
static bool bGlobalStackInUse;
diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx
index 9468f09..5b8ec5e 100644
--- a/sc/source/core/tool/formulaopt.cxx
+++ b/sc/source/core/tool/formulaopt.cxx
@@ -206,7 +206,8 @@ SfxPoolItem* ScTpFormulaItem::Clone( SfxItemPool * ) const
#define SCFORMULAOPT_SEP_ARG 2
#define SCFORMULAOPT_SEP_ARRAY_ROW 3
#define SCFORMULAOPT_SEP_ARRAY_COL 4
-#define SCFORMULAOPT_COUNT 5
+#define SCFORMULAOPT_INDIRECT_GRAMMAR 5
+#define SCFORMULAOPT_COUNT 6
Sequence<OUString> ScFormulaCfg::GetPropertyNames()
{
@@ -217,6 +218,7 @@ Sequence<OUString> ScFormulaCfg::GetPropertyNames()
"Syntax/SeparatorArg", // SCFORMULAOPT_SEP_ARG
"Syntax/SeparatorArrayRow", // SCFORMULAOPT_SEP_ARRAY_ROW
"Syntax/SeparatorArrayCol", // SCFORMULAOPT_SEP_ARRAY_COL
+ "Syntax/IndirectFuncGrammar", // SCFORMULAOPT_INDIRECT_GRAMMAR
};
Sequence<OUString> aNames(SCFORMULAOPT_COUNT);
OUString* pNames = aNames.getArray();
@@ -299,6 +301,39 @@ ScFormulaCfg::ScFormulaCfg() :
if ((pValues[nProp] >>= aSep) && !aSep.isEmpty())
SetFormulaSepArrayCol(aSep);
}
+ case SCFORMULAOPT_INDIRECT_GRAMMAR:
+ {
+ // Get default value in case this option is not set.
+ ::formula::FormulaGrammar::AddressConvention eConv = GetIndirectFuncSyntax();
+
+ do
+ {
+ if (!(pValues[nProp] >>= nIntVal))
+ // extractino failed.
+ break;
+
+ switch (nIntVal)
+ {
+ case -1: // Same as the formula grammar.
+ eConv = formula::FormulaGrammar::CONV_UNSPECIFIED;
+ break;
+ case 0: // Calc A1
+ eConv = formula::FormulaGrammar::CONV_OOO;
+ break;
+ case 1: // Excel A1
+ eConv = formula::FormulaGrammar::CONV_XL_A1;
+ break;
+ case 2: // Excel R1C1
+ eConv = formula::FormulaGrammar::CONV_XL_R1C1;
+ break;
+ default:
+ ;
+ }
+ }
+ while (false);
+ SetIndirectFuncSyntax(eConv);
+ }
+ break;
break;
}
}
@@ -343,6 +378,19 @@ void ScFormulaCfg::Commit()
case SCFORMULAOPT_SEP_ARRAY_COL:
pValues[nProp] <<= GetFormulaSepArrayCol();
break;
+ case SCFORMULAOPT_INDIRECT_GRAMMAR:
+ {
+ sal_Int32 nVal = -1;
+ switch (GetIndirectFuncSyntax())
+ {
+ case ::formula::FormulaGrammar::CONV_OOO: nVal = 0; break;
+ case ::formula::FormulaGrammar::CONV_XL_A1: nVal = 1; break;
+ case ::formula::FormulaGrammar::CONV_XL_R1C1: nVal = 2; break;
+ default: break;
+ }
+ pValues[nProp] <<= nVal;
+ }
+ break;
}
}
PutProperties(aNames, aValues);
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 3f46321..a145dd6 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -82,6 +82,7 @@ static const sal_uInt64 n2power48 = SAL_CONST_UINT64( 281474976710656); // 2^48
IMPL_FIXEDMEMPOOL_NEWDEL( ScTokenStack )
IMPL_FIXEDMEMPOOL_NEWDEL( ScInterpreter )
+ScInterpreter::Config ScInterpreter::maGlobalConfig;
ScTokenStack* ScInterpreter::pGlobalStack = NULL;
bool ScInterpreter::bGlobalStackInUse = false;
@@ -6967,22 +6968,23 @@ void ScInterpreter::ScIndirect()
sal_uInt8 nParamCount = GetByte();
if ( MustHaveParamCount( nParamCount, 1, 2 ) )
{
- bool bTryXlA1 = true; // whether to try XL_A1 style as well.
- FormulaGrammar::AddressConvention eConv = FormulaGrammar::CONV_OOO;
+ // Reference address syntax for INDIRECT is configurable.
+ FormulaGrammar::AddressConvention eConv = GetGlobalConfig().meIndirectRefSyntax;
+ if (eConv == FormulaGrammar::CONV_UNSPECIFIED)
+ // Use the current address syntax if unspecified.
+ eConv = pDok->GetAddressConvention();
+
if (nParamCount == 2 && 0.0 == ::rtl::math::approxFloor( GetDouble()))
{
+ // Overwrite the config and try Excel R1C1.
eConv = FormulaGrammar::CONV_XL_R1C1;
- bTryXlA1 = false;
}
const ScAddress::Details aDetails( eConv, aPos );
- const ScAddress::Details aDetailsXlA1( FormulaGrammar::CONV_XL_A1, aPos );
SCTAB nTab = aPos.Tab();
String sRefStr( GetString() );
ScRefAddress aRefAd, aRefAd2;
ScAddress::ExternalInfo aExtInfo;
- if ( ConvertDoubleRef( pDok, sRefStr, nTab, aRefAd, aRefAd2, aDetails, &aExtInfo) ||
- (bTryXlA1 && ConvertDoubleRef( pDok, sRefStr, nTab, aRefAd,
- aRefAd2, aDetailsXlA1, &aExtInfo)))
+ if (ConvertDoubleRef(pDok, sRefStr, nTab, aRefAd, aRefAd2, aDetails, &aExtInfo))
{
if (aExtInfo.mbExternal)
{
@@ -6995,9 +6997,7 @@ void ScInterpreter::ScIndirect()
PushDoubleRef( aRefAd.Col(), aRefAd.Row(), aRefAd.Tab(),
aRefAd2.Col(), aRefAd2.Row(), aRefAd2.Tab() );
}
- else if ( ConvertSingleRef ( pDok, sRefStr, nTab, aRefAd, aDetails, &aExtInfo) ||
- (bTryXlA1 && ConvertSingleRef ( pDok, sRefStr, nTab, aRefAd,
- aDetailsXlA1, &aExtInfo)))
+ else if (ConvertSingleRef(pDok, sRefStr, nTab, aRefAd, aDetails, &aExtInfo))
{
if (aExtInfo.mbExternal)
{
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index e48a5a8..fe75f61 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -3692,6 +3692,18 @@ ScInterpreter::~ScInterpreter()
delete pTokenMatrixMap;
}
+ScInterpreter::Config::Config() :
+ meIndirectRefSyntax(formula::FormulaGrammar::CONV_UNSPECIFIED) {}
+
+void ScInterpreter::SetGlobalConfig(const Config& rConfig)
+{
+ maGlobalConfig = rConfig;
+}
+
+const ScInterpreter::Config& ScInterpreter::GetGlobalConfig()
+{
+ return maGlobalConfig;
+}
void ScInterpreter::GlobalExit()
{
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index f6831dd..5ca7d45 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -50,6 +50,7 @@
#include "globstr.hrc"
#include "scmod.hxx"
#include "compiler.hxx"
+#include "interpre.hxx"
#include "formula/FormulaCompiler.hxx"
#include "comphelper/processfactory.hxx"
@@ -504,6 +505,11 @@ void ScDocShell::SetFormulaOptions(const ScFormulaOptions& rOpt )
// Update the separators.
ScCompiler::UpdateSeparatorsNative(
rOpt.GetFormulaSepArg(), rOpt.GetFormulaSepArrayCol(), rOpt.GetFormulaSepArrayRow());
+
+ // Global interpreter settings.
+ ScInterpreter::Config aConfig;
+ aConfig.meIndirectRefSyntax = rOpt.GetIndirectFuncSyntax();
+ ScInterpreter::SetGlobalConfig(aConfig);
}
void ScDocShell::CheckConfigOptions()
commit 00134920ec968ff492c88d8c5a6af22f1ebfa328
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue May 29 16:25:24 2012 -0400
New option for INDIRECT reference syntax.
Change-Id: I4c754c39ab27f35076d38868b52321a3d3baf9ea
diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index 0cd2ff3..245f2ff 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1348,6 +1348,35 @@
</info>
<value></value>
</prop>
+ <prop oor:name="IndirectFuncGrammar" oor:type="xs:int" oor:nillable="false">
+ <!-- UIHints: Tools - Options - Spreadsheet - Formula -->
+ <info>
+ <author>kyoshida</author>
+ <desc>Grammar for INDIRECT function</desc>
+ </info>
+ <constraints>
+ <enumeration oor:value="-1">
+ <info>
+ <desc>same as formula grammar</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="0">
+ <info>
+ <desc>Calc A1</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="1">
+ <info>
+ <desc>Excel A1</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="2">
+ <info>
+ <desc>Excel R1C1</desc>
+ </info>
+ </enumeration>
+ </constraints>
+ </prop>
</group>
</group>
<group oor:name="Revision">
commit 2990def85b40e0529049a1bca208d4ebb8600f5a
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue May 29 15:48:16 2012 -0400
Allow editing of enumerated option value.
Still lots of things are hard-coded.
Change-Id: I34512d87431082d35130954c6818c65bc3c18966
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index ae35694..be6803b 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -67,11 +67,13 @@ void OptionString::Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 /*nFlags*/,
ScCalcOptionsDialog::ScCalcOptionsDialog(Window* pParent) :
ModalDialog(pParent, ScResId(RID_SCDLG_FORMULA_CALCOPTIONS)),
maLbSettings(this, ScResId(LB_SETTINGS)),
- maBtnEdit(this, ScResId(BTN_EDIT)),
+ maFtOptionEditCaption(this, ScResId(FT_OPTION_EDIT_CAPTION)),
+ maLbOptionEdit(this, ScResId(LB_OPTION_EDIT)),
maFlAnnotation(this, ScResId(FL_ANNOTATION)),
maFtAnnotation(this, ScResId(FT_ANNOTATION)),
maBtnOK(this, ScResId(BTN_OK)),
maBtnCancel(this, ScResId(BTN_CANCEL)),
+ maCaptionIndirectSyntax(ScResId(STR_INDIRECT_SYNTAX_CAPTION).toString()),
maDescIndirectSyntax(ScResId(STR_INDIRECT_SYNTAX_DESC).toString())
{
maLbSettings.SetStyle(maLbSettings.GetStyle() | WB_CLIPCHILDREN | WB_FORCE_MAKEVISIBLE);
@@ -95,7 +97,7 @@ void ScCalcOptionsDialog::FillOptionsList()
SvLBoxEntry* pEntry = new SvLBoxEntry;
pEntry->AddItem(new SvLBoxString(pEntry, 0, rtl::OUString()));
pEntry->AddItem(new SvLBoxContextBmp(pEntry, 0, Image(), Image(), 0));
- OptionString* pItem = new OptionString("Formula syntax INDIRECT function expects", "Calc A1");
+ OptionString* pItem = new OptionString(maCaptionIndirectSyntax, "Calc A1");
pEntry->AddItem(pItem);
pModel->Insert(pEntry);
@@ -105,7 +107,16 @@ void ScCalcOptionsDialog::FillOptionsList()
void ScCalcOptionsDialog::SelectionChanged()
{
- maFtAnnotation.SetText(maDescIndirectSyntax);
+ if (true)
+ {
+ // Formula syntax for INDIRECT function.
+ maLbOptionEdit.Clear();
+ maLbOptionEdit.InsertEntry(rtl::OUString("Calc A1"));
+ maLbOptionEdit.InsertEntry(rtl::OUString("Excel A1"));
+ maLbOptionEdit.InsertEntry(rtl::OUString("Excel R1C1"));
+ maLbOptionEdit.SelectEntryPos(0);
+ maFtAnnotation.SetText(maDescIndirectSyntax);
+ }
}
void ScCalcOptionsDialog::EditOption()
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hrc b/sc/source/ui/optdlg/calcoptionsdlg.hrc
index 6dc6ae5..d0049b9 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.hrc
+++ b/sc/source/ui/optdlg/calcoptionsdlg.hrc
@@ -31,10 +31,14 @@
#define BTN_OK 1
#define BTN_CANCEL 2
#define LB_SETTINGS 3
-#define BTN_EDIT 4
-#define FL_ANNOTATION 5
-#define FT_ANNOTATION 6
-#define STR_INDIRECT_SYNTAX_DESC 10
+#define FT_OPTION_EDIT_CAPTION 4
+#define LB_OPTION_EDIT 5
+
+#define FL_ANNOTATION 20
+#define FT_ANNOTATION 21
+
+#define STR_INDIRECT_SYNTAX_CAPTION 22
+#define STR_INDIRECT_SYNTAX_DESC 23
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hxx b/sc/source/ui/optdlg/calcoptionsdlg.hxx
index 9bb1ca5..a812d92 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.hxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.hxx
@@ -51,13 +51,16 @@ private:
private:
SvxCheckListBox maLbSettings;
- PushButton maBtnEdit;
+ FixedText maFtOptionEditCaption;
+ ListBox maLbOptionEdit;
+
FixedLine maFlAnnotation;
FixedText maFtAnnotation;
OKButton maBtnOK;
CancelButton maBtnCancel;
+ rtl::OUString maCaptionIndirectSyntax;
rtl::OUString maDescIndirectSyntax;
};
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.src b/sc/source/ui/optdlg/calcoptionsdlg.src
index e80fa09..cb0571b 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.src
+++ b/sc/source/ui/optdlg/calcoptionsdlg.src
@@ -43,12 +43,21 @@ ModalDialog RID_SCDLG_FORMULA_CALCOPTIONS
TabStop = TRUE ;
};
- PushButton BTN_EDIT
+ FixedText FT_OPTION_EDIT_CAPTION
{
- Pos = MAP_APPFONT ( 8 , 82 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT ( 8 , 84 ) ;
+ Size = MAP_APPFONT ( 40 , 14 ) ;
TabStop = TRUE ;
- Text [ en-US ] = "Edit...";
+
+ Text [ en-US ] = "Value";
+ };
+
+ ListBox LB_OPTION_EDIT
+ {
+ Pos = MAP_APPFONT ( 50 , 82 ) ;
+ Size = MAP_APPFONT ( 60, 46 ) ;
+ TabStop = TRUE ;
+ DropDown = TRUE ;
};
FixedLine FL_ANNOTATION
@@ -80,6 +89,11 @@ ModalDialog RID_SCDLG_FORMULA_CALCOPTIONS
TabStop = TRUE ;
};
+ String STR_INDIRECT_SYNTAX_CAPTION
+ {
+ Text [ en-US ] = "Formula syntax for INDIRECT function";
+ };
+
String STR_INDIRECT_SYNTAX_DESC
{
Text [ en-US ] = "Formula syntax that built-in function INDIRECT expects.";
commit ce2bcf8901d491866b62bff4b5bfe63918a0fe24
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue May 29 12:39:17 2012 -0400
Added options list and other misc stuff.
Change-Id: Idd7b8823a26e2a272d911c097dbde350092ec0e8
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index ebd6370..ae35694 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -30,13 +30,98 @@
#include "calcoptionsdlg.hrc"
#include "scresid.hxx"
+#include "svtools/svlbitm.hxx"
+
+namespace {
+
+class OptionString : public SvLBoxString
+{
+ rtl::OUString maDesc;
+ rtl::OUString maValue;
+public:
+ OptionString(const rtl::OUString& rDesc, const rtl::OUString& rValue) :
+ maDesc(rDesc), maValue(rValue) {}
+
+ virtual void Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry);
+};
+
+void OptionString::Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 /*nFlags*/, SvLBoxEntry* /*pEntry*/)
+{
+ Point aPos = rPos;
+ rtl::OUString aDesc = maDesc + rtl::OUString(": ");
+ rDev.DrawText(aPos, aDesc);
+
+ aPos.X() += rDev.GetTextWidth(aDesc);
+ Font aOldFont = rDev.GetFont();
+ Font aFont = aOldFont;
+ aFont.SetWeight(WEIGHT_BOLD);
+
+ rDev.SetFont(aFont);
+ rDev.DrawText(aPos, maValue);
+
+ rDev.SetFont(aOldFont);
+}
+
+}
+
ScCalcOptionsDialog::ScCalcOptionsDialog(Window* pParent) :
ModalDialog(pParent, ScResId(RID_SCDLG_FORMULA_CALCOPTIONS)),
+ maLbSettings(this, ScResId(LB_SETTINGS)),
+ maBtnEdit(this, ScResId(BTN_EDIT)),
+ maFlAnnotation(this, ScResId(FL_ANNOTATION)),
+ maFtAnnotation(this, ScResId(FT_ANNOTATION)),
maBtnOK(this, ScResId(BTN_OK)),
- maBtnCancel(this, ScResId(BTN_CANCEL))
+ maBtnCancel(this, ScResId(BTN_CANCEL)),
+ maDescIndirectSyntax(ScResId(STR_INDIRECT_SYNTAX_DESC).toString())
{
+ maLbSettings.SetStyle(maLbSettings.GetStyle() | WB_CLIPCHILDREN | WB_FORCE_MAKEVISIBLE);
+ maLbSettings.SetHighlightRange();
+
+ maLbSettings.SetSelectHdl(LINK(this, ScCalcOptionsDialog, SettingsSelHdl));
+ maLbSettings.SetDoubleClickHdl(LINK(this, ScCalcOptionsDialog, SettingsDoubleClickHdl));
+
+ FillOptionsList();
+ FreeResource();
+ SelectionChanged();
}
ScCalcOptionsDialog::~ScCalcOptionsDialog() {}
+void ScCalcOptionsDialog::FillOptionsList()
+{
+ maLbSettings.SetUpdateMode(false);
+
+ SvLBoxTreeList* pModel = maLbSettings.GetModel();
+ SvLBoxEntry* pEntry = new SvLBoxEntry;
+ pEntry->AddItem(new SvLBoxString(pEntry, 0, rtl::OUString()));
+ pEntry->AddItem(new SvLBoxContextBmp(pEntry, 0, Image(), Image(), 0));
+ OptionString* pItem = new OptionString("Formula syntax INDIRECT function expects", "Calc A1");
+ pEntry->AddItem(pItem);
+
+ pModel->Insert(pEntry);
+
+ maLbSettings.SetUpdateMode(true);
+}
+
+void ScCalcOptionsDialog::SelectionChanged()
+{
+ maFtAnnotation.SetText(maDescIndirectSyntax);
+}
+
+void ScCalcOptionsDialog::EditOption()
+{
+}
+
+IMPL_LINK_NOARG(ScCalcOptionsDialog, SettingsSelHdl)
+{
+ SelectionChanged();
+ return 0;
+}
+
+IMPL_LINK_NOARG(ScCalcOptionsDialog, SettingsDoubleClickHdl)
+{
+ EditOption();
+ return 0;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hrc b/sc/source/ui/optdlg/calcoptionsdlg.hrc
index 3643839..6dc6ae5 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.hrc
+++ b/sc/source/ui/optdlg/calcoptionsdlg.hrc
@@ -30,5 +30,11 @@
#define BTN_OK 1
#define BTN_CANCEL 2
+#define LB_SETTINGS 3
+#define BTN_EDIT 4
+#define FL_ANNOTATION 5
+#define FT_ANNOTATION 6
+
+#define STR_INDIRECT_SYNTAX_DESC 10
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hxx b/sc/source/ui/optdlg/calcoptionsdlg.hxx
index 76f99b3..9bb1ca5 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.hxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.hxx
@@ -31,6 +31,8 @@
#include "vcl/dialog.hxx"
#include "vcl/button.hxx"
+#include "vcl/fixed.hxx"
+#include "svx/checklbx.hxx"
class ScCalcOptionsDialog : public ModalDialog
{
@@ -38,9 +40,25 @@ public:
ScCalcOptionsDialog(Window* pParent);
virtual ~ScCalcOptionsDialog();
+ DECL_LINK( SettingsSelHdl, void* );
+ DECL_LINK( SettingsDoubleClickHdl, void* );
+
+private:
+ void FillOptionsList();
+ void SelectionChanged();
+ void EditOption();
+
private:
+ SvxCheckListBox maLbSettings;
+
+ PushButton maBtnEdit;
+ FixedLine maFlAnnotation;
+ FixedText maFtAnnotation;
+
OKButton maBtnOK;
CancelButton maBtnCancel;
+
+ rtl::OUString maDescIndirectSyntax;
};
#endif
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.src b/sc/source/ui/optdlg/calcoptionsdlg.src
index f0e72e3..e80fa09 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.src
+++ b/sc/source/ui/optdlg/calcoptionsdlg.src
@@ -32,20 +32,56 @@ ModalDialog RID_SCDLG_FORMULA_CALCOPTIONS
OutputSize = TRUE ;
Hide = TRUE ;
SVLook = TRUE ;
- Size = MAP_APPFONT ( 260, 200 ) ;
+ Size = MAP_APPFONT ( 230, 200 ) ;
Text [ en-US ] = "Detailed Calculation Settings" ;
+ Control LB_SETTINGS
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 6 , 10 ) ;
+ Size = MAP_APPFONT ( 218 , 67 ) ;
+ TabStop = TRUE ;
+ };
+
+ PushButton BTN_EDIT
+ {
+ Pos = MAP_APPFONT ( 8 , 82 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "Edit...";
+ };
+
+ FixedLine FL_ANNOTATION
+ {
+ Pos = MAP_APPFONT ( 6 , 98 ) ;
+ Size = MAP_APPFONT ( 218 , 8 ) ;
+ TabStop = TRUE ;
+ };
+
+ FixedText FT_ANNOTATION
+ {
+ Pos = MAP_APPFONT ( 8 , 108 ) ;
+ Size = MAP_APPFONT ( 214 , 70 ) ;
+ WordBreak = TRUE ;
+ NoLabel = TRUE ;
+ };
+
OKButton BTN_OK
{
- Pos = MAP_APPFONT ( 148 , 180 ) ;
+ Pos = MAP_APPFONT ( 118 , 180 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
CancelButton BTN_CANCEL
{
- Pos = MAP_APPFONT ( 204 , 180 ) ;
+ Pos = MAP_APPFONT ( 174 , 180 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
+
+ String STR_INDIRECT_SYNTAX_DESC
+ {
+ Text [ en-US ] = "Formula syntax that built-in function INDIRECT expects.";
+ };
};
commit f1010e946f2bed587d7e7ad4e52e20c38062f683
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Sat May 26 02:01:02 2012 -0400
New skeleton dialog for detailed calculation settings.
This dialog is launched from the Formula options dialog.
Change-Id: I554de0f7d376803f2e94907aa78648708b8f6b84
diff --git a/sc/AllLangResTarget_sc.mk b/sc/AllLangResTarget_sc.mk
index 09526bd..ba83347 100644
--- a/sc/AllLangResTarget_sc.mk
+++ b/sc/AllLangResTarget_sc.mk
@@ -83,6 +83,7 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\
sc/source/ui/cctrl/checklistmenu.src \
sc/source/ui/navipi/navipi.src \
sc/source/ui/docshell/tpstat.src \
+ sc/source/ui/optdlg/calcoptionsdlg.src \
sc/source/ui/pagedlg/pagedlg.src \
sc/source/ui/pagedlg/tphf.src \
sc/source/ui/pagedlg/hfedtdlg.src \
diff --git a/sc/Library_scui.mk b/sc/Library_scui.mk
index 9af5a63..fbb84d6 100644
--- a/sc/Library_scui.mk
+++ b/sc/Library_scui.mk
@@ -98,6 +98,7 @@ $(eval $(call gb_Library_add_exception_objects,scui,\
sc/source/ui/miscdlgs/tabbgcolordlg \
sc/source/ui/miscdlgs/textdlgs \
sc/source/ui/namedlg/namepast \
+ sc/source/ui/optdlg/calcoptionsdlg \
sc/source/ui/optdlg/opredlin \
sc/source/ui/optdlg/tpcalc \
sc/source/ui/optdlg/tpcompatibility \
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 1860bcf..6939856 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -1225,8 +1225,9 @@
#define RID_SCDLG_TEXT_IMPORT_OPTIONS (SC_DIALOGS_START + 152)
#define RID_POPUP_FILTER (SC_DIALOGS_START + 153)
#define RID_SCDLG_TAB_BG_COLOR (SC_DIALOGS_START + 154)
+#define RID_SCDLG_FORMULA_CALCOPTIONS (SC_DIALOGS_START + 155)
-#define SC_DIALOGS_END (SC_DIALOGS_START + 155)
+#define SC_DIALOGS_END (SC_DIALOGS_START + 156)
#ifndef STD_MASKCOLOR
#define STD_MASKCOLOR Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; }
diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx
index 7dda2e3..808e0ef 100644
--- a/sc/source/ui/inc/tpformula.hxx
+++ b/sc/source/ui/inc/tpformula.hxx
@@ -52,6 +52,7 @@ private:
void ResetSeparators();
void OnFocusSeparatorInput(Edit* pEdit);
+ void LaunchCustomCalcSettings();
bool IsValidSeparator(const ::rtl::OUString& rSep) const;
bool IsValidSeparatorSet() const;
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
new file mode 100644
index 0000000..ebd6370
--- /dev/null
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Kohei Yoshida <kohei.yoshida at suse.com>
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include "calcoptionsdlg.hxx"
+#include "calcoptionsdlg.hrc"
+#include "scresid.hxx"
+
+ScCalcOptionsDialog::ScCalcOptionsDialog(Window* pParent) :
+ ModalDialog(pParent, ScResId(RID_SCDLG_FORMULA_CALCOPTIONS)),
+ maBtnOK(this, ScResId(BTN_OK)),
+ maBtnCancel(this, ScResId(BTN_CANCEL))
+{
+}
+
+ScCalcOptionsDialog::~ScCalcOptionsDialog() {}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hrc b/sc/source/ui/optdlg/calcoptionsdlg.hrc
new file mode 100644
index 0000000..3643839
--- /dev/null
+++ b/sc/source/ui/optdlg/calcoptionsdlg.hrc
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Kohei Yoshida <kohei.yoshida at suse.com>
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include "sc.hrc"
+
+#define BTN_OK 1
+#define BTN_CANCEL 2
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hxx b/sc/source/ui/optdlg/calcoptionsdlg.hxx
new file mode 100644
index 0000000..76f99b3
--- /dev/null
+++ b/sc/source/ui/optdlg/calcoptionsdlg.hxx
@@ -0,0 +1,48 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Kohei Yoshida <kohei.yoshida at suse.com>
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef __SC_OPTDLG_CALCOPTIONSDLG_HXX__
+#define __SC_OPTDLG_CALCOPTIONSDLG_HXX__
+
+#include "vcl/dialog.hxx"
+#include "vcl/button.hxx"
+
+class ScCalcOptionsDialog : public ModalDialog
+{
+public:
+ ScCalcOptionsDialog(Window* pParent);
+ virtual ~ScCalcOptionsDialog();
+
+private:
+ OKButton maBtnOK;
+ CancelButton maBtnCancel;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.src b/sc/source/ui/optdlg/calcoptionsdlg.src
new file mode 100644
index 0000000..f0e72e3
--- /dev/null
+++ b/sc/source/ui/optdlg/calcoptionsdlg.src
@@ -0,0 +1,51 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Kohei Yoshida <kohei.yoshida at suse.com>
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include "calcoptionsdlg.hrc"
+
+ModalDialog RID_SCDLG_FORMULA_CALCOPTIONS
+{
+ OutputSize = TRUE ;
+ Hide = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 260, 200 ) ;
+ Text [ en-US ] = "Detailed Calculation Settings" ;
+
+ OKButton BTN_OK
+ {
+ Pos = MAP_APPFONT ( 148 , 180 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+
+ CancelButton BTN_CANCEL
+ {
+ Pos = MAP_APPFONT ( 204 , 180 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+};
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index 77c571f..4ed483d 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -41,6 +41,8 @@
#include "optdlg.hrc"
#include "scresid.hxx"
#include "formula/grammar.hxx"
+#include "calcoptionsdlg.hxx"
+#include "vcl/msgbox.hxx"
#include <unotools/localedatawrapper.hxx>
@@ -77,6 +79,7 @@ ScTpFormulaOptions::ScTpFormulaOptions(Window* pParent, const SfxItemSet& rCoreA
Link aLink = LINK( this, ScTpFormulaOptions, ButtonHdl );
maBtnSepReset.SetClickHdl(aLink);
+ maBtnCustomCalcDetails.SetClickHdl(aLink);
aLink = LINK( this, ScTpFormulaOptions, SepModifyHdl );
maEdSepFuncArg.SetModifyHdl(aLink);
@@ -124,6 +127,15 @@ void ScTpFormulaOptions::OnFocusSeparatorInput(Edit* pEdit)
maOldSepValue = pEdit->GetText();
}
+void ScTpFormulaOptions::LaunchCustomCalcSettings()
+{
+ ScCalcOptionsDialog aDlg(this);
+ if (aDlg.Execute() == RET_OK)
+ {
+
+ }
+}
+
bool ScTpFormulaOptions::IsValidSeparator(const OUString& rSep) const
{
if (rSep.getLength() != 1)
@@ -177,6 +189,8 @@ IMPL_LINK( ScTpFormulaOptions, ButtonHdl, PushButton*, pBtn )
{
if (pBtn == &maBtnSepReset)
ResetSeparators();
+ else if (pBtn == &maBtnCustomCalcDetails)
+ LaunchCustomCalcSettings();
return 0;
}
commit 805ec73aa824e7c14dc867fbf2a7f5f67fb06c7a
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Sat May 26 00:15:55 2012 -0400
New controls in formula option page to change calculation settings.
Change-Id: I4743cfc75796a989657afbbc3efc14dfe9f8c114
diff --git a/sc/source/ui/inc/optdlg.hrc b/sc/source/ui/inc/optdlg.hrc
index 5245bc6..34ccbfc 100644
--- a/sc/source/ui/inc/optdlg.hrc
+++ b/sc/source/ui/inc/optdlg.hrc
@@ -188,6 +188,10 @@
#define FT_FORMULA_SEP_ARRAY_C 89
#define ED_FORMULA_SEP_ARRAY_C 90
#define BTN_FORMULA_SEP_RESET 91
+#define FL_CUSTOM_CALC_OPTIONS 92
+#define BTN_CUSTOM_CALC_DEFAULT 93
+#define BTN_CUSTOM_CALC_CUSTOM 94
+#define BTN_CUSTOM_CALC_DETAILS 95
// TP_COMPATIBILITY
#define FL_KEY_BINDINGS 1
diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx
index c547849..7dda2e3 100644
--- a/sc/source/ui/inc/tpformula.hxx
+++ b/sc/source/ui/inc/tpformula.hxx
@@ -75,6 +75,11 @@ private:
Edit maEdSepArrayRow;
PushButton maBtnSepReset;
+ FixedLine maFlCustomCalcOpt;
+ RadioButton maBtnCustomCalcDefault;
+ RadioButton maBtnCustomCalcCustom;
+ PushButton maBtnCustomCalcDetails;
+
/** Stores old separator value of currently focused separator edit box.
This value is used to revert undesired value change. */
::rtl::OUString maOldSepValue;
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index c029c81..77c571f 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -66,6 +66,10 @@ ScTpFormulaOptions::ScTpFormulaOptions(Window* pParent, const SfxItemSet& rCoreA
maFtSepArrayRow(this, ScResId(FT_FORMULA_SEP_ARRAY_R)),
maEdSepArrayRow(this, ScResId(ED_FORMULA_SEP_ARRAY_R)),
maBtnSepReset(this, ScResId(BTN_FORMULA_SEP_RESET)),
+ maFlCustomCalcOpt(this, ScResId(FL_CUSTOM_CALC_OPTIONS)),
+ maBtnCustomCalcDefault(this, ScResId(BTN_CUSTOM_CALC_DEFAULT)),
+ maBtnCustomCalcCustom(this, ScResId(BTN_CUSTOM_CALC_CUSTOM)),
+ maBtnCustomCalcDetails(this, ScResId(BTN_CUSTOM_CALC_DETAILS)),
mnDecSep(0)
{
diff --git a/sc/source/ui/src/optdlg.src b/sc/source/ui/src/optdlg.src
index d27da14..eddda53 100644
--- a/sc/source/ui/src/optdlg.src
+++ b/sc/source/ui/src/optdlg.src
@@ -283,6 +283,34 @@ TabPage RID_SCPAGE_FORMULA
Size = MAP_APPFONT ( 50, 14 );
Text [ en-US ] = "Rese~t";
};
+
+ FixedLine FL_CUSTOM_CALC_OPTIONS
+ {
+ Pos = MAP_APPFONT ( 6 , 138 ) ;
+ Size = MAP_APPFONT ( 248 , 8 ) ;
+ Text [ en-US ] = "Detailed calculation settings";
+ };
+
+ RadioButton BTN_CUSTOM_CALC_DEFAULT
+ {
+ Pos = MAP_APPFONT ( 21 , 153 ) ;
+ Size = MAP_APPFONT ( 60, 14 ) ;
+ Text [ en-US ] = "Default";
+ };
+
+ RadioButton BTN_CUSTOM_CALC_CUSTOM
+ {
+ Pos = MAP_APPFONT ( 21 , 167 ) ;
+ Size = MAP_APPFONT ( 60, 14 ) ;
+ Text [ en-US ] = "Custom";
+ };
+
+ PushButton BTN_CUSTOM_CALC_DETAILS
+ {
+ Pos = MAP_APPFONT ( 85 , 165 ) ;
+ Size = MAP_APPFONT ( 60, 14 ) ;
+ Text [ en-US ] = "Details...";
+ };
};
TabPage RID_SCPAGE_COMPATIBILITY
More information about the Libreoffice-commits
mailing list