Hi Mikhail! Yes, you're right. It was a matter of brain usage ... ;)
Am Dienstag, den 09.10.2007, 11:41 +0200 schrieb Mikhail Voitenko: > Hi Marc, > > The approved action here is "prevent closing". So if TRUE is returned, > the closing of the current document model should be prevented. And it is. That exactly was the cause of a hanging office process after the office was closed by me. I only didn't identify it because I had done some other things leaving a process active sometimes. If don't do this dangerous actions in parallel the process holding the modell stays in memory. So holding a reference to a not closable model *does work*. > But it looks like locking of the model does not prevent closing of the > frame. Please try to register the InstanceLocker on the frame. Yes, if I do exchange the model for the frame I does work as expected, the frame stays open as it should. So this works, too. :) Many thanks for helping out and waking me up, Marc > Regards, > Mikhail. > > Marc Santhoff wrote: > > Hello Mikhail, > > > > Am Montag, den 08.10.2007, 14:53 +0200 schrieb Mikhail Voitenko: > >> Hi Marc, > >> > >> This is a bug, I have just submitted an issue to myself. It is going to > >> be fixed in OOo2.4 currently. Please use the following link to find the > >> issue. > >> http://www.openoffice.org/issues/show_bug.cgi?id=82393 > > > > Thanks for information and filing that one. :) > > > > I read the issues text as "if all three parameters are available it > > should work". So I tried: > > > > <BASIC> > > global doc as object > > global lck as object > > > > sub testLocker > > doc = ThisComponent > > oCB = CreateUnoListener("my_", "com.sun.star.embed.XActionsApproval") > > args() = Array( CreateUnoValue("any", doc), _ > > CreateUnoValue("any", 1), _ > > oCB _ > > ) > > psm = GetProcessServiceManager() > > lck = > > psm.createInstanceWithArguments("com.sun.star.embed.InstanceLocker", args()) > > end sub > > > > function my_approveAction(nAction as long) as boolean > > 'msgbox "Ping!" > > my_approveAction = FALSE > > end function > > > > sub ReleaseLock > > if NOT IsNull(lck) then lck.dispose() > > end sub > > </BASIC> > > > > And indeed the "Ping!" appeared, but after clicking away this message > > the writer doc was closed. Is there another error or did I fail in > > handing over the approve listening function? > > > > (I did test returning TRUE in the listening callback to be sure, no > > change) > > > > TIA, > > Marc > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
