Re: [dev] Instance of soffice.bin remains running after closing OOo

2010-12-08 Thread Mikhail Voytenko

Hi Jan,

hm, that sounds strange, I see no difference between a new document and 
a loaded one in this context.


It is hard for me to say what goes wrong here without debugging. Would 
it be possible for you to provide a small testcase that allows to 
reproduce the problem?


Thanks,
Mikhail.

On 12/07/10 17:09, Jan private wrote:

Hello Mikhail,

  

please try to send .uno::CloseWin dispatch request to the frame of
the background.odt document to close the document as an experiment.



I think you mean .uno:CloseWin dispatch request.

I inserted this code:

ReferenceXDispatchHelper
xDispatchHelper(mxMCF-createInstanceWithContext(OU(com.sun.star.frame.DispatchHelper),
 mxCC), UNO_QUERY_THROW);
 
// xMaster has the XModel of background.odt

ReferenceXDispatchProvider
xDispatchProvider(xMaster-getCurrentController()-getFrame(),
UNO_QUERY_THROW);

xDispatchHelper-executeDispatch(xDispatchProvider, OU(.uno:CloseWin),
OU(), 0, SequencePropertyValue());

The code is executed and I also checked that both References actually
exist. This works if I load a new document instead of myDocument.odt
(Untitled.odt). After closing Untitled.odt I get the generic Openoffice
interface (which lets you choose to open a new Text Document,
Spreadsheet, etc.) . After closing that, there is no soffice.bin process
left over. 


But if I load myDocument.odt there is no change from my previous post
(no documents visible but process remains running).

Same thing happens if I use .uno:CloseDoc

Using both CloseWin and CloseDoc crashes after closing background.odt

Any more ideas?

Thanks,
Jan



  




Re: [dev] Instance of soffice.bin remains running after closing OOo

2010-12-08 Thread Larry Kerr
I wish that if the api is running that it refresh what your working on or was 
working on.  What a hassle to try to open a doc and have it tell me 'Api 
already running'  and show nothing of the api or the doc!  
  - Original Message - 
  From: Jan privatemailto:jrheinlaen...@gmx.de 
  To: Mikhail Voytenkomailto:mikhail.voyte...@oracle.com 
  Cc: devmailto:dev@openoffice.org 
  Sent: Tuesday, December 07, 2010 8:09 AM
  Subject: Re: [dev] Instance of soffice.bin remains running after closing OOo


  Hello Mikhail,

   please try to send .uno::CloseWin dispatch request to the frame of
   the background.odt document to close the document as an experiment.

  I think you mean .uno:CloseWin dispatch request.

  I inserted this code:

  ReferenceXDispatchHelper
  
xDispatchHelper(mxMCF-createInstanceWithContext(OU(com.sun.star.frame.DispatchHelper),
 mxCC), UNO_QUERY_THROW);
   
  // xMaster has the XModel of background.odt
  ReferenceXDispatchProvider
  xDispatchProvider(xMaster-getCurrentController()-getFrame(),
  UNO_QUERY_THROW);

  xDispatchHelper-executeDispatch(xDispatchProvider, OU(.uno:CloseWin),
  OU(), 0, SequencePropertyValue());

  The code is executed and I also checked that both References actually
  exist. This works if I load a new document instead of myDocument.odt
  (Untitled.odt). After closing Untitled.odt I get the generic Openoffice
  interface (which lets you choose to open a new Text Document,
  Spreadsheet, etc.) . After closing that, there is no soffice.bin process
  left over. 

  But if I load myDocument.odt there is no change from my previous post
  (no documents visible but process remains running).

  Same thing happens if I use .uno:CloseDoc

  Using both CloseWin and CloseDoc crashes after closing background.odt

  Any more ideas?

  Thanks,
  Jan




  -
  To unsubscribe, e-mail: 
dev-unsubscr...@openoffice.orgmailto:dev-unsubscr...@openoffice.org
  For additional commands, e-mail: 
dev-h...@openoffice.orgmailto:dev-h...@openoffice.org



Re: [dev] Instance of soffice.bin remains running after closing OOo

2010-12-06 Thread Mikhail Voytenko

Hi Jan,

please try to send .uno::CloseWin dispatch request to the frame of the 
background.odt document to close the document as an experiment.


This request is triggered when you click with the mouse to close the 
document window. It checks whether there are other frames that prevent 
termination and terminate the office if necessary. The problem is that 
your extension seems to close background.odt too late, when the UI 
part has already done its work. In this case the code that closes the 
last document is responsible to terminate the office. So the easiest way 
would be to just use the dispatch request to close the remaining 
background.odt as well.


Thus, if I understood the scenario correctly, the dispatch request 
should let the office be terminated in this scenario.


Hope that helps.

Best regards,
Mikhail.

On 12/03/10 19:15, Jan Rheinländer wrote:

Hello Mikhail,

sorry for the delay. I was away without internet access for a while.

  
I am not quite sure what do you mean with destructor of the extension. 


The extension is defined as a class
class iMath : public cppu::WeakImplHelper6

XDispatchProvider,
XDispatch,
XInitialization,
XServiceInfo,
XDialogEventHandler,
XContainerWindowEventHandler
  
{ ... }

and I am using the constructor to initialize the extension and the
destructor to clean up (e.g. close background.odt)

  
Are you sure that the code that should close the document is called? 


Yes

  

And if it is called, do you get any exception from the close() call?


no, I put it in a try { ... } catch (Exception e) { ... } block but
nothing comes up.

Some more detail:
1. I open a document e.g. by calling openoffice.org -writer
myDocument.odt
2. The extension automatically loads background.odt (code see initial
posting)
3. I close myDocument.odt (manually by clicking with the mouse)
4. The destructor of the extension is called automatically, and the
close() executed for background.odt

Back at the command line, ps -eaf lists a running
/usr/lib/openoffice/program/soffice.bin -writer myDocument.odt .
-splash-pipe=5
which needs to be killed manually to terminate.

I tried some other stuff: If I load background.odt in the foreground,
then close it manually by clicking with the mouse, then close
myDocument.odt, the problem disappears. 


If I insert the code to close background.odt somewhere else (e.g.
activated by a menu item in the extension), the problem disappears

Maybe the iMath destructor is the wrong place to close background.odt?
If yes, what is the right place? And what about the constructor?

Thanks for any ideas
Jan





  




[dev] Instance of soffice.bin remains running after closing OOo

2010-11-08 Thread Jan private
Hi,

my extension loads a document in the background:

Reference  XComponentLoader  xComponentLoader(
mxMCF-createInstanceWithContext(OU(com.sun.star.frame.Desktop ),
mxCC), UNO_QUERY_THROW);
  Sequence PropertyValue  args(2);
  PropertyValue hidden;
  hidden.Name = OU(Hidden);
  hidden.Value = makeAny(true); 
  args[0] = hidden;
  PropertyValue ro;
  ro.Name = OU(ReadOnly);
  ro.Value = makeAny(true); 
  args[1] = ro;
  xMaster = Reference XModel(
xComponentLoader-loadComponentFromURL(docURL, 
OU(_default), 0, args), UNO_QUERY_THROW);

In the destructor of the extension, the document is closed again:

Reference XCloseable  xCloseable(data[docURL]-xMaster, UNO_QUERY);
xCloseable-close(false);

But when I close the main OOo window an instance of soffice.bin remains
running. This does not happen if I comment out the code which loads the
background document.

Thanks,
Jan



-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org