diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-09-15 16:46:11 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-09-17 11:08:31 +0200 |
commit | ee236b2c6738e34be86052fb819a31dc00d54541 (patch) | |
tree | 561a5eb726d6f4af76872b50f3f1eaf09d7cf960 /sc | |
parent | fb4c53a1bbe57de93a92abc04736c0afdfd16170 (diff) |
base-class formula::FormulaCompiler is sufficient here
Change-Id: Ic95bcc33fda1edb762009c4ca4fd3448640259bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102900
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/compiler.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/compiler.cxx | 3 | ||||
-rw-r--r-- | sc/source/core/tool/tokenstringcontext.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh6.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/vba/vbawsfunction.cxx | 7 |
5 files changed, 8 insertions, 8 deletions
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx index f702749d36a8..79b8c2cd2ff1 100644 --- a/sc/inc/compiler.hxx +++ b/sc/inc/compiler.hxx @@ -394,7 +394,7 @@ public: sal_Unicode GetNativeAddressSymbol( Convention::SpecialSymbolType eType ) const; // Check if it is a valid english function name - bool IsEnglishSymbol( const OUString& rName ); + static bool IsEnglishSymbol( const OUString& rName ); bool IsErrorConstant( const OUString& ) const; bool IsTableRefItem( const OUString& ) const; diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index f47d142e4382..00602e665030 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -181,7 +181,8 @@ bool ScCompiler::IsEnglishSymbol( const OUString& rName ) OUString aUpper = ScGlobal::getCharClassPtr()->uppercase(rName); // 1. built-in function name - OpCode eOp = ScCompiler::GetEnglishOpCode( aUpper ); + formula::FormulaCompiler aCompiler; + OpCode eOp = aCompiler.GetEnglishOpCode( aUpper ); if ( eOp != ocNone ) { return true; diff --git a/sc/source/core/tool/tokenstringcontext.cxx b/sc/source/core/tool/tokenstringcontext.cxx index 8d3503804d08..5a4430c155a3 100644 --- a/sc/source/core/tool/tokenstringcontext.cxx +++ b/sc/source/core/tool/tokenstringcontext.cxx @@ -36,7 +36,7 @@ TokenStringContext::TokenStringContext( const ScDocument& rDoc, formula::Formula meGram(eGram), mpRefConv(ScCompiler::GetRefConvention(formula::FormulaGrammar::extractRefConvention(eGram))) { - ScCompiler aComp(nullptr, ScAddress()); + formula::FormulaCompiler aComp; mxOpCodeMap = aComp.GetOpCodeMap(formula::FormulaGrammar::extractFormulaLanguage(eGram)); if (mxOpCodeMap) maErrRef = mxOpCodeMap->getSymbol(ocErrRef); diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index 905ac7ef84c2..2c4765ef64dc 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -448,7 +448,7 @@ void ScDocShell::SetFormulaOptions( const ScFormulaOptions& rOpt, bool bForLoadi if (rOpt.GetUseEnglishFuncName()) { // switch native symbols to English. - ScCompiler aComp(nullptr, ScAddress()); + formula::FormulaCompiler aComp; ScCompiler::OpCodeMapPtr xMap = aComp.GetOpCodeMap(css::sheet::FormulaLanguage::ENGLISH); ScCompiler::SetNativeSymbols(xMap); } diff --git a/sc/source/ui/vba/vbawsfunction.cxx b/sc/source/ui/vba/vbawsfunction.cxx index 42c5382cee08..350be038192b 100644 --- a/sc/source/ui/vba/vbawsfunction.cxx +++ b/sc/source/ui/vba/vbawsfunction.cxx @@ -136,7 +136,7 @@ ScVbaWSFunction::invoke(const OUString& FunctionName, const uno::Sequence< uno:: bool bAsArray = true; // special handing for some functions that don't work correctly in FunctionAccess - ScCompiler aCompiler( nullptr, ScAddress() ); + formula::FormulaCompiler aCompiler; OpCode eOpCode = aCompiler.GetEnglishOpCode( FunctionName.toAsciiUpperCase() ); switch( eOpCode ) { @@ -251,11 +251,10 @@ ScVbaWSFunction::hasMethod(const OUString& Name) bool bIsFound = false; try { - // the function name contained in the com.sun.star.sheet.FunctionDescription service is alwayse localized. + // the function name contained in the com.sun.star.sheet.FunctionDescription service is alwayse localized. // but the function name used in WorksheetFunction is a programmatic name (seems English). // So m_xNameAccess->hasByName( Name ) may fail to find name when a function name has a localized name. - ScCompiler aCompiler( nullptr, ScAddress() ); - if( aCompiler.IsEnglishSymbol( Name ) ) + if( ScCompiler::IsEnglishSymbol( Name ) ) bIsFound = true; } catch( uno::Exception& /*e*/ ) |