Apache OpenOffice (AOO) Bugzilla – Issue 57748
StarDesktop.terminate()
Last modified: 2017-05-20 11:27:30 UTC
I am facing an issue with StarDesktop.terminate() . I would like indeed from the command line on unix starting an OpenOffice session, and opening a document at the same time. [/opt/openoffice.org2.0/program]$ ./soffice /tmp/test1.ods This document is a calc document, and I assigned to it a macro for the event open document. Purpose of that macro is to save the ods document in html, and then close it and exit Open Office. I use commands document.close(true) to close the document and StarDesktop.terminate() to terminate soffice, but the soffice program crashed on exit. sub record_html1 rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document rem document = ThisComponent.CurrentController.Frame document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") rem ---------------------------------------------------------------------- dim args1(2) as new com.sun.star.beans.PropertyValue args1(0).Name = "URL" args1(0).Value = "file:///tmp/test_graph.html" args1(1).Name = "FilterName" args1(1).Value = "HTML (StarCalc)" args1(2).Name = "SelectionOnly" args1(2).Value = true dispatcher.executeDispatch(document, ".uno:SaveAs", "", 0, args1()) rem document.dispose() wait 2000 document.close(true) wait 2000 StarDesktop.terminate() Is it a bug or should I use another command to quit the application?
Created attachment 31667 [details] bugdoc to reproduce the crash
you can't close the office as long as basic is running and therefore you can't close it from Basic. sw->mba: Anyway I think we shouldn't crash when Document.close() is called. I've attached a document that contains a macro which just shows a messagebox and afterwards tries to close the document. When calling it via ./soffice <path to the document>/boomOnLoad.ods the office crashes as soon as the dialog is confirmed.
.
I have the same problem with Writer, using dispatcher to run quit command: dispatcher.executeDispatch(document, ".uno:Quit", "", 0, args1) I have tested it using OpenOffice.org 2.0.2 on Kubuntu Dapper (6.06).
Created attachment 45776 [details] Writer document with macro which quits OpenOffice upon load
Confirmed also on OpenOffice 2.2.1 and Kubuntu Gutsy (7.10).
Reset assigne to the default "issues@openoffice.apache.org".