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

            Bug ID: 150796
           Summary: LibreOffice/Calc/Basic/Linux: result of a call
                    function overload the macro call in cell !!! NOT
                    OCCURE Windows/Calc/Basic
           Product: LibreOffice
           Version: 7.3.3.2 release
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: LibreOffice
          Assignee: [email protected]
          Reporter: [email protected]

Description:
In a sheet of Libre office under Linux I put values in cells B2,C2,D2,E2,F2
In other cell I call the function Bidouille :
        = Bidouille((B2:F2))
The function compute a Reponse correctly
 1  1  1  5
7 6 5 4 3 
Calc return the value of Reponse but the call of the macro of the cell
(=Reponse(B2:F2) is overload by the Reponse !!!
I need to tape again and again the call of the macro.
See below code of the macro.
function Bidouille(A())
        dim i                   as integer
        dim j                   as integer
        dim imin                as integer
        dim imax                as integer
        dim jmin                as integer
        dim jmax                as integer
        dim iminR               as integer
        dim imaxR               as integer
        dim jminR               as integer
        dim     jmaxR           as integer
        dim Reponse
        dim S

        imin = lbound(A(),1)    :       imax = ubound(A(),1)
        jmin = lbound(A(),2)    :       jmax = ubound(A(),2)    :       dim
R(imax,jmax)
        iminR = lbound(R(),1)   :       imaxR = ubound(R(),1)
        jminR = lbound(R(),2)   :       jmaxR = ubound(R(),2)
'       print A(1,1),A(1,2),A(1,3),A(1,4)
        S = ""
        for i=imin to imax
                for j=jmin to jmax
                        R(i,j) = A(i,j)
                        S = S & R(i,j) & chr$(9)
                        if j = jmax then
                                S = S & chr$(10) & chr$(13)
                        end if
                next j
                S = S & chr$(10) & chr$(13)
        next i
        Reponse = str$(imin) & " " & str$(imax) & " " & str$(jmin) & " " &
str$(jmax) & chr$(10) & chr$(13) & S
        Bidouille = Reponse
end function


Steps to Reproduce:
1.open a sheet LibreOffice
2.Create the macro Bidouille
3.Put values in cells B2,C2,D2,D2,F2
4.In an other cell write =Bidouille((B2:C2))

Actual Results:
 1  1  1  5
7 6 5 4 3 


Expected Results:
The "Actual results" overload the call of the function Bidouille.
We need to rewrite the call of the function Bidouille.


Reproducible: Always


User Profile Reset: No



Additional Info:
Below the function :

function Bidouille(A())
        dim i                   as integer
        dim j                   as integer
        dim imin                as integer
        dim imax                as integer
        dim jmin                as integer
        dim jmax                as integer
        dim iminR               as integer
        dim imaxR               as integer
        dim jminR               as integer
        dim     jmaxR           as integer
        dim Reponse
        dim S

        imin = lbound(A(),1)    :       imax = ubound(A(),1)
        jmin = lbound(A(),2)    :       jmax = ubound(A(),2)    :       dim
R(imax,jmax)
        iminR = lbound(R(),1)   :       imaxR = ubound(R(),1)
        jminR = lbound(R(),2)   :       jmaxR = ubound(R(),2)
'       print A(1,1),A(1,2),A(1,3),A(1,4)
        S = ""
        for i=imin to imax
                for j=jmin to jmax
                        R(i,j) = A(i,j)
                        S = S & R(i,j) & chr$(9)
                        if j = jmax then
                                S = S & chr$(10) & chr$(13)
                        end if
                next j
                S = S & chr$(10) & chr$(13)
        next i
        Reponse = str$(imin) & " " & str$(imax) & " " & str$(jmin) & " " &
str$(jmax) & chr$(10) & chr$(13) & S
        Bidouille = Reponse
end function

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to