https://bugs.documentfoundation.org/show_bug.cgi?id=170531

--- Comment #2 from Robert Großkopf <[email protected]> ---
Closing a document could also close the whole LO desktop. The origin of the
macro will be closed and there wont be any possibility to give feedback.

I have solved this this way (see ask.libreoffice.org)

SUB Close1
  DIM oDoc AS OBJECT
  oDoc = ThisComponent
  GlobalScope.BasicLibraries.loadLibrary("XRechnung")
  AsyncClose(oDoc)
END SUB

XRechnung library looks like this:

Sub AsyncClose(Byval oDoc As Object)    
CreateUnoService("com.sun.star.awt.AsyncCallback").addCallback(CreateUnoListener("AsyncClose_","com.sun.star.awt.XCallback"),oDoc)
End Sub

Sub AsyncClose_notify(arg) 
    arg.Close True
    oFrames = StarDesktop.Frames
    n = oFrames.Count
    IF n = 0 THEN StarDesktop.Terminate()
End Sub

You could also put this to the default library of the user, but often this
library had been cleaned when switching between different version of LO. So I
have created a separate library.

With this construction the closing of Calc also works with a doubleclick.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to