Apache OpenOffice (AOO) Bugzilla – Issue 18874
Buttons (assigned macros) don't work after loadComponentFromUrl()
Last modified: 2013-02-24 21:09:13 UTC
Is this where 'form' (i.e. buttons, macros etc.) issues get put? I could not find anything else that seemed remotely correct, this seemed the closest, so feel free to shunt this to the correct spot. I have a document with buttons, and macros assigned to those buttons. When you open the document normally, and click the buttons, everything happens very happily. But when the document is opened via loadComponentFromURL from my java program, (my program uses the document as a template), when the buttons are clicked nothing happens. It works fine in OOo1.0.3, but not OOo1.1RC3 I can still select the macros from the Tools->Macros->Macro menu, and they run as they should, but not from the click of a button. If I right click on the button (in edit mode) and look at it's event assignments, onrelease (or whatever it is) has the correct value. I've got my Spreadsheet file, if anyone wants me to email it to them. thanks - Jonathon
Created attachment 8916 [details] the file I open with loadComponentFromURL that has buttons
Changed component to spreadsheet.
Hi Lisa, this is an Issue for the API team. So I set the flags and reassign it to the owner of the API component. Bets regards Frank
Works perfectly for me. Maybe you forgot to set the MacroExecutionMode in the arguments (MediaDescriptor) of loadComponentFromURL() properly? It does not work via UI either, if the directory is not in the list of safe directories and you answer the upcoming dialog not to execute macros.
back to reporter
loadComponentFromURL doesn't bring up a 'execute macros?' dialog box. it does if I open the file manually, and I can add the path to the path list etc. But when I go loadComponentFromURL no such dialog pops up. (the path isn't already in the list) (If the path is in the list, it doesn't make any difference, the macros won't execute at a button push; of course files opened manually again work fine) This would mean that it isn't realising that the document has macros (wouldn't it?) when loaded via loadComponentFromURL My program is written in Java, and the load code is as follows. PropertyValue [] szArgs = new PropertyValue [1]; szArgs[0] = new PropertyValue(); szArgs[0].Name = "AsTemplate"; szArgs[0].Value = new Boolean(asTemplate); XComponent xComponent = oCLoader.loadComponentFromURL(path, "_blank", 0, szArgs ); it could be a java bug. The frustration is of course that it works fine with OOo1.0.3. Which would be ok, we'd just use that, except that 1.0.3 has a bug stopping the registration of certain java components. thanks for your time. Lisa
I've been playing around with this issue a bit more. All the macro's that my buttons were referring to, are in the document itself. I've shifted the macros from the document, and into the openoffice.standard location, and now they work. Lisa.
You were right regarding Macro Execution mode, It seems there was a change between OOo 1.0 and 1.1 that I was not aware of. Here is a link that clarifies the issue http://www.openoffice.org/servlets/ReadMsg?msgId=782516&listName=dev I am satisfied that this issue is now closed.
Could you verify this issue with a newer version of OOo? Or does it disappear? If so: Could you close this issue, please?
It is fixed and can be closed.
closed