From 3b3591d3c127c306f4d5f6bbb34118b03c3124c0 Mon Sep 17 00:00:00 2001 From: tushar Date: Sun, 10 Jan 2021 21:22:11 +0530 Subject: tdf#133887 Set flag of variable when formal parameter is not expecting variant. If there is no param info for formal paramter then type of formal parameter and actual parameter will be same and there is no need to set the flag in that case. Change-Id: I12af64f82fc5b2d6d7fb920bde1cb96f8c7bd51b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109070 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- scripting/source/basprov/basscript.cxx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'scripting') diff --git a/scripting/source/basprov/basscript.cxx b/scripting/source/basprov/basscript.cxx index 216e2fa99bd6..16ffeb9dc9ee 100644 --- a/scripting/source/basprov/basscript.cxx +++ b/scripting/source/basprov/basscript.cxx @@ -205,10 +205,17 @@ namespace basprov unoToSbxValue( xSbxVar.get(), pParams[i] ); xSbxParams->Put32( xSbxVar.get(), static_cast< sal_uInt32 >( i ) + 1 ); - // Enable passing by ref - if ( xSbxVar->GetType() != SbxVARIANT ) - xSbxVar->SetFlag( SbxFlagBits::Fixed ); - } + if (pInfo) + { + if (auto* p = pInfo->GetParam(static_cast(i) + 1)) + { + SbxDataType t = static_cast(p->eType & 0x0FFF); + // Enable passing by ref + if (t != SbxVARIANT) + xSbxVar->SetFlag(SbxFlagBits::Fixed); + } + } + } } if ( xSbxParams.is() ) m_xMethod->SetParameters( xSbxParams.get() ); -- cgit