summaryrefslogtreecommitdiff
path: root/sc/source/ui/app/scmod.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2012-02-27 14:37:20 -0500
committerKohei Yoshida <kohei.yoshida@suse.com>2012-02-27 14:39:06 -0500
commit7eb1c1e31dac3b8377307192cae9cdde0ebe18bb (patch)
treeb73935141fae0000ded16cbd7b4bc231d6def37e /sc/source/ui/app/scmod.cxx
parent8b32c721c61b5c7a52284ef743586159f8f443ee (diff)
Fixed up several issues with the new formula options handler.
Diffstat (limited to 'sc/source/ui/app/scmod.cxx')
-rw-r--r--sc/source/ui/app/scmod.cxx24
1 files changed, 20 insertions, 4 deletions
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index f4962112870e..3752b7c7df6c 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -1043,7 +1043,7 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
{
sal_uInt16 nVal = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
::formula::FormulaGrammar::Grammar eOld = pAppCfg->GetFormulaSyntax();
- ::formula::FormulaGrammar::Grammar eNew;
+ ::formula::FormulaGrammar::Grammar eNew = ::formula::FormulaGrammar::GRAM_NATIVE;
switch (nVal)
{
@@ -1056,6 +1056,8 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
case 2:
eNew = ::formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1;
break;
+ default:
+ ;
}
if (eOld != eNew)
@@ -2071,8 +2073,23 @@ SfxItemSet* ScModule::CreateItemSet( sal_uInt16 nId )
// TP_FORMULA
pRet->Put( SfxBoolItem( SID_SC_OPT_FORMULA_ENGLISH_FUNCNAME,
rAppOpt.GetUseEnglishFuncName() ) );
- pRet->Put( SfxUInt16Item( SID_SC_OPT_FORMULA_GRAMMAR,
- rAppOpt.GetFormulaSyntax() ) );
+
+ sal_uInt16 nVal = 0;
+ switch (rAppOpt.GetFormulaSyntax())
+ {
+ case formula::FormulaGrammar::GRAM_NATIVE:
+ nVal = 0;
+ break;
+ case formula::FormulaGrammar::GRAM_NATIVE_XL_A1:
+ nVal = 1;
+ break;
+ case formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1:
+ nVal = 2;
+ break;
+ default:
+ ;
+ }
+ pRet->Put( SfxUInt16Item( SID_SC_OPT_FORMULA_GRAMMAR, nVal ) );
pRet->Put( SfxStringItem( SID_SC_OPT_FORMULA_SEP_ARG,
rAppOpt.GetFormulaSepArg() ) );
pRet->Put( SfxStringItem( SID_SC_OPT_FORMULA_SEP_ARRAY_COL,
@@ -2080,7 +2097,6 @@ SfxItemSet* ScModule::CreateItemSet( sal_uInt16 nId )
pRet->Put( SfxStringItem( SID_SC_OPT_FORMULA_SEP_ARRAY_ROW,
rAppOpt.GetFormulaSepArrayRow() ) );
-//
pRet->Put( aULItem );
}