basic/qa/basic_coverage/test_optional_paramter_type.vb | 33 +++++++++++++++++ basic/source/runtime/runtime.cxx | 2 - 2 files changed, 34 insertions(+), 1 deletion(-)
New commits: commit ff6383face219970a0435b008a0439643a61043e Author: Tomoyuki Kubota <himajin100...@gmail.com> AuthorDate: Tue Sep 17 21:24:50 2019 +0900 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Sep 17 16:33:33 2019 +0200 tdf#118544 set correct type for optional parameter Change-Id: Id8840431b9dc1f1e97882c675ebfc6456e33d953 Reviewed-on: https://gerrit.libreoffice.org/77684 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/basic/qa/basic_coverage/test_optional_paramter_type.vb b/basic/qa/basic_coverage/test_optional_paramter_type.vb new file mode 100755 index 000000000000..37198ea38244 --- /dev/null +++ b/basic/qa/basic_coverage/test_optional_paramter_type.vb @@ -0,0 +1,33 @@ +REM ***** BASIC ***** +Option Compatible + +Function doUnitTest() As Integer + doUnitTest = 0 + If CheckType1(32) = 0 Then + Exit Function + End If + If CheckType2(32) = 0 Then + Exit Function + End If + If CheckType2() = 0 Then + Exit Function + End If + doUnitTest = 1 +End Function + +Function CheckType1(x As Integer) As Integer + If TypeName(x) = "Integer" Then + CheckType1 = 1 + Else + CheckType1 = 0 + End If +End Function + + +Function CheckType2(Optional y As Integer = 32 ) As Integer + If TypeName(y) = "Integer" Then + CheckType2 = 1 + Else + CheckType2 = 0 + End If +End Function \ No newline at end of file diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx old mode 100644 new mode 100755 index 74fe533bd4a5..59daf1531d2a --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -4040,7 +4040,7 @@ void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 ) if( nDefaultId > 0 ) { OUString aDefaultStr = pImg->GetString( nDefaultId ); - p = new SbxVariable(); + p = new SbxVariable(pParam-> eType); p->PutString( aDefaultStr ); refParams->Put( p, i ); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits