summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-15 16:46:11 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-17 11:08:31 +0200
commitee236b2c6738e34be86052fb819a31dc00d54541 (patch)
tree561a5eb726d6f4af76872b50f3f1eaf09d7cf960 /sc/source
parentfb4c53a1bbe57de93a92abc04736c0afdfd16170 (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/source')
-rw-r--r--sc/source/core/tool/compiler.cxx3
-rw-r--r--sc/source/core/tool/tokenstringcontext.cxx2
-rw-r--r--sc/source/ui/docshell/docsh6.cxx2
-rw-r--r--sc/source/ui/vba/vbawsfunction.cxx7
4 files changed, 7 insertions, 7 deletions
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*/ )