wizards/source/sfwidgets/SF_Register.xba |    1 +
 1 file changed, 1 insertion(+)

New commits:
commit 760fc80d167a6bc63305fe3a45dd4df6f87d9f68
Author:     Jean-Pierre Ledure <j...@ledure.be>
AuthorDate: Wed Nov 10 17:42:28 2021 +0100
Commit:     Jean-Pierre Ledure <j...@ledure.be>
CommitDate: Thu Nov 11 10:29:23 2021 +0100

    ScriptForge - (SFWidgets) fix New PopupMenu without event
    
    Invoking the service without an event object was supposed to work.
    
    For instance:
    
       Dim myPopup As Object
       Set myPopup = CreateScriptService("PopupMenu", , 300, 300)
    
    This would create the PopupMenu in position (300, 300)
    without an event object... however this does not work.
    Getting an error saying that "Event is EMPTY"
    
    => Add an IsEmpty() test.
    
    Change-Id: I86a1baf83264921088facbd35bf8fa299a5aa132
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125005
    Tested-by: Jean-Pierre Ledure <j...@ledure.be>
    Tested-by: Jenkins
    Reviewed-by: Jean-Pierre Ledure <j...@ledure.be>

diff --git a/wizards/source/sfwidgets/SF_Register.xba 
b/wizards/source/sfwidgets/SF_Register.xba
index b7f366102be4..4dbb84f03104 100644
--- a/wizards/source/sfwidgets/SF_Register.xba
+++ b/wizards/source/sfwidgets/SF_Register.xba
@@ -79,6 +79,7 @@ Check:
        If IsMissing(pvArgs) Or IsEmpty(pvArgs) Then pvArgs = Array()
        If Not IsArray(pvArgs) Then pvArgs = Array(pvArgs)
        If UBound(pvArgs) &gt;= 0 Then Event = pvArgs(0) Else Event = Nothing
+       If IsEmpty(Event) Then Event = Nothing
        If UBound(pvArgs) &gt;= 1 Then X = pvArgs(1) Else X = 0
        If UBound(pvArgs) &gt;= 2 Then Y = pvArgs(2) Else Y = 0
        If UBound(pvArgs) &gt;= 3 Then SubmenuChar = pvArgs(3) Else SubmenuChar 
= &quot;&quot;

Reply via email to