sc/source/core/tool/calcconfig.cxx |   12 ------------
 1 file changed, 12 deletions(-)

New commits:
commit 15acaddb54c3e14a49b0d26d879c4436d34933e1
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Thu Sep 1 14:15:22 2022 +0200
Commit:     Eike Rathke <er...@redhat.com>
CommitDate: Thu Sep 1 18:01:29 2022 +0200

    Related: tdf#142293 Remove temporariness now implemented at GetOpCodeMap()
    
    Change-Id: Ic61f45b1da286e2f4890bbc81dc5cd18c0d5bbe5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139202
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Jenkins

diff --git a/sc/source/core/tool/calcconfig.cxx 
b/sc/source/core/tool/calcconfig.cxx
index 27836704dab9..7eb36d73a97c 100644
--- a/sc/source/core/tool/calcconfig.cxx
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -187,11 +187,7 @@ bool ScCalcConfig::operator!= (const ScCalcConfig& r) const
 OUString ScOpCodeSetToSymbolicString(const ScCalcConfig::OpCodeSet& rOpCodes)
 {
     OUStringBuffer result(256);
-    // If GetOpCodeMap() initializes the map at base class
-    // formula::FormulaCompiler before any ScCompiler did, all AddIn mapping
-    // would be missing also in future. So if it didn't exist destroy it again.
     formula::FormulaCompiler aCompiler;
-    const bool bTemporary = 
!aCompiler.HasOpCodeMap(css::sheet::FormulaLanguage::ENGLISH);
     formula::FormulaCompiler::OpCodeMapPtr 
pOpCodeMap(aCompiler.GetOpCodeMap(css::sheet::FormulaLanguage::ENGLISH));
 
     for (auto i = rOpCodes->begin(); i != rOpCodes->end(); ++i)
@@ -201,18 +197,13 @@ OUString ScOpCodeSetToSymbolicString(const 
ScCalcConfig::OpCodeSet& rOpCodes)
         result.append(pOpCodeMap->getSymbol(*i));
     }
 
-    if (bTemporary)
-        aCompiler.DestroyOpCodeMap(css::sheet::FormulaLanguage::ENGLISH);
-
     return result.makeStringAndClear();
 }
 
 ScCalcConfig::OpCodeSet ScStringToOpCodeSet(std::u16string_view rOpCodes)
 {
     ScCalcConfig::OpCodeSet result = std::make_shared<o3tl::sorted_vector< 
OpCode >>();
-    // Same as above.
     formula::FormulaCompiler aCompiler;
-    const bool bTemporary = 
!aCompiler.HasOpCodeMap(css::sheet::FormulaLanguage::ENGLISH);
     formula::FormulaCompiler::OpCodeMapPtr 
pOpCodeMap(aCompiler.GetOpCodeMap(css::sheet::FormulaLanguage::ENGLISH));
 
     const formula::OpCodeHashMap& rHashMap(pOpCodeMap->getHashMap());
@@ -244,9 +235,6 @@ ScCalcConfig::OpCodeSet 
ScStringToOpCodeSet(std::u16string_view rOpCodes)
     if( result->find( ocSub ) != result->end())
         result->insert( ocNegSub );
 
-    if (bTemporary)
-        aCompiler.DestroyOpCodeMap(css::sheet::FormulaLanguage::ENGLISH);
-
     return result;
 }
 

Reply via email to