Description: LibreOffice Calc crashes when control is remove with a popup up menu displayed. This behaviour can be see in my Cell Controls Example: https://github.com/Amourspirit/python-ooouno-ex/tree/34108410d0c4b52a2d9668c961813fa8529f991b/ex/auto/calc/odev_cell_controls In the example controls are dynamically added to the sheet when a cell is clicked. I set an event to remove the control when it looses focus. This seems to work fine with the following excptions. If the control popup menu is activated (right click) then the control loose focus and tries to remove itself from the sheet. When the menu active this causes a crash and LibreOffice Calc completly disappears. Also, if I recall correctly if the control is not removed before switching sheets it will also crash. But, I put in an event handler to make sure the control is removed before sheet activation changes This crash may happen in other LibreOffice Applications, I did not test for this. Related Bug: Forms Listeners stop working after a different sheet is activated. https://bugs.documentfoundation.org/show_bug.cgi?id=159134 Related: How to stop Menu activation for a control? https://ask.libreoffice.org/t/how-to-stop-menu-activation-for-a-control/104160 Steps to Reproduce: 1. Start the example, link in description. 2. Click on a cell in COL B or C, this will insert a control. 3. Right click on the control, Calc will crash. Actual Results: Calc will crash Expected Results: Popup menu just exits gracefuly if the control is removed. Reproducible: Always User Profile Reset: No Additional Info: Related Bug: Forms Listeners stop working after a different sheet is activated. https://bugs.documentfoundation.org/show_bug.cgi?id=159134 Related: How to stop Menu activation for a control? https://ask.libreoffice.org/t/how-to-stop-menu-activation-for-a-control/104160
Created attachment 193417 [details] A simpler self-contained reproducer This is a document with a single textbox; its "when losing focus" event is bound to this macro: sub OnFocusLost(evt) doc = ThisComponent src = evt.Source drawPage = doc.DrawPages(0) txtbox = drawPage(0) drawPage.remove(txtbox) end sub
Created attachment 193421 [details] bt with console logs On pc Debian x86-64 with master sources updated today, I could reproduce this.
Caolán: backtrace and console logs show a pb in vcl part. Do you think it may be possible to have more info than: warn:legacy.osl:28560:28560:vcl/source/window/window.cxx:309: Window ( 4Edit()) with live SystemWindows destroyed: 18MenuFloatingWindow() Window ( 4Edit()) with live SystemWindows destroyed: 18MenuFloatingWindow() to pinpoint the location of the problematic code?