How do I tear down soffice cleanly?

Jens Tröger jens.troeger at light-speed.de
Tue Feb 24 09:41:04 PST 2015


Supporting documentation:

  http://www.openoffice.org/api/docs/common/ref/com/sun/star/util/XCloseable.html
  https://wiki.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/Closing_Documents

I've now used this code:

    if document.supportsService("com.sun.star.util.XCloseable") :        
        document.close(True)                                             
    office.document.dispose()                                                   

Does that look about right?
Jens


On Tue, Feb 24, 2015 at 12:54:16PM +0100, Michael Stahl wrote:
> i think the general idea is to first close all open documents (via
> XClosable::close() - only use XComponent::dispose() if the document does
> not implement XClosable), and then call XDesktop::terminate()

-- 
Jens Tröger
http://savage.light-speed.de/


More information about the LibreOffice mailing list