diff options
author | tushar <tusharrai282@gmail.com> | 2021-01-10 21:22:11 +0530 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-01-18 12:44:05 +0100 |
commit | 3b3591d3c127c306f4d5f6bbb34118b03c3124c0 (patch) | |
tree | f7e95f886626270848ae47add84817b31696d74a /scripting | |
parent | 5405bd8cb81f09d1631aeebd95bd6b00926ae931 (diff) |
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 <mike.kaganski@collabora.com>
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/source/basprov/basscript.cxx | 15 |
1 files changed, 11 insertions, 4 deletions
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<sal_uInt16>(i) + 1)) + { + SbxDataType t = static_cast<SbxDataType>(p->eType & 0x0FFF); + // Enable passing by ref + if (t != SbxVARIANT) + xSbxVar->SetFlag(SbxFlagBits::Fixed); + } + } + } } if ( xSbxParams.is() ) m_xMethod->SetParameters( xSbxParams.get() ); |