openoffice-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steele, Raymond" <>
Subject RE: EXTERNAL: Re: soffice process still running
Date Tue, 07 May 2013 16:25:57 GMT

Thank you for the quick response.   I have narrowed the continued process down to a component.
 However, the behavior is strange because I am not really opening the component in my code.
My code opens a document using XComponentLoader::loadComponentFromURL(). I set the "Hidden"
property to true so the user cannot see it.   The document that is open contains Dynamic Data
Exchange (DDE) links to another closed document. The code then uses XRefreshable interface
to refresh all the DDE links found in XIndexAccess.  Lastly, I export the document using the
"ODF Spreadsheet" / "calc8" filter name using XStore::storeToURL(). For some reason, this
whole process opens (hidden) the other document to which the document I am refreshing contains
DDE links to, even though I do not explicitly open it. Strange. 

In my original query, I did not want to close documents that were not opened by my application.
(i.e. the user opens it by clicking on the OpenOffice desktop icon).   My solution to this
point for this issue is: if XEnumeration does have more elements, I create an enumeration
from XEnumerationAccess, loop through it,  get the XComponent interface and XModel for each
element, and XClose::close() the component if the XModel::getURL() matches a specific URL
to the implicitly opened document. Lastly, if the enumeration does not have any more elements,
I terminate the desktop. All of this prevents my application from inadvertently closing any
documents that were not opened by my application.  

Do you have any insight to this behavior or recommendations?

Thanks Again!


-----Original Message-----
From: Ariel Constenla-Haile [] 
Sent: Monday, May 06, 2013 5:17 PM
Subject: Re: EXTERNAL: Re: soffice process still running

Hi Raymond,

On Mon, May 06, 2013 at 08:14:17PM +0000, Steele, Raymond wrote:
> Ariel,
>  I am having a case were the process continues to run. I appears the  
> the EnumerationAccess does have elements, causing the desktop not to  
> terminate. Is there a way to terminate a specific desktop that was  
> not last open, and not close other desktops?

Do you know what component is still alive? If I recall clearly, you didn't want to close all
other documents in the first time, but simply terminate the office when all documents have
been closed.

This enumeration contains all components that where opened using the application framework,
if this component is keeping the desktop alive, you have to close/dispose it. But then, you
face your original problem:
you don't want to close documents that are still open. So, first, investigate which is the
component that is keeping the office alive:

> if (!xEnumerationAccess.hasElements()) {
>     xDesktop.terminate();

Replace this with an if ... else ...
If the enumeration has elements, iterate over them, see if they support css.lang.XServiceInfo,
and print information about the component; this may get you some hint about that last component.

Ariel Constenla-Haile
La Plata, Argentina

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message