[Libreoffice-bugs] [Bug 143582] New: The return value of Basic function is not initialized when called by the invoke method

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Wed Jul 28 11:43:48 UTC 2021


https://bugs.documentfoundation.org/show_bug.cgi?id=143582

            Bug ID: 143582
           Summary: The return value of Basic function is not initialized
                    when called by the invoke method
           Product: LibreOffice
           Version: 7.1.4.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: sokol at comec92.ru

Description:
The return value of Basic function is not initialized when called by the invoke
method

Steps to Reproduce:
Insert the next script into module Module1 of library Standard of any Calc
document.

Option Explicit
Function ConcatArray(arr) As String
  Dim v
  For Each v In arr
    ConcatArray=ConcatArray & v
  Next v
End Function

Sub Test1
  Msgbox ConcatArray(Array("a", "b"))
  Msgbox ConcatArray(Array("c", "d"))
End Sub

Sub Test2
  Dim script
  script =
ThisComponent.scriptProvider.getScript("vnd.sun.star.script:Standard.Module1.ConcatArray?language=Basic&location=document")
  Msgbox script.invoke(Array(Array("a", "b")), Array(), Array())
  Msgbox script.invoke(Array(Array("c", "d")), Array(), Array())  
End Sub


Actual Results:
Run "Test1". It shows
ab
cd

Then run "Test2". It shows
cdab
cdabcd

Expected Results:
Test2 MUST show
ab
cd


Reproducible: Always


User Profile Reset: No



Additional Info:

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210728/76b84889/attachment-0001.htm>


More information about the Libreoffice-bugs mailing list