Apache OpenOffice (AOO) Bugzilla – Issue 67068
Services ActionTrigger and ActionTriggerContainer don't implement XTypeProvider
Last modified: 2013-02-24 21:07:18 UTC
Hi, 1. implement a com.sun.star.ui.XContextMenuInterceptor 2. register yourself at the controller of a OOoDraw-Document 3. handle the context menu event: access com.sun.star.ui.XContextMenuInterceptor.ActionTriggerContainer and create a com.sun.star.ui.ActionTrigger or com.sun.star.ui.ActionTriggerContainer with createInstance (XMultiServiceFactory of ActionTriggerContainer) 4. now check com.sun.star.ui.ActionTrigger against the interfaces - XPropertySet (not null) - XTypeProvider (null in Java!) - XServiceInfo (not null) 5. now check com.sun.star.ui.ActionTriggerContainer against the interfaces - XPropertySet (null in Java!) - XTypeProvider (null in Java!) - XServiceInfo (not null) My understand of services was that EVERYONE must implement XTypeProvider in order to be usable with OOoBasic. It is a fact that OOoBasic seems to be able to use the above services partially. I will attach a OOoDraw-document containing a macro for demonstration. If you try a similar code with Java you'll see that queryInterface to XTypeProvider returns null for the both services. Actually I found an OOoBasic-example for handling context menus. This example doesn't use the factory methods of the ActionTriggerContainer but use the global service "com.sun.star.ucb.Store". (See: http://codesnippets.services.openoffice.org/Office/Office.ContexMenuInterceptor.snip) btw.: The problem occurs also with OOo1.1.5, SO7 PP4, SO8 PP3. bye Mathias
Created attachment 37541 [details] The promised demo OOoBasic packed within a OOoDraw-document
jsc -> cd: seems to be one for you
cd: Set target and accepted.
set target from 2.x to 3.x according to http://wiki.services.openoffice.org/wiki/Target_3x
Created attachment 77196 [details] Corrected attachment demonstrating missing interfaces The original attachment threw an error because it tried to use .Dbg_SupportedMethods, which doesn't exist. This corrected version shows Dbg_Methods and Dbg_SupportedInterfaces of the objects, demonstrating that most of the interfaces/methods are missing. In particular, the lack of support for XIndexAccess on the ActionTriggerContainer service makes it impossible to add items to a sub-menu.
Created attachment 77200 [details] Draw document with sample AOO Basic code
Fixed in revision 1242336
@DonJaime : Apache OpenOffice 3.4 has been released. Could you please verify this issue is solved in the current release? You can download Apache OpenOffice from http://www.openoffice.org/download Thanks in advice.
Lovely! Working sub-menus in context menus. Thank-you.
(In reply to comment #9) > Lovely! Working sub-menus in context menus. Thank-you. Thanks for verifying. Closing issue.