Created attachment 160145 [details] Writer document with test macro Enable macro execution. Open attached file. It contains macros. The purpose of the macros is to examine shapes in Writer. Select the shape and then run macro "examineShape_inWriter". Expected: Shows msgbox "success". Actual: error: Incorrect property value I see the error in Version: 7.0.0.0.alpha0+ (x64) Build ID: f924658e45f256544e43c3fdb2af9b585d0f0933 CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: Skia/Vulkan; VCL: win; Locale: en-US (en_US); UI-Language: en-US Calc: CL It was OK in Version: 7.0.0.0.alpha0+ (x64) Build ID: 6388c578c672690fff662cb04b6a0436cd742f37 CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: Skia/Vulkan; VCL: win; Locale: de-DE (en_US); UI-Language: en-US Calc: threaded
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.