summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2022-01-31 20:02:50 +0100
committerAndreas Heinisch <andreas.heinisch@yahoo.de>2022-02-03 09:43:37 +0100
commit6a0f00d3b9d1a74637c92ec6eff1ba5fedc82f3d (patch)
tree16b4cdcba938800bdfbd41582600cbfca3b98855 /basic
parent65b09ef1c5e24651579eb11900cf2ddbbb7b0971 (diff)
tdf#146742 - Move the initialization code of a method to SbMethod::Call
Change-Id: I516bacdcd22ed094a0e9b6e125e941f32fe88c82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129238 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/classes/sbxmod.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 2d38de16dcfd..e9502a29aa13 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -2062,6 +2062,12 @@ ErrCode SbMethod::Call( SbxValue* pRet, SbxVariable* pCaller )
if( bInvalid && !pMod_->Compile() )
StarBASIC::Error( ERRCODE_BASIC_BAD_PROP_VALUE );
+ // tdf#143582 - clear return value of the method before calling it
+ const SbxFlagBits nSavFlags = GetFlags();
+ SetFlag(SbxFlagBits::ReadWrite | SbxFlagBits::NoBroadcast);
+ Clear();
+ SetFlags(nSavFlags);
+
Get( aVals );
if ( pRet )
pRet->Put( aVals );