Issue 118965

Summary: InstanceLocker can't usefully stop user closing a document because the frame is closed first
Product: App Dev Reporter: DonJaime <donjaime>
Component: apiAssignee: AOO issues mailing list <issues>
Status: UNCONFIRMED --- QA Contact:
Severity: Normal    
Priority: P3 CC: issues
Version: 3.3.0 or older (OOo)   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Tests InstanceLockers on document and frame and records events in order none

Description DonJaime 2012-02-23 18:17:00 UTC
Created attachment 77242 [details]
Tests InstanceLockers on document and frame and records events in order

When a document is closed from the ui, the frame is closed first, and then the document. If the document close is aborted by throwing an exception (using com.sun.star.embed.InstanceLocker), the document is left in an unusable state since it is no longer attached to a frame and no longer has a controller.

When .Close() is called on the document from the api, the document is closed first. However, the disposed document is still visible in its controller's frame, which can be retained by aborting its close. Trying to do anything with the ghost document causes a crash.

Closing a document should always lead to closing of its controller's frame. The ui should call .Close() on the document, not the frame.

I am entering this under api and not under ui because as long as there is no recourse to the api it doesn't matter what order things happen.