Apache OpenOffice (AOO) Bugzilla – Issue 124936
assignment of macros to libraries doesn't work
Last modified: 2014-05-20 12:10:46 UTC
Created attachment 83427 [details] testdocument for replicating problems with basic libraries There is a big trouble in organizing macros in libraries. Assumption: The help says > You can also use the fully qualified name to call a procedure or function: Library.Module.Macro() > For example, to call the Autotext macro from the Gimmicks library, use the following command: > Gimmicks.AutoText.Main() In the attached document there is only a small macro: ------------ Sub Main GlobalScope.DialogLibraries.loadLibrary( "Gimmicks" ) Gimmicks.AutoText.Main() End Sub ------------ PROBLEM 1 ========= Please do following: 1. Close AOO completely and restart it. 2. Open the attached document and run the macro. Result: You will get an error message: > Property or method not found: AutoText. You can look into the library list to see that "Gimmicks" is loaded. If you open this library (click onto [+]) and you rerun the macro, now it will work. Same for ------------ Sub Main GlobalScope.Gimmicks.AutoText.Main() End Sub ------------ PROBLEM 2 ========= Condition: "Gimmicks" is loaded and the above macro runs. If you change the library to MyBigLib.AutoText.Main() you will get an error because there is no library "MyBigLib". BUT change it e. g. to Euro.AutoText.Main() the macro runs without any error although "Euro" isn't loaded and is has no macro "AutoText". HINT: This problems not only belongs macros in documents. Maybe the described problems correspondents with issue 87928.
(In reply to mroe from comment #0) > ------------ > Sub Main > GlobalScope.DialogLibraries.loadLibrary( "Gimmicks" ) > Gimmicks.AutoText.Main() > End Sub You are loading Gimmicks library of dialogs. Please use BasicLibraries to load basic modules.
Created attachment 83429 [details] document to demonstrate PROBLEM 2 in comment 0 Sorry. :-( Checked it again and again and again ... But PROBLEM 2 exists as described. So I add a new attachment with the macro ------------ Sub Main GlobalScope.BasicLibraries.loadLibrary( "Gimmicks" ) ' Euro.AutoText.Main() 'It runs although the library "Euro" has no module "AutoText". MsgBox( "Next run Main from Library 1:" ) Library1.Main() 'It runs although no module is given. MsgBox( "Next run Main from Library 2:" ) Library2.Main() 'It runs although no module is given. MsgBox( "Next run a nonexisting macro from Library 1 but exisits in Library 2:" ) Library1.Module3.Test() 'It runs although "Library 1" has no macro "Test" and no module "Module3". End Sub ------------
When I push the button on the attached document, dozen of documents were created by Euro.AutoText.Main(). This means Library1.Main() call from unloaded libyrary Library1 goes bad procedure Standard.Module1.Main. I think this kind of problem has been reported but I have no issue number now.