Issue 97531 - Closing OOo will close multiple documents
Summary: Closing OOo will close multiple documents
Status: CLOSED NOT_AN_OOO_ISSUE
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: OOo 3.0
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: andreas.schluens
QA Contact: issues@framework
URL:
Keywords: needmoreinfo, oooqa
Depends on:
Blocks:
 
Reported: 2008-12-23 11:39 UTC by tobiaskrais
Modified: 2009-07-12 18:34 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description tobiaskrais 2008-12-23 11:39:03 UTC
I have the following strange behaviour:
1. Open a document (e.g. an odt file) via API and then close the
document (only the document, not the OOo frame). Thus an empty OOo frame
remains (in OOo3 the OOo app chooser is loaded in the frame).
2. Open again a document via API. The document is not loaded in the
first frame (I use the "_blank" flag to demonstrate) - a new one is opened. Now
close the remaining frame from
point 1. Closing it will also close our document of point 2!

This does not occur if you open the documents with a file explorer! It
only occurs when opening via API.
Comment 1 Rainer Bielefeld 2008-12-23 11:53:19 UTC
@tobiaskrais:
Please
- specify your Platform and OS
- attach a test kit with sample documents, integrated macros ...
Comment 2 tobiaskrais 2008-12-23 12:06:48 UTC
@rainerbielefeld: Wow, this was fast!
1. All OS. I tested on WinXP and Ubuntu 8.10 with the OpenOffice.org
installation packages.
2. The sample code can be found here:
http://codesnippets.services.openoffice.org/Office/Office.OpenDocumentFromURL.snip

If you need further information, please ask me.
Comment 3 andreas.schluens 2008-12-23 12:17:07 UTC
as->tobias:

Please specify which API calls you used for ...
a) open documents
b) closing documents.
c) Or if you closed such documents manually (mouse click inside UI).

For me it doesnt look like an issue. It looks like you used the wrong set of APIs.
First you should define if you wish to use same "document behaviour" as OOo it
has by default. If the answer is yes you cant use (!) API's like
loadComponentFromURL () or XCloseable.close(). You have to use XDispatch API only !

If you wish to implement your own behaviour ... you must intercept commands like
.uno:CloseDoc/CloseFrame/CloseWin .-.. but you can use loadComponentFromURL() or
XCloseable.close(). Otherwhise "magic" regarding OOo shutdown will disturb your
use case as you described it already. On ther other side ... then you are
responsible to make sure the office will shutdown ... at least in case last
document was closed. Because in such API-use-case it's your job doing that .-)

as->tm: Seems to be my area .-)
Comment 4 tobiaskrais 2008-12-25 09:33:50 UTC
tobiaskrais -> as: Here my answers to your questions:

a) as I wrote to Rainer, I use the following API calls to open a document:
http://codesnippets.services.openoffice.org/Office/Office.OpenDocumentFromURL.snip
(I created the snippet, its exactly my code).

c) For closing I use the UI.

You further explanations are very interesting. I still think it's an issue,
although not a serious one, may be only a very rare use case. One question: may
a OpenOffice.org frame close other frames with documents? I think no. In any case.
Comment 5 andreas.schluens 2009-01-05 11:50:34 UTC
as->tobias:

It's not a bug ... it's how OOo reacts for different user requests. Some user
wish to have stay OOo in memory after last document was closed ... some other
ones wish that OOo shuts down automaticaly if last visible document was closed.

So the following should happen:

a) If you close the last visible frame ... OOo shuts down.
b) If you close the last open document ... but had two views to the same
document ... both views will be closed (means two frames will be closed!) ...
and OOo shuts down.
c) If you close the last document or frame ... but furthermore a help window was
open ... OOo shuts down ... because help was not classified to be a reason not
to shut down .-)

So you see ... closing one frame WILL close other frames if there constellation
was the right one.

The real problem of your issue I can see ... you said:
"1. Open a document (e.g. an odt file) via API and then close the
document (only the document, not the OOo frame). Thus an empty OOo frame
remains (in OOo3 the OOo app chooser is loaded in the frame)."

I cant reproduce that with an actual OOo version. At least not using the UI to
close the document. Such state can be reached only in case API's are used.
Anyway: if such state would be reached it's a bug. An empty frame never should
stay alive. At least our StartModule (you name it App Chooser) should be loaded
into that last open frame.

If you bring the office in such state (empty frame) it's detected as
"superflous" and last REAL document frame will close such superflous frames too.
So I dont see any issue here ... excepting the mentioned "empty frame" ... which
cant be reproduced by me.
Comment 6 tobiaskrais 2009-01-06 10:19:08 UTC
tobiaskrais -> as: OK. I don't reach a superflous frame. Now I understand
better. I set the issue to invalid.
Comment 7 Mechtilde 2009-07-12 18:34:00 UTC
invalid -> closed