Description: End users may `Run` macros which were programmed by others. To improve the user experience, only valid macros should be listed in the `Macro Selector` window. Actual Results: Macros which produce errors when run or are private can be access by the `Macro Selector`. Expected Results: Macros which produce errors (i.e. ones with passed arguments) when run or are private should not be shown in the `Macro Selector`. Reproducible: Always User Profile Reset: No Additional Info: `Macro Selector` should only show macros to Run which are “not Private” and have “no arguments passed” End users may `Run` macros which were programmed by others. To improve the user experience, only valid macros should be listed in the `Macro Selector` window. LibreOffice Calc should only showing macros that can be Run in the LO Calc `Macro Selector`. Screenshot will be attached later. Macros which are `Private` or are passed arguments should not be show. Inspiration from MS Excel. Screenshot will be attached later. Code examples: ``` Private Sub PrivateFunction() MsgBox "This subroutine should not show in the list of macros to run as it is private" End Sub Sub FunctionWithArguments(intVariable As Integer) MsgBox "This function should not show in the list of macros to run as it is passed argument(s)" End Sub Sub FunctionNotPrivateNoArguments() MsgBox "This function should show as it is public and does not get passed any arguments" End Sub ``` What do you think? Thank you
Created attachment 180953 [details] Macros.xls MS Excel spreadsheet with 3 functions: 1. Private 2. With passed argument(s) 3. Public and no passed arguments
Created attachment 180954 [details] MS Excel Macro Window screenshot MS Excel only displays 1 macro which can be run, i.e. the public macro with no passed arguments. Clicking `Run` produces no error.
Created attachment 180955 [details] LO Calc Macro Selector Window screenshot LO Calc displays 3 macro which can be run. The `Private` macro can be run, which is wrong The `Passed Argument` macro can be run, which produces an error. Perhaps this issue should be changed from request for enhancement (RFE) to bug? What do you think? Thank you
https://opengrok.libreoffice.org/xref/core/basctl/source/basicide/macrodlg.cxx?r=499ecbf3#494 https://opengrok.libreoffice.org/xref/core/include/basic/sbxdef.hxx?r=de81c254#147 https://opengrok.libreoffice.org/xref/core/include/basic/sbxcore.hxx?r=0afb2b63#112 https://opengrok.libreoffice.org/xref/core/basic/source/comp/codegen.cxx?r=5200a736#353