summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj/tokenuno.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/unoobj/tokenuno.cxx')
-rw-r--r--sc/source/ui/unoobj/tokenuno.cxx36
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 )
{