Bug 151012 - Msgbox Button parameter isn't optional
Summary: Msgbox Button parameter isn't optional
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
7.4.1.2 release
Hardware: All All
: medium normal
Assignee: Andreas Heinisch
URL:
Whiteboard: target:7.5.0 target:7.4.3
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-16 22:43 UTC by TISSENDIER Pierre
Modified: 2022-10-17 09:18 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description TISSENDIER Pierre 2022-09-16 22:43:34 UTC
Version: 7.4.1.2 / LibreOffice Community
Build ID: 3c58a8f3a960df8bc8fd77b461821e42c061c5f0
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded

Hello,
Sorry but I don't find this bug in bugzilla

In LO 7.4 the Button parameter (2nd) of Msgbox function/instruction is no longer optional

msgbox "hello" -> good
msgbox "hello",,"title" -> fail  ???
msgbox "hello",0,"title" -> good

thank you for your look.
Comment 1 Julien Nabet 2022-09-17 16:08:32 UTC
Reading https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/msgbox-function, it seems all args after first one are optional.

Any thoughts here?
Comment 2 TISSENDIER Pierre 2022-09-17 17:02:46 UTC
(In reply to Julien Nabet from comment #1)
> Reading
> https://learn.microsoft.com/en-us/office/vba/language/reference/user-
> interface-help/msgbox-function, it seems all args after first one are
> optional.
> 
> Any thoughts here?

OK for the link
Indeed the arguments after the first must be optional.
It's like that from the origin of LO!
But in version 7.4 it doesn't work anymore

Have you really tested in version 7.4?
Comment 3 Julien Nabet 2022-09-17 17:08:43 UTC
(In reply to Julien Nabet from comment #1)
> Reading
> https://learn.microsoft.com/en-us/office/vba/language/reference/user-
> interface-help/msgbox-function, it seems all args after first one are
> optional.
> 
> Any thoughts here?

Sorry, the last comment was for Mike and Andreas, I should have put:
Andreas/Mike: any thoughts here?
Comment 4 Rafael Lima 2022-09-17 21:27:51 UTC
I am not sure I understood correctly, but the following code works for me:

Sub test
  MsgBox "Message", Title := "Dialog title"
End Sub

I did not have to specify the Buttons argument.
Comment 5 Rafael Lima 2022-09-17 21:28:53 UTC
BTW, I forgot to mention in Comment #4 that I'm using LO 7.4.1

Version: 7.4.1.2 / LibreOffice Community
Build ID: 40(Build:2)
CPU threads: 16; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Ubuntu package version: 1:7.4.1~rc2-0ubuntu0.22.04.1~lo1
Calc: threaded
Comment 6 TISSENDIER Pierre 2022-09-18 07:40:46 UTC
(In reply to Rafael Lima from comment #5)
> BTW, I forgot to mention in Comment #4 that I'm using LO 7.4.1
> 
> Version: 7.4.1.2 / LibreOffice Community
> Build ID: 40(Build:2)
> CPU threads: 16; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb)
> Locale: pt-BR (pt_BR.UTF-8); UI: en-US
> Ubuntu package version: 1:7.4.1~rc2-0ubuntu0.22.04.1~lo1
> Calc: threaded

Yes, but you use a named parameter (it is heavy !)

The question why this code failed ? While he has never posed a problem since LO 1.0!

Sub test
  MsgBox "Message",,"Dialog title"
End Sub

I don't know how to be clearer

Thanks a lot
Comment 7 Andreas Heinisch 2022-09-18 19:24:31 UTC
Confirmed in:
Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: cc82ae8fb23d84c263fbe6886320f6f819248db2
CPU threads: 16; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: CL threaded
Comment 8 Commit Notification 2022-09-25 09:40:35 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6f3532f6aaafb6ad58a9e32dc0eff43a0d54862b

tdf#151012 - Initialize optional parameters with their default values

It will be available in 7.5.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.
Comment 9 Commit Notification 2022-10-03 10:00:49 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/a2838a17498001c07b365d2087239710e7f0473a

tdf#151012 - Initialize optional parameters with their default values

It will be available in 7.4.3.

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.
Comment 10 TISSENDIER Pierre 2022-10-17 09:13:37 UTC
Sorry but is not available in

Version: 7.4.2.3 / LibreOffice Community
Build ID: 382eef1f22670f7f4118c8c2dd222ec7ad009daf
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded
Comment 11 Julien Nabet 2022-10-17 09:18:40 UTC
(In reply to TISSENDIER Pierre from comment #10)
> Sorry but is not available in
> 
> Version: 7.4.2.3 / LibreOffice Community
> Build ID: 382eef1f22670f7f4118c8c2dd222ec7ad009daf
> CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
> Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
> Calc: threaded

Quite expected since it'll be fixed from 7.4.3 (not 7.4.2) as Whiteboard indicates.