summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2020-12-05 09:41:56 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2020-12-07 19:31:21 +0100
commit4db748f8ce2241e500bb900c94abc74ebf8690d7 (patch)
tree31be986eadbd5dd19bea94a4731004373cd5648d /basic
parent2c4806d6b8d79c1b95a41b72d295888bca01d5d8 (diff)
tdf#43003 - convert parameter to the requested type
In StepPARAM convert parameters to the requested type, otherwise it loses possible references which leads to an error where the results of a macro has no effect on the caller. Change-Id: I8347eab658e037a29cd04be9c00edd6a4d1b31c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107249 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 2538188ee85513cb80eb8aa8f925082d86ff711d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107307 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/runtime/runtime.cxx10
1 files changed, 2 insertions, 8 deletions
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 0606b78ca420..dd39a133a450 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -4177,14 +4177,8 @@ void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
}
else if( eType != SbxVARIANT && static_cast<SbxDataType>(pVar->GetType() & 0x0FFF ) != eType )
{
- SbxVariable* q = new SbxVariable( eType );
- aRefSaved.emplace_back(q );
- *q = *pVar;
- pVar = q;
- if ( nIdx )
- {
- refParams->Put32( pVar, nIdx );
- }
+ // tdf#43003 - convert parameter to the requested type
+ pVar->Convert(eType);
}
SetupArgs( pVar, nOp1 );
PushVar( CheckArray( pVar ) );