diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-05-30 10:03:05 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-05-30 11:37:21 -0400 |
commit | 33d57704c6d79dbd806caf94124776a6a05152a1 (patch) | |
tree | 9d644cd2ef353e122ed8ac6c9b45d6a61645bf63 | |
parent | 60ab58a17d39c84ddcad5789b0c7d60179286e1f (diff) |
Reset the calc settings to default when the 'Default' button is checked.
Change-Id: Ia7eda2d9ff29b5997654fef1a01d637f474b06cc
-rw-r--r-- | sc/inc/calcconfig.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/calcconfig.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/optdlg/tpformula.cxx | 6 |
3 files changed, 13 insertions, 0 deletions
diff --git a/sc/inc/calcconfig.hxx b/sc/inc/calcconfig.hxx index 4af6222778dd..7dd52ce80880 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 e4efbca260df..3f0fd3547adb 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 6eb00b994a2c..cb15a0020ac0 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 |