diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-07-23 21:02:46 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-07-23 22:06:40 -0400 |
commit | 3f4b517ce0a82c0015d6723dfb2f4c48cf981c90 (patch) | |
tree | 499f84ca45f840a8b8e3b3d72cd8ce802062bc07 | |
parent | 253fad3580761d3d53e6b352aa3b7aeaa3810eee (diff) |
Handle saving to and loading from user configuration.
Change-Id: I81730077322b8890726da4d033f034c1266afa76
-rw-r--r-- | sc/source/core/tool/formulaopt.cxx | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx index d3d4e89e51a2..b5989add5380 100644 --- a/sc/source/core/tool/formulaopt.cxx +++ b/sc/source/core/tool/formulaopt.cxx @@ -207,13 +207,14 @@ SfxPoolItem* ScTpFormulaItem::Clone( SfxItemPool * ) const #define CFGPATH_FORMULA "Office.Calc/Formula" -#define SCFORMULAOPT_GRAMMAR 0 -#define SCFORMULAOPT_ENGLISH_FUNCNAME 1 -#define SCFORMULAOPT_SEP_ARG 2 -#define SCFORMULAOPT_SEP_ARRAY_ROW 3 -#define SCFORMULAOPT_SEP_ARRAY_COL 4 -#define SCFORMULAOPT_STRING_REF_SYNTAX 5 -#define SCFORMULAOPT_COUNT 6 +#define SCFORMULAOPT_GRAMMAR 0 +#define SCFORMULAOPT_ENGLISH_FUNCNAME 1 +#define SCFORMULAOPT_SEP_ARG 2 +#define SCFORMULAOPT_SEP_ARRAY_ROW 3 +#define SCFORMULAOPT_SEP_ARRAY_COL 4 +#define SCFORMULAOPT_STRING_REF_SYNTAX 5 +#define SCFORMULAOPT_EMPTY_STRING_AS_ZERO 6 +#define SCFORMULAOPT_COUNT 7 Sequence<OUString> ScFormulaCfg::GetPropertyNames() { @@ -225,6 +226,7 @@ Sequence<OUString> ScFormulaCfg::GetPropertyNames() "Syntax/SeparatorArrayRow", // SCFORMULAOPT_SEP_ARRAY_ROW "Syntax/SeparatorArrayCol", // SCFORMULAOPT_SEP_ARRAY_COL "Syntax/StringRefAddressSyntax", // SCFORMULAOPT_STRING_REF_SYNTAX + "Syntax/EmptyStringAsZero", // SCFORMULAOPT_EMPTY_STRING_AS_ZERO }; Sequence<OUString> aNames(SCFORMULAOPT_COUNT); OUString* pNames = aNames.getArray(); @@ -341,6 +343,15 @@ ScFormulaCfg::ScFormulaCfg() : GetCalcConfig().meStringRefAddressSyntax = eConv; } break; + case SCFORMULAOPT_EMPTY_STRING_AS_ZERO: + { + sal_Bool bVal = GetCalcConfig().mbEmptyStringAsZero; + pValues[nProp] >>= bVal; + GetCalcConfig().mbEmptyStringAsZero = bVal; + } + break; + default: + ; } } } @@ -397,6 +408,14 @@ void ScFormulaCfg::Commit() pValues[nProp] <<= nVal; } break; + case SCFORMULAOPT_EMPTY_STRING_AS_ZERO: + { + sal_Bool bVal = GetCalcConfig().mbEmptyStringAsZero; + pValues[nProp] <<= bVal; + } + break; + default: + ; } } PutProperties(aNames, aValues); |