From cb97358ab845f13f1c57b410e59126f20652d552 Mon Sep 17 00:00:00 2001 From: Andreas Heinisch Date: Mon, 2 Aug 2021 19:48:35 +0200 Subject: tdf#143582 - Clear return value of the method before calling it Otherwise the function keeps a copy of its return value, which may be used in an upcoming call. Change-Id: I4977c39e1ce48cfd5ab067a4df4783f10505a9ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119905 Tested-by: Jenkins Reviewed-by: Andreas Heinisch Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120197 --- scripting/source/basprov/basscript.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripting') diff --git a/scripting/source/basprov/basscript.cxx b/scripting/source/basprov/basscript.cxx index a22cd82f343e..6a9a8d1d8b7b 100644 --- a/scripting/source/basprov/basscript.cxx +++ b/scripting/source/basprov/basscript.cxx @@ -244,6 +244,8 @@ namespace basprov if ( m_documentBasicManager && m_xDocumentScriptContext.is() ) aOldThisComponent = m_documentBasicManager->SetGlobalUNOConstant( "ThisComponent", makeAny( m_xDocumentScriptContext ) ); + // tdf#143582 - clear return value of the method before calling it + m_xMethod->Clear(); if ( m_caller.hasElements() && m_caller[ 0 ].hasValue() ) { SbxVariableRef xCallerVar = new SbxVariable( SbxVARIANT ); -- cgit