From 603f9ce4f39a59bd84b5c08e3d725e0ee664991f Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Thu, 1 Sep 2022 13:27:46 +0200 Subject: Related: tdf#142293 Introduce a protected FormulaCompiler::GetFinalOpCodeMap() ... to prepare having GetOpCodeMap() return a temporary if a final doesn't exist yet. Currently just an alias. Change-Id: I6fc100ae6223010e149e4af01fc7c17630930de7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139162 Reviewed-by: Eike Rathke Tested-by: Jenkins --- include/formula/FormulaCompiler.hxx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'include/formula') diff --git a/include/formula/FormulaCompiler.hxx b/include/formula/FormulaCompiler.hxx index 36632035602e..d94dbd40d399 100644 --- a/include/formula/FormulaCompiler.hxx +++ b/include/formula/FormulaCompiler.hxx @@ -196,7 +196,30 @@ public: typedef std::shared_ptr< const OpCodeMap > OpCodeMapPtr; typedef std::shared_ptr< OpCodeMap > NonConstOpCodeMapPtr; +protected: + /** Get finalized OpCodeMap for formula language. + + Creates/returns a singleton instance of an OpCodeMap that contains + external AddIn mappings if the derived class supports them. Do not call + at this base class as it results in a permanent mapping without AddIns + even for derived classes (unless it is for the implementation of the + temporary GetOpCodeMap()). + + @param nLanguage + One of css::sheet::FormulaLanguage constants. + @return Map for nLanguage. If nLanguage is unknown, a NULL map is returned. + */ + OpCodeMapPtr GetFinalOpCodeMap( const sal_Int32 nLanguage ) const; + +public: /** Get OpCodeMap for formula language. + + Returns either the finalized OpCodeMap (created by GetFinalOpCodeMap() + of a derived class) for nLanguage if there is such, or if not then a + temporary map of which its singleton is reset immediately and the + temporary will get destroyed by the caller's scope. A temporary map + created at this base class does *not* contain AddIn mappings. + @param nLanguage One of css::sheet::FormulaLanguage constants. @return Map for nLanguage. If nLanguage is unknown, a NULL map is returned. -- cgit