https://bugs.documentfoundation.org/show_bug.cgi?id=165191

            Bug ID: 165191
           Summary: Menu created by ScriptForge crashes document
           Product: LibreOffice
           Version: 25.2.0.3 release
          Hardware: x86-64 (AMD64)
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: [email protected]
          Reporter: [email protected]

Description:
Hello!

In Calc document I create new menu and menu item:

Sub CreateMenu()
    Dim oDoc as Object, oMenu as Object

    GlobalScope.BasicLibraries.loadLibrary("ScriptForge")

    Set oDoc = CreateScriptService("Document")
    Set oMenu = oDoc.CreateMenu("MyMenu")
    oMenu.AddItem("Item 1", Script :=
"vnd.sun.star.script:Standard.Module1.Menu_Listener?language=Basic&location=document")
    oMenu.Dispose()
End Sub

When user clicks "Item 1" following event handler is launched:

Sub Menu_Listener(args As String)
    ' don't finish before 5 s
    Wait(5000)
End Sub

Now, if user clicks "MyMenu" within 5 seconds, the document crashes (just after
event handler finishes).




Steps to Reproduce:
1. Create menu and menu item (using ScriptForge)
2. Create long lasting event handler and attache it to menu item created in
step 1.
3. Click main menu created in stem 1. before event handler finishes.
4. Let the event handler to finish.
5. Entire document crashes.

Actual Results:
Document crashes.

Expected Results:
Document stays alive.


Reproducible: Always


User Profile Reset: No

Additional Info:
I was wondering how to disable menu at the beginning of the event handler and
enable it just before it finishes, but I don't know how to do it. I would be
nice if someone descibes how to do it.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to