diff options
author | Eike Rathke <erack@redhat.com> | 2016-08-02 00:24:09 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-08-02 00:25:35 +0200 |
commit | a859c37ee0126e0daca711893da1cbf6138ec25b (patch) | |
tree | 9c33dcd72f640cd9ce8cda1b185429362a837677 /formula/source | |
parent | fc5342fb30eb9a4444d31ccd91c14accd5126d4b (diff) |
introduce mxSymbolsAPI and InitSymbolsAPI()
Change-Id: I1c4673a25bb0f686e0705f87318a04166e6688bb
Diffstat (limited to 'formula/source')
-rw-r--r-- | formula/source/core/api/FormulaCompiler.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index 3b3f9f68da43..dd728def725c 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -692,8 +692,19 @@ FormulaCompiler::OpCodeMapPtr FormulaCompiler::GetOpCodeMap( const sal_Int32 nLa case FormulaLanguage::ODF_11 : if (!mxSymbolsPODF) InitSymbolsPODF(); + /* FIXME: only temporarily init mxSymbolsAPI here */ + if (!mxSymbolsAPI) + InitSymbolsAPI(); xMap = mxSymbolsPODF; break; +/* FIXME: add FormulaLanguage::API constant */ +#if 0 + case FormulaLanguage::API : + if (!mxSymbolsAPI) + InitSymbolsAPI(); + xMap = mxSymbolsAPI; + break; +#endif case FormulaLanguage::ENGLISH : if (!mxSymbolsEnglish) InitSymbolsEnglish(); @@ -816,6 +827,16 @@ void FormulaCompiler::InitSymbolsPODF() const mxSymbolsPODF = aMap.mxSymbolMap; } +void FormulaCompiler::InitSymbolsAPI() const +{ + static OpCodeMapData aMap; + osl::MutexGuard aGuard(&aMap.maMtx); + if (!aMap.mxSymbolMap) + // XFunctionAccess API always used PODF grammar, keep it. + loadSymbols(RID_STRLIST_FUNCTION_NAMES_ENGLISH_API, FormulaGrammar::GRAM_PODF, aMap.mxSymbolMap, RESOURCE_BASE); + mxSymbolsAPI = aMap.mxSymbolMap; +} + void FormulaCompiler::InitSymbolsODFF() const { static OpCodeMapData aMap; |