sc/inc/compiler.hxx | 2 -- sc/source/core/tool/compiler.cxx | 5 ----- sc/source/filter/oox/formulabuffer.cxx | 18 +++++++----------- 3 files changed, 7 insertions(+), 18 deletions(-)
New commits: commit 17ae8327033ee10bc997247fd1b8e75a2be50ff1 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Fri Mar 15 17:19:46 2024 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Thu Mar 21 14:30:12 2024 +0100 Related: tdf#160056 this SvNumberFormatter is the one from the ScDocument and ScCompiler ctor will take that one already. So drop this for clarity. Change-Id: I7fc16b4cd40f08556704bfa2e3ee28d56ed6e947 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164869 Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx index e31c73ffada9..df2ad5eb71c9 100644 --- a/sc/inc/compiler.hxx +++ b/sc/inc/compiler.hxx @@ -447,8 +447,6 @@ public: SC_DLLPUBLIC void SetGrammar( const formula::FormulaGrammar::Grammar eGrammar ); - SC_DLLPUBLIC void SetNumberFormatter( SvNumberFormatter* pFormatter ); - private: /** Set grammar and reference convention from within SetFormulaLanguage() or SetGrammar(). diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 2deb187f6f19..5e0258b3fd21 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -309,11 +309,6 @@ std::vector<OUString> &ScCompiler::GetSetupTabNames() const return rTabNames; } -void ScCompiler::SetNumberFormatter( SvNumberFormatter* pFormatter ) -{ - mpFormatter = pFormatter; -} - void ScCompiler::SetFormulaLanguage( const ScCompiler::OpCodeMapPtr & xMap ) { if (!xMap) diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx index fae50d9305f7..29a1c80b4fb6 100644 --- a/sc/source/filter/oox/formulabuffer.cxx +++ b/sc/source/filter/oox/formulabuffer.cxx @@ -102,7 +102,6 @@ private: void applySharedFormulas( ScDocumentImport& rDoc, - SvNumberFormatter& rFormatter, std::vector<FormulaBuffer::SharedFormulaEntry>& rSharedFormulas, std::vector<FormulaBuffer::SharedFormulaDesc>& rCells, WorkbookHelper& rWorkbookHelper) @@ -117,7 +116,6 @@ void applySharedFormulas( const OUString& rTokenStr = rEntry.maTokenStr; ScCompiler aComp(rDoc.getDoc(), aPos, formula::FormulaGrammar::GRAM_OOXML, true, false); - aComp.SetNumberFormatter(&rFormatter); std::unique_ptr<ScTokenArray> pArray = aComp.CompileString(rTokenStr); if (pArray) { @@ -233,7 +231,7 @@ void applySharedFormulas( } void applyCellFormulas( - ScDocumentImport& rDoc, CachedTokenArray& rCache, SvNumberFormatter& rFormatter, + ScDocumentImport& rDoc, CachedTokenArray& rCache, const Sequence<ExternalLinkInfo>& rExternalLinks, const std::vector<FormulaBuffer::TokenAddressItem>& rCells ) { @@ -275,7 +273,6 @@ void applyCellFormulas( } ScCompiler aCompiler(rDoc.getDoc(), aPos, formula::FormulaGrammar::GRAM_OOXML, true, false); - aCompiler.SetNumberFormatter(&rFormatter); aCompiler.SetExternalLinks(rExternalLinks); std::unique_ptr<ScTokenArray> pCode = aCompiler.CompileString(rItem.maTokenStr); if (!pCode) @@ -292,7 +289,7 @@ void applyCellFormulas( } void applyArrayFormulas( - ScDocumentImport& rDoc, SvNumberFormatter& rFormatter, + ScDocumentImport& rDoc, const Sequence<ExternalLinkInfo>& rExternalLinks, const std::vector<FormulaBuffer::TokenRangeAddressItem>& rArrays ) { @@ -301,7 +298,6 @@ void applyArrayFormulas( const ScAddress& aPos = rAddressItem.maTokenAndAddress.maAddress; ScCompiler aComp(rDoc.getDoc(), aPos, formula::FormulaGrammar::GRAM_OOXML); - aComp.SetNumberFormatter(&rFormatter); aComp.SetExternalLinks(rExternalLinks); std::unique_ptr<ScTokenArray> pArray(aComp.CompileString(rAddressItem.maTokenAndAddress.maTokenStr)); if (pArray) @@ -365,21 +361,21 @@ void applyCellFormulaValues( } void processSheetFormulaCells( - ScDocumentImport& rDoc, FormulaBuffer::SheetItem& rItem, SvNumberFormatter& rFormatter, + ScDocumentImport& rDoc, FormulaBuffer::SheetItem& rItem, const Sequence<ExternalLinkInfo>& rExternalLinks, WorkbookHelper& rWorkbookHelper ) { if (rItem.mpSharedFormulaEntries && rItem.mpSharedFormulaIDs) - applySharedFormulas(rDoc, rFormatter, *rItem.mpSharedFormulaEntries, + applySharedFormulas(rDoc, *rItem.mpSharedFormulaEntries, *rItem.mpSharedFormulaIDs, rWorkbookHelper); if (rItem.mpCellFormulas) { CachedTokenArray aCache(rDoc.getDoc()); - applyCellFormulas(rDoc, aCache, rFormatter, rExternalLinks, *rItem.mpCellFormulas); + applyCellFormulas(rDoc, aCache, rExternalLinks, *rItem.mpCellFormulas); } if (rItem.mpArrayFormulas) - applyArrayFormulas(rDoc, rFormatter, rExternalLinks, *rItem.mpArrayFormulas); + applyArrayFormulas(rDoc, rExternalLinks, *rItem.mpArrayFormulas); if (rItem.mpCellFormulaValues) applyCellFormulaValues(rDoc, *rItem.mpCellFormulaValues, rWorkbookHelper); @@ -434,7 +430,7 @@ void FormulaBuffer::finalizeImport() aSheetItems.push_back(getSheetItem(nTab)); for (SheetItem& rItem : aSheetItems) - processSheetFormulaCells(rDoc, rItem, *rDoc.getDoc().GetFormatTable(), getExternalLinks().getLinkInfos(), + processSheetFormulaCells(rDoc, rItem, getExternalLinks().getLinkInfos(), *this); // With formula results being set and not recalculated we need to