| Summary: | Empty parameter of type variant does no longer work in sub | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | Regina Henschel <rb.henschel> |
| Component: | BASIC | Assignee: | Andreas Heinisch <andreas.heinisch> |
| Status: | VERIFIED FIXED | ||
| Severity: | normal | CC: | alain.romedenne, andreas.heinisch, himajin100000, ilmari.lauhakangas |
| Priority: | medium | Keywords: | bibisected, bisected, regression |
| Version: | 7.0.0.0.alpha0+ | ||
| Hardware: | x86-64 (AMD64) | ||
| OS: | All | ||
| Whiteboard: | target:7.1.0 target:7.0.0.1 | ||
| Crash report or crash signature: | Regression By: | ||
| Bug Depends on: | |||
| Bug Blocks: | 127592 | ||
| Attachments: |
Writer document with test macro
Example with pure Basic, call Echo_Input_bySub |
||
|
Description
Regina Henschel
2020-04-30 17:58:33 UTC
the script does not work NOT BECAUSE getByIndex doesn't work BUT BECAUSE getSelectedShape_inWriter is called with nothing assigned to oShape(i.e. EMPTY) in examineShape_inWriterexamineShape_inWriter. sub examineShape_inWriter dim oDocument as variant: oDocument = ThisComponent dim oShape as variant REM assign something oShape = 1 getSelectedShape_inWriter(oShape) rem for to set breakpoint dim dummy as integer dummy = 1 end sub (In reply to himajin100000 from comment #1) > the script does not work NOT BECAUSE getByIndex doesn't work BUT BECAUSE > getSelectedShape_inWriter is called with nothing assigned to oShape(i.e. > EMPTY) in examineShape_inWriterexamineShape_inWriter. The script works in released versions and therefore should work in the upcoming next version too. (In reply to himajin100000 from comment #1) > the script does not work NOT BECAUSE getByIndex doesn't work BUT BECAUSE > getSelectedShape_inWriter is called with nothing assigned to oShape(i.e. > EMPTY) in examineShape_inWriterexamineShape_inWriter. You are right. getByIndex is OK, but the parameter of sub is the problem. So the problem is, that something was changed in parameter handling for sub. REM ***** BASIC ***** option explicit sub UserInput_bySub (aInput as variant) aInput = InputBox("Enter something","Test of empty parameter as sub","write here") end sub sub Echo_Input_bySub dim oInput as variant: UserInput_bySub(oInput) msgbox("You entered " & oInput) end sub That works in LibreOffice Version: 6.4.3.2 (x64), but does not work in Version: 7.0.0.0.alpha1+ (x64). Created attachment 160916 [details]
Example with pure Basic, call Echo_Input_bySub
Bibisected with Linux 6.5 repo to https://git.libreoffice.org/core/+/84b884135ee419fe7abfefa7b4b651a649cf9ad9%5E!/ tdf#79426, tdf#125180 - Don't convert missing parameters to requested type I see Andreas is already in CC :) Andreas Heinisch committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/345cb192f0bc2fef97ae52ade48efc2d8591a165 tdf#132563 - Convert parameters of type SbxEMPTY It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. Thanks for fixing, I verified it! Arch Linux 64-bit Version: 7.1.0.0.alpha0+ Build ID: de1b634a151c198584dc152676183f519c50a2da CPU threads: 8; OS: Linux 5.6; UI render: default; VCL: kf5 Locale: fi-FI (fi_FI.UTF-8); UI: en-US Calc: threaded Built on 12 June 2020 Andreas Heinisch committed a patch related to this issue. It has been pushed to "libreoffice-7-0": https://git.libreoffice.org/core/commit/e398fe3a61688676054cc81ef41dc71564618339 tdf#132563 - Convert parameters of type SbxEMPTY It will be available in 7.0.0.1. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. |