Quoting Mathias Bauer <[email protected]>:

[email protected] wrote:
Unfortunately the solution with ".uno:Reload" does not work anymore
since OO.org 3.1 was released. Under Windows I cannot update the
opened document externally because it is locked. I need a workaround
with close and then reopen the document. Is there also a Dispatch API
command for close? I found ".uno:CloseDoc", but it doesn't work as
aspected. Nothing happens when I use ".uno:CloseDoc" instead of
".uno:Reload".

As dispatching this command does the same as choosing "Reload" from the
file menu this would mean that reloading does not work at all?! I
couldn't reproduce that on Windows.

Hi,

The ".uno:Reload" command is not the problem. The problem refers to my extension context. I overwrite an opened document via copy() in java code and then reload the document via API. With OOo 3.1 this is not possible anymore (on windows). So I need to find another solution for that. My idea was to close the doc via dispatch command and then reopen it again (not really a nice solution). I change the code with ".uno:Reload" to ".uno:CloseDoc", but the document does not close.

Code:
final XMultiServiceFactory xMSF = (XMultiServiceFactory) this.
   getXInterface(XMultiServiceFactory.class, this.getXContext().
   getServiceManager().createInstanceWithContext(
     "com.sun.star.lang.MultiServiceFactory", this.getXContext()));

final XDispatchHelper xDispatchHelper = (XDispatchHelper) this.
   getXInterface(XDispatchHelper.class, xMSF.createInstance(
      "com.sun.star.frame.DispatchHelper"));

xDispatchHelper.executeDispatch((XDispatchProvider) this.
   getXInterface(XDispatchProvider.class, this.getXFrame()),
      ".uno:CloseDoc", "", 0, new com.sun.star.beans.PropertyValue[0]);

(getXInterface is a wrapper function for UnoRuntime.query())



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to