diff options
-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 |