Description: I have upgrade LO from 24.2.5 to 24.8.2 (and also Java to actual build 1.8.0_431-b10) I face problems with macros stored in sCalc file, which were working in 24.2 without any problems: 1. macro: sub QRweb createUnoService("com.sun.star.system.SystemShellExecute").execute( _ ConvertToURL(ThisComponent.getSheets().getByName("QR").getCellRangeByName("A14").getString()),,0) end sub Running this macro gives an error on first line “BASIC runtime error. Argument is not optional.” although macro runs and opens the web page. 2. macro: sub ResizeQR rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") rem ---------------------------------------------------------------------- rem dispatcher.executeDispatch(document, ".uno:TransformDialog", "", 0, Array()) rem ---------------------------------------------------------------------- dim args2(3) as new com.sun.star.beans.PropertyValue args2(0).Name = "TransformPosX" args2(0).Value = 50 args2(1).Name = "TransformPosY" args2(1).Value = 10500 args2(2).Name = "TransformWidth" args2(2).Value = 4300 args2(3).Name = "TransformHeight" args2(3).Value = 4940 dispatcher.executeDispatch(document, ".uno:TransformDialog", "", 0, args2()) end sub Running this macro makes LO crash. Steps to Reproduce: What I have tried: 1. Installed through Separate Install GUI back the version 24.2.5.2 and tried to run macros - works still fine. 2. Copied the user profile from actual LO to the separate 24.2.5.2 and tried to run macros - works fine. Java is enabled 3. Installed a separate 24.8.2. version with a clear user profile and tried to run macros on the file - error (macro 1) / crashed (macro 2) Actual Results: some problems with macros Expected Results: no problems should occur Reproducible: Always User Profile Reset: Yes Additional Info: It makes no difference, if Java experimental features are enabled or not, I tried in 24.8 both possibilities.
version 24.8.3.1 is also affected in the same way.
This is not a bug - the `execute` method of XSystemShellExecute[1] has no optional arguments, and using it as you did (putting no arguments between commas) was only working by accident before the fix for bug 162431, because the error code 448 for missing argument was passed as an integer there instead, which is definitely wrong. [1] https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1system_1_1XSystemShellExecute.html#af7a73d7840dfafddb1bfb0e10c4ec8e0
Oh - there is the crash second part (which is, of course, wrong - a single issue for a single problem). Well, since the first part is not a bug, we can handle the second part here, instead. How should this macro be called? Which component? Should a specific document be open?
The crash for the second crasher issue happens e.g. when you create a new Impress document, select a (bottom) frame on the default slide, and run the macro. The crash is in SfxItemPool::GetUserOrPoolDefaultItem, and that is likely a regression after Armin's ITEM rework. Also adding Noel, he may have an idea what to do.
Created attachment 197297 [details] test file with macro causing crash of LO
I am attaching a sample file with the macro. What is should do is to resize a picture. How do I use it: 1. create QR code on specific web site 2. Copy image from the web site, pasting the image into scalc sheet. 3. Press button QR (the image has to be selected) - that should run the macro, which should resize the image and place it on a specific place in document.
I have forgot to mention, thank you for explanation of macro 1, which i did not know about, as i am not very familiar with macros - I found this macro on the web and it worked for a while, so I did not know, that the problem is the macro itself, as I forced 2 problems with macros at the same time.
This bug started before Armin's work, I tested to before commit bd6c6d46e82eb5cf5839a5b99e4838471250e959. It's going to need a bibisect I think. From a cursory examination, it looks like the macro is trying to use an internal slot and the macro is not populating all of the values that the slot processing code expects. Specifically the code wants SID_ATTR_TRANSFORM_SIZE_POINT. Unfortunately, I don't see a way to pass SID_ATTR_TRANSFORM_SIZE_POINT from macro code right now, because the declaratation in the svx.sdi file does not include that parameter.