[email protected] wrote: > 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.
I don't understand why closing doesn't work, but maybe there's a workaround. Obviously the lock of the document causes the problem. so perhaps switching the document to readonly mode can help: please try to first dispatch ".uno:EditDoc" (this should switch the document to readonly mode) and then overwrite the document, then dispatch ".uno:Reload" and then ".uno:EditDoc" again. If the code works as expected, switching to readonly mode and back should not cause any further reloads, maybe some toolbar flickering possible. BTW: the missing lock was a bug in OOo3.0, so basically your code worked just by luck because of this bug. In general you can't assume that an application does not lock a file that it has opened for editing. Regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to "[email protected]". I use it for the OOo lists and only rarely read other mails sent to it. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
