Robert Vojta wrote: > On Dec 3, 2007 6:50 PM, Mathias Bauer <[EMAIL PROTECTED]> wrote: > >> This only helps for the case where the GUI is used. If a script or any >> other code closed the document or frame directly (through its XCloseable >> interface) it would bypass your interceptor. The XCloseListener is the >> more general and safe approach. > > Thanks for your detailed explanation. I tried it and it works, but > partially ... I would like to prevent the inner document from being > closed too. If I register close listener for the frame, I can prevent > the whole OO.o from being closed, but not a single document window. I > tried to search more on this topic and found your answer from > September 2006. > > <answer> > >> So how do I prevent the inner document window from being closed? > > As I wrote already: > >>> Of course you can't prevent the window from being closed here - in >>> fact you can't do it at all as I have to admit. > > Sorry for the bad news. > > </answer> > > Is your answer still valid? If yes, I have to use Sascha's way even if > there are some limitations you already described.
Yes. But perhaps you can use a combination: use the CloseListeners (at document and frame) for the more general case and the DispatchInterceptor for the ".uno:CloseWin" command. This will leave only one case where your code can be bypassed: when the document in the window is replaced by another one. OOo itself will do this only in one single case: if the document is untitled and unmodified and another document of the same type is loaded. This seems not to be a scenario that will create a problem for you, I assume. Ciao, 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]
