diff options
author | Eike Rathke <erack@redhat.com> | 2022-09-01 14:06:15 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2022-09-01 17:42:18 +0200 |
commit | 5aaa0cda74de4170972b7988d8fca16a560b8500 (patch) | |
tree | 901840b5c438e57e3506839ea0720e9645854d3f /formula | |
parent | b8a83c5c63873faf1a63205b8aad634f351d1a9f (diff) |
Resolves: tdf#142293 Implement the temporariness of GetOpCodeMap()
Change-Id: I7c587a68dbdeab9a8c8ed324ecae2eb5dd75b9df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139201
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'formula')
-rw-r--r-- | formula/source/core/api/FormulaCompiler.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index 2f7128c0d8a6..3f41b2196bcf 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -817,7 +817,11 @@ FormulaCompiler::~FormulaCompiler() FormulaCompiler::OpCodeMapPtr FormulaCompiler::GetOpCodeMap( const sal_Int32 nLanguage ) const { - return GetFinalOpCodeMap(nLanguage); + const bool bTemporary = !HasOpCodeMap(nLanguage); + OpCodeMapPtr xMap = GetFinalOpCodeMap(nLanguage); + if (bTemporary) + const_cast<FormulaCompiler*>(this)->DestroyOpCodeMap(nLanguage); + return xMap; } FormulaCompiler::OpCodeMapPtr FormulaCompiler::GetFinalOpCodeMap( const sal_Int32 nLanguage ) const |