Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | Macro Copy Paste does not work from a button | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | App Dev | Reporter: | bmarcelly <marcelly.bernard> | ||||||
Component: | api | Assignee: | marc.neumann | ||||||
Status: | CLOSED FIXED | QA Contact: | issues@api <issues> | ||||||
Severity: | Trivial | ||||||||
Priority: | P3 | CC: | issues | ||||||
Version: | 3.3.0 or older (OOo) | ||||||||
Target Milestone: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Windows XP | ||||||||
Issue Type: | DEFECT | Latest Confirmation in: | --- | ||||||
Developer Difficulty: | --- | ||||||||
Attachments: |
|
Description
bmarcelly
2005-07-06 09:28:43 UTC
Created attachment 27738 [details]
Calc document with two macros started by buttons.
Created attachment 27739 [details]
Ordinary Calc document for use with 2nd button.
Can confirm the first part: copying in the same document. However, copying to another document is working for me (1.9.m113 WinXP). sw->tbe: the first button has no effect and the second copies what is currently in the clipboard, if nothing is in there nothing happens here either. All seems to work fine when the macro are executed via "Tools-Macros". Setting target to OOo2.0.1 since this used to work for example in OOo1.1.4 TBE->FS: The macro is executed in both cases, when pressing the button and via Tools/Macros/Run Macro. But when pressing the button, the executeDispatch() call fails. The reason for that is, that the macro runs in the wrong context. In this case the FmFormShell is on the shell stack. For more details, please ask CD. for the records: workaround: Set the "Take focus in click" property of the button to "No" fixed in CWS dba201c The problem here is that when you click onto the button, it grabs the focus. Now in 2.0, when a form control has a focus, certain actions from the menu/toolbar (for instance cut/copy/paste) are routed to this control, and not to the main document anymore. This makes sense for, for instance, text input fields: You can now operate them via the toolbox. However, it doesn't make sense for buttons (which can just realize that the desired functionality is not available). Speaking very strictly, this is a problem of the macro, since it uses the dispatch API to access cut/copy/paste functionality. The dispatch API is always dependent on the document state, and thus not 100 percent reliable. However, there is no other API for cut/copy/paste, and the macro recorder produces code which uses the dispatch API, so declaring this as "wrong" would not really be a good solution :) Fixed this by not routing cut/copy/paste (and a lot of other functionalities) to the active control, if this active control cannot serve the functionality, anyway. fs-> msc: please verify in CWS dba201d re-open issue and reassign to msc reassign to msc reset resolution to FIXED verified in cws dba201d Hi, this is fixed in the current master. The current master is available at http://download.openoffice.org/680/index.html I close this issue now. Bye Marc |