Created attachment 50934 [details] Document with document open event attached If you write a simple BASIC macro for example: Sub main msgbox "hello" End Sub Go to Tools->Customize...->Events Select the event Open Document Click on Macro and locate the macro Save in "the document" Press OK Save and close the file. Reopen the file. The macro should start (if the macro-settings allows it). Now go back to Tools->Customize...->Events Select the event Open Document Click on remove (it gets removed from the list of events...) Click OK Save and close the document Reopen the file, the event is still called. I can change the event to something else but not remove it. I've added a document where the event is assigned. To be able to run the macro you need to lower the macro security to Medium or lower. Go to Tools->Options->Security->Macro Security... Set to Medium click OK click OK When you open the "Cannot remove event.odt" you will need to Enable Macros. Now you can just try to remove the Event see instructions above.
Forgot to say that I've tested in LibreOffice 3.4.3 Windows 64 bit. I've seen the problem on Ubuntu though I don't remember witch version of LibreOffice. It does however work on XP with LibreOffice 3.3.4
[Reproducible] with reporter's sample (and own documents) and "LibreOffice 3.4.3 RC2 - WIN7 Home Premium (64bit) German UI [OOO340m1 (Build:302)]". My test: 0. Save at reliable place for macro execution, adapt macro security so that macros will be executed for document. 1. open sample "hello" box from event appears 2. Menu 'Tools -> Customize -> Events' Macro "Standard.Module1.main" as event for "Open Document" 3. Click <Remove> Event disappears from list 4. Menu 'Save as' and save with new name 5. Close 6. Reopen Expected: no "hello" box Actual: "hello" box from event appears Checking Menu 'Tools -> Customize -> Events' still or again shows Macro "Standard.Module1.main" as event for "Open Document" Although in step 3 it looks as if the event has been deleted, it's still active. Same problem with Server installation of Master "LibO-dev 3.5.0 – WIN7 Home Premium (64bit) English UI [(Build ID: 3b32204-7f92fce-2ba0a9f)]" You can shorten the text if you redo step 2 of test after step 3: you will see that event macro still (again) is listed, deletion failed. Worked fine with "LibreOffice Portable 3.3.3 - WIN7 Home Premium (64bit) German UI [OOO330m19 (Build:301 Tag 3.3.3.1)]", so REGRESSION
This might be a clue to whats going on... Earlier when i tried to remove an event from a document i used the code below. This does not work anymore. ' My old code Sub removeEventOnNewDocument() Dim vListeners Dim replacementEvent As Any vListeners = ThisComponent.getEvents() vListeners.replaceByName("OnLoad", replacementEvent) End Sub But... Changing the Dim of the replacementEvent to a Variable works. ' My new code Sub removeEventOnNewDocument() Dim vListeners Dim replacementEvent As Variable vListeners = ThisComponent.getEvents() vListeners.replaceByName("OnLoad", replacementEvent) End Sub
The bug has been seen on LibreOffice 3.4.3 Mac OS X 10.6.8 as well. http://nabble.documentfoundation.org/Remove-Macros-td3346273.html
[This is an automated message.] This bug was filed before the changes to Bugzilla on 2011-10-16. Thus it started right out as NEW without ever being explicitly confirmed. The bug is changed to state NEEDINFO for this reason. To move this bug from NEEDINFO back to NEW please check if the bug still persists with the 3.5.0 beta1 or beta2 prereleases. Details on how to test the 3.5.0 beta1 can be found at: http://wiki.documentfoundation.org/QA/BugHunting_Session_3.5.0.-1 more detail on this bulk operation: http://nabble.documentfoundation.org/RFC-Operation-Spamzilla-tp3607474p3607474.html
No longer reproducible with reporter's sample and parallel Dev-Installation of "LibreOffice 3.5.0 Beta2- WIN7 Home Premium (64bit) German UI [Build-ID : 8589e48-760cc4d-f39cf3d-1b2857e-60db978], so WFM. @reporter: Please feel free to reopen this bug if you find out that the problem still exists with LibreOffice version 3.5.