summaryrefslogtreecommitdiff
path: root/include/formula
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2022-09-01 13:27:46 +0200
committerEike Rathke <erack@redhat.com>2022-09-01 15:17:20 +0200
commit603f9ce4f39a59bd84b5c08e3d725e0ee664991f (patch)
tree5fd571a0b091f959ec060b5500039a094c709c0b /include/formula
parent418beb68f00190f61effb69726343adcd4597f64 (diff)
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 <erack@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'include/formula')
-rw-r--r--include/formula/FormulaCompiler.hxx23
1 files changed, 23 insertions, 0 deletions
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.