Issue 57748

Summary: StarDesktop.terminate()
Product: App Dev Reporter: jer57 <jerome.fritz>
Component: apiAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues, krzysiek-openoffice.org
Version: 3.3.0 or older (OOo)   
Target Milestone: ---   
Hardware: Sun   
OS: Solaris   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
bugdoc to reproduce the crash
none
Writer document with macro which quits OpenOffice upon load none

Description jer57 2005-11-11 15:37:50 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?
Comment 1 stephan.wunderlich 2005-11-21 11:32:32 UTC
Created attachment 31667 [details]
bugdoc to reproduce the crash
Comment 2 stephan.wunderlich 2005-11-21 11:37:21 UTC
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.
Comment 3 Mathias_Bauer 2006-09-28 11:17:30 UTC
.
Comment 4 klichota 2007-06-10 10:01:03 UTC
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).
Comment 5 klichota 2007-06-10 10:03:37 UTC
Created attachment 45776 [details]
Writer document with macro which quits OpenOffice upon load
Comment 6 klichota 2007-06-10 10:09:04 UTC
Confirmed also on OpenOffice 2.2.1 and Kubuntu Gutsy (7.10).
Comment 7 Marcus 2017-05-20 11:27:30 UTC
Reset assigne to the default "issues@openoffice.apache.org".