Bug 128409 - Event-Triggers "When unloading" and "Before unloading" of Forms do not work
Summary: Event-Triggers "When unloading" and "Before unloading" of Forms do not work
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.3.2.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-27 07:17 UTC by Hans
Modified: 2023-12-03 13:47 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Attached the requested Test-ODB-File (11.68 KB, application/vnd.sun.xml.base)
2019-11-13 08:39 UTC, Hans
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hans 2019-10-27 07:17:40 UTC
Description:
It is not possible to trigger the Events "Before unloading" or "When unloading" when a Form is closed in Base. This malfunction already was documented in the LibreOffice Base Handbook in the year 2003 (Page 68: Unloading: This option seems not to function."). Even with LibreOffice 6.3.2.2 it is not working.


Steps to Reproduce:
1. Create a Form within Base
2. Create a Macro e.g "Sub OnUnloadForm"
3. In the Form-Properties/Events assign the event "Before unloading" or "When unloading" to this Macro
4. Verify that this Macro will NOT be called when the form is unloaded

Actual Results:
I am not able to check if the form is getting closed. I don't know how to check if a form is open without this event.

Expected Results:
The Event-Triggers "Before unloading" and "When unloading" of a Form should be working.


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Hans 2019-10-27 07:25:56 UTC
I meant the LibreOffice 4.0 Base Handbook from the year 2013, Page 68. Sorry for my faulty typed year.
Comment 2 Alex Thurgood 2019-11-13 07:30:17 UTC
Not sure this ever worked, and so probably inherited from OOo times.
Comment 3 Alex Thurgood 2019-11-13 07:32:17 UTC
Unfortunately, I'm not in a position to test older versions of LO on macOS Catalina, they either no longer work at all (32bit app support ceased with the release of Catalina) or else they refuse to recognize Java, making any Base related work impossible.
Comment 4 Alex Thurgood 2019-11-13 07:34:07 UTC
From a historical perspective, some of the UNO events, although present via the UI, were never actually implemented properly by Sun/Oracle. This could be one such pair, unless someone can show with a version of OOo that they worked at some stage.
Comment 5 Alex Thurgood 2019-11-13 07:46:43 UTC
@Hans : please provide a test ODB file with corresponding macro and form (or other object where event should be triggered), so that we can attempt to investigate further.
Comment 6 Hans 2019-11-13 08:39:07 UTC
Created attachment 155768 [details]
Attached the requested Test-ODB-File

Open the database "LoadUnload.odb" and the included form "FormToTriggerEvent". Closing the form should call the macro "OnUnloadForm" showing a Messagebox. But the macro will never be called although the events "Before unloading" and "When unloading" of the form "FormToTriggerEvent" are assigned to the macro.
Comment 7 Hans 2019-11-13 08:46:14 UTC
Thanks for investigating on this Error-Report. For more informations, please dont hesitate to contact me.
Comment 8 Alex Thurgood 2019-11-13 12:02:21 UTC
Thanks !


Confirming with test file provided by OP.

Version: 6.4.0.0.alpha1+
Build ID: f7bc0204a80a4f078c63f93b9892904686ad5b36
CPU threads: 4; OS: Mac OS X 10.15.1; UI render: default; VCL: osx; 
Locale: fr-FR (fr_FR.UTF-8); UI-Language: en-US
Calc: threaded
Comment 9 Alex Thurgood 2019-11-13 12:11:41 UTC
Seems that XEventListener is the culprit here.
Comment 10 Alex Thurgood 2019-11-13 12:12:50 UTC
See also:

https://forum.openoffice.org/en/forum/viewtopic.php?f=21&t=10123
Comment 12 Xisco Faulí 2019-12-02 17:23:37 UTC
@Samuel, I thought you might be interested in this issue....
Comment 13 QA Administrators 2021-12-02 04:43:38 UTC Comment hidden (obsolete)
Comment 14 Hans 2021-12-02 05:47:34 UTC
The bug (XEventListener as culprit, see comment 9]) is still active under LO 7.2.3.2 (Build: d166454616c1632304285822f9c83ce2e660fd92) and Win10x64 with newest updates.
Comment 15 QA Administrators 2023-12-03 03:14:11 UTC Comment hidden (obsolete)
Comment 16 Hans 2023-12-03 13:47:19 UTC
The bug (XEventListener as culprit, see comment 9]) is still active under LO 7.6.3.2 (Build: 29d686fea9f6705b262d369fede658f824154cc0) and Win11x64 with newest updates.