From 15acaddb54c3e14a49b0d26d879c4436d34933e1 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Thu, 1 Sep 2022 14:15:22 +0200 Subject: 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 Tested-by: Jenkins --- sc/source/core/tool/calcconfig.cxx | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'sc') 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>(); - // 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; } -- cgit