Hi Andreas,

If you call registerDispatchProviderInterceptor() the framework will call setMasterDispatchProvider() and setSlaveDispatchProvider().
Do nothing there excepting caching those two dispatch objects.
From this point your interceptor is part of the double-linked interceptor chain.

Note: NULL will be a valid parameter for those master/slave dispatch objects provided to you. Such null value will happen in case you deregister your interceptor ... and the framework creates a new chain without you ...

If you want to handle the request return "this" or any other suitable instance (e.g. a helper object) ... if not forward the request to your slave dispatch ! Master dispatch can be ignored. I've never seen a use case where it was rely needed .-)


I got it partially working by defining my own XDispatchProviderInterception and XDispatch. I can catch ".uno.Save" or ".uno.SaveAs" in my XDispatch, but not ".uno.CloseWin" or ".uno:CloseDoc". I wonder why, because I'm sure I return my own XDispacth for these commands in queryDispatch(). I'm getting a GPF when closing OOo but I believe I can address that.

I adapted Paolo sample to VB, but there is a thing that concernes me, and it seems you are the right person to clarify me why:

Paolo uses the same Dispatch object for every command he wants to catch, but if I do that a strange exception is raised when I move the mouse over the toolbar. By creating a new Dispatch for each command it works, thought they are all the same. Is this the right procedure, an independent Dispatch object for each command?

Also, during queryDispatch processing, right after registerDispatcherProviderInterceptor(), every command URL is called more than once, which means that I'm creating more than a XDispatch object for every command, and when popping up a menu (e.g the File menu) another XDispatch is created for every command entry in that menu.

My (initial) doubts are:

1. When exactly should the Interception be registered? (before loading a document, after loading it, ...)

2. Do I realy need a new XDispatch object for every command I want to catch, even if they are "equal" (the only thing I do in my XDispatch is to raise an event for my use)?

3. Why can't I catch ".uno:CloseWin" or ".uno.CloseDoc" (among others)? do I need to register th Interceptor somewhere else?

4. When calling e.g. "uno.Save" directly (without user interaction) the Interception doesn't work. Is this the intended behaviour?

Thanks a lot,
Carlos


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to