[Libreoffice-commits] core.git: sc/inc sc/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 17 09:09:11 UTC 2020


 sc/inc/compiler.hxx                        |    2 +-
 sc/source/core/tool/compiler.cxx           |    3 ++-
 sc/source/core/tool/tokenstringcontext.cxx |    2 +-
 sc/source/ui/docshell/docsh6.cxx           |    2 +-
 sc/source/ui/vba/vbawsfunction.cxx         |    7 +++----
 5 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit ee236b2c6738e34be86052fb819a31dc00d54541
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Sep 15 16:46:11 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Sep 17 11:08:31 2020 +0200

    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 at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

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*/ )


More information about the Libreoffice-commits mailing list