Mathias Bauer wrote: > Marc Santhoff wrote: > >> Am Freitag, den 26.05.2006, 17:51 +0200 schrieb Mathias Bauer: >>> Marc Santhoff wrote: >>> >>> >> The recreation of the view is a little bit tricky because the necessary >>> >> API currently does not exist (it's in the making though). >>> > >>> > As far as it works, it's okay with me. :) Do you know an issue number >>> > for watching progress on this topic? >>> >>> No, but it will be announced in interface.announce once it's done. >>> We wanted to introduce the new API together with adding the new UNO >>> features to our models (multiple inheritance interfaces, new style >>> service with constructors) but it turned out to be more work than expected. >> >> I'm looking forward to that. >> >> But the next question is already here: >> >> Is there any way to prevent closing from BASIC? The XCloseListener is >> expected to throw an exception which is not possible from BASIC, afaik. > > In OOO 2.0.3 we have a solution for this IIRC. I have to look it up, > don't remember it exactly. But as 2.0.3 isn't available yet I think > waiting until monday is bearable. :-) > > In the worst case it would be simple to add a small C++ or Java > component to a package of macros that takes over the task to lock > documents from basic.
A mail was sent to the intefacer-announce ML but until now didn't appear. Here's the content: "To allow to lock an object supporting ::com::sun::star::util::XCloseable or ::com::sun::star::frame::XDesktop using a bridge that does not support exceptions a new service ::com::sun::star::embed::InstanceLocker was implemented. After creation the service adds a listener of requested type ( close or terminate ) to the controlled object and let the listener throw related veto exception until the service is disposed. It is also possible on initialization to provide an object that will be requested for approval before throwing the veto exception. This object could be useful in case the service is instantiated from another process, so that in case the communication with the process is broken the approval object is not accessible and the locked object does not stay locked forever. Please take a look in com/sun/star/embed/InstanceLocker.idl for details." As you can see you only need to instantiate a service that "locks" the document as long as it is alive. In Basic you can use a global variable for it. But be careful: you must guarantee that the lock won't exist until eternity, otherwise OOo will never terminate and must be killed. The same is true if you implement a CloseListener in Java and always throw an exception. Best regards, Mathias -- Mathias Bauer - OpenOffice.org Application Framework Project Lead Please reply to the list only, [EMAIL PROTECTED] is a spam sink. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
