diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-22 16:55:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-26 09:38:53 +0200 |
commit | 30b635c26d6cc07b5a84dc0d829f0b0cde3d1f5a (patch) | |
tree | 0ed53ffc7dd75bc6ca40c99453ae39fea3421462 /sc/source/ui/unoobj/tokenuno.cxx | |
parent | 94c548ac6468a567aa352fc47e5d2acc34076130 (diff) |
loplugin:flatten in sc
Change-Id: I40653af2d90ef123cf77d7223c520cba0e5a3aca
Reviewed-on: https://gerrit.libreoffice.org/42661
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/unoobj/tokenuno.cxx')
-rw-r--r-- | sc/source/ui/unoobj/tokenuno.cxx | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx index a9b4e220b4fe..42aa2a067ef1 100644 --- a/sc/source/ui/unoobj/tokenuno.cxx +++ b/sc/source/ui/unoobj/tokenuno.cxx @@ -190,20 +190,19 @@ void SAL_CALL ScFormulaParserObj::setPropertyValue( else if ( aPropertyName == SC_UNO_COMPILEENGLISH ) { bool bOldEnglish = mbEnglish; - if (aValue >>= mbEnglish) + if (!(aValue >>= mbEnglish)) + throw lang::IllegalArgumentException(); + + // Need to recreate the symbol map to change English property + // because the map is const. So for performance reasons set + // CompileEnglish _before_ OpCodeMap! + if (mxOpCodeMap.get() && mbEnglish != bOldEnglish) { - // Need to recreate the symbol map to change English property - // because the map is const. So for performance reasons set - // CompileEnglish _before_ OpCodeMap! - if (mxOpCodeMap.get() && mbEnglish != bOldEnglish) - { - ScDocument& rDoc = mpDocShell->GetDocument(); - ScCompiler aCompiler( &rDoc, ScAddress(), rDoc.GetGrammar()); - mxOpCodeMap = formula::FormulaCompiler::CreateOpCodeMap( maOpCodeMapping, mbEnglish); - } + ScDocument& rDoc = mpDocShell->GetDocument(); + ScCompiler aCompiler( &rDoc, ScAddress(), rDoc.GetGrammar()); + mxOpCodeMap = formula::FormulaCompiler::CreateOpCodeMap( maOpCodeMapping, mbEnglish); } - else - throw lang::IllegalArgumentException(); + } else if ( aPropertyName == SC_UNO_FORMULACONVENTION ) { @@ -215,14 +214,13 @@ void SAL_CALL ScFormulaParserObj::setPropertyValue( } else if ( aPropertyName == SC_UNO_OPCODEMAP ) { - if (aValue >>= maOpCodeMapping) - { - ScDocument& rDoc = mpDocShell->GetDocument(); - ScCompiler aCompiler( &rDoc, ScAddress(), rDoc.GetGrammar()); - mxOpCodeMap = formula::FormulaCompiler::CreateOpCodeMap( maOpCodeMapping, mbEnglish); - } - else + if (!(aValue >>= maOpCodeMapping)) throw lang::IllegalArgumentException(); + + ScDocument& rDoc = mpDocShell->GetDocument(); + ScCompiler aCompiler( &rDoc, ScAddress(), rDoc.GetGrammar()); + mxOpCodeMap = formula::FormulaCompiler::CreateOpCodeMap( maOpCodeMapping, mbEnglish); + } else if ( aPropertyName == SC_UNO_EXTERNALLINKS ) { |