formula/source/core/api/FormulaCompiler.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 5aaa0cda74de4170972b7988d8fca16a560b8500
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Thu Sep 1 14:06:15 2022 +0200
Commit:     Eike Rathke <er...@redhat.com>
CommitDate: Thu Sep 1 17:42:18 2022 +0200

    Resolves: tdf#142293 Implement the temporariness of GetOpCodeMap()
    
    Change-Id: I7c587a68dbdeab9a8c8ed324ecae2eb5dd75b9df
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139201
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Jenkins

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

Reply via email to