-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

i tried to implement a XDispatchProviderInterceptor class but my
attemps always lead to an office crash :-( ...

Can one provide an example, please ?

I did:

public class DispatchInterceptorDemo implements
        com.sun.star.frame.XDispatchProviderInterceptor {

[...]

    com.sun.star.frame.XDispatchProvider xMaster = null;
    com.sun.star.frame.XDispatchProvider xSlave = null;

    Object desktop = xRemoteServiceManager.createInstanceWithContext(
            "com.sun.star.frame.Desktop", xRemoteContext);

     com.sun.star.frame.XDesktop xDesktop = (com.sun.star.frame.XDesktop) 
UnoRuntime
                    .queryInterface(com.sun.star.frame.XDesktop.class, desktop);

     com.sun.star.frame.XFrame xFrame = xDesktop.getCurrentFrame();

     com.sun.star.frame.XDispatchProviderInterception xDispatchInterceptor = 
null;

      xDispatchInterceptor = (com.sun.star.frame.XDispatchProviderInterception) 
UnoRuntime
                    
.queryInterface(com.sun.star.frame.XDispatchProviderInterception.class,  
xFrame);

      xDispatchInterceptor.registerDispatchProviderInterceptor(this);

[...]

    public XDispatchProvider getMasterDispatchProvider() {
            return xMaster;
    }

    public XDispatchProvider getSlaveDispatchProvider() {
        return xSlave;
    }

    public void setMasterDispatchProvider(XDispatchProvider arg0) {
            System.out.println("-setMasterDispatchProvider()");
            xMaster = arg0;
    }

    public void setSlaveDispatchProvider(XDispatchProvider arg0) {
           System.out.println("-setSlaveDispatchProvider()");
           xSlave = arg0;
    }

    public XDispatch queryDispatch(URL arg0, String arg1, int arg2) {

         System.out.println("-queryDispatch: " + arg0.Complete + " " + arg1
                    + " " + arg2);

        if (xSlave != null)
            return xSlave.queryDispatch(arg0, arg1, arg2);
        return null;
    }

    public XDispatch[] queryDispatches(DispatchDescriptor[] arg0) {
        return null;
    }

I connected to an OO Calc document and could see on my
debugging console

- -register dispatchinterceptor....
- -setMasterDispatchProvider()
- -setSlaveDispatchProvider()
- -queryDispatch: .uno:StatusDocPos  0
- -queryDispatch: .uno:StatusPageStyle  0
- -queryDispatch: .uno:Zoom  0
- -queryDispatch: .uno:InsertMode  0
- -queryDispatch: .uno:StatusSelectionMode  0
- -queryDispatch: .uno:ModifiedStatus  0
- -queryDispatch: .uno:Signature  0
- -queryDispatch: .uno:Position  0
- -queryDispatch: .uno:Size  0
- -queryDispatch: .uno:StateTableCell  0
- -queryDispatch: .uno:StatusBarFunc  0

now all toolbars are disabled, if i try to open the menu oo crashes
with an "abnormal program termination" (soffice.bin)

any hints ?

Oliver
- --

GnuPG key 0xCFD04A45: 8822 057F 4956 46D3 352C 1A06 4E2C AB40 CFD0 4A45
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGkQb9TiyrQM/QSkURAqDxAJ9fw0LUkNOvgQ9hY4dHJpD0YjseNgCgl5o5
jtX5nCai9xIx7Hxv63YRXHM=
=k0j2
-----END PGP SIGNATURE-----

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

Reply via email to