Issue 46484 - Notify new events OnCreate and OnLoadFinished
Summary: Notify new events OnCreate and OnLoadFinished
Status: CLOSED FIXED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial
Target Milestone: ---
Assignee: marc.neumann
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-01 12:43 UTC by ocke.janssen
Modified: 2013-02-24 21:08 UTC (History)
1 user (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 ocke.janssen 2005-04-01 12:43:45 UTC
Type  	info
Title 	New document events
Posted by 	mathias.bauer@sun.com
Affected 	,-
Effective from 	fwkfinal1


Summary


Two new document events are available now, their API names are "OnCreate" (for
new, empty documents) and "OnLoadFinished" (for documents loaded from a file or
stream). They are sent by every document, regardless if it is opened/created
with or without a view, hidden or visible.
OTOH the "old", well known events "OnNew" and "OnLoad" are sent only for visible
documents and they are sent not before the document has become visible.



Description

In OOo1.x  the "OnNew"/"OnLoad" events where sent asynchronously
(means: a user event was posted that on execution notified all listeners).

So if you open a document via API, modify it and then close it you get
the close event (because it must be sent synchronously) before the
open event (and BTW the document is already gone when you get this
event). We tried to fix this by sending the OnNew/OnLoad events
synchronously, but then they arrived at the listeners before the
document window was shown. Basic macros bound to those events now got
the wrong parent, dialogs asking for input became useless because you
can't see the underlying template etc., so we had to go back to
asychronous notification (the window manager doesn't allow to force a
window to appear on the screen immediately). The API problem can be
fixed only by introducing the new events and declaring the point in
time when the "OnNew/OnLoad" events arrive as undefined (and in case
of our API example they will not arrive at all!).

Any consumer of document events now must decide if it reacts on the
"old" events (that are sent out only for documents that are made
visible) or the "new" events (that are sent out for every created
document, even for hidden or embedded ones or for documents as data
source etc.).

As it looks no code has to be changed because the handling of the
OnNew/OnLoad events now is the same as in OOo1.1.
Comment 1 Frank Schönheit 2006-08-10 10:00:53 UTC
should try to fix this for 2.x, as it's important for scripting OOo.
Comment 2 ocke.janssen 2007-08-10 08:57:15 UTC
Fixed in cws dba24a
Comment 3 Frank Schönheit 2007-09-03 11:10:03 UTC
targeting to 2.4, since the fix is part of a CWS aiming for this release
Comment 4 ocke.janssen 2007-09-03 11:52:45 UTC
Please verify that these event are sent correctly. Thanks.
Comment 5 Frank Schönheit 2007-09-04 07:58:46 UTC
fs-> msc: please verify in CWS dba24a
Comment 6 marc.neumann 2007-09-24 13:26:14 UTC
fixed in CWS dba24a. The new Event "OnLoadFinished" is called.

I wrote a new issue 81894. Because instead of OnLoadFinished the event OnCreate
should called
Comment 7 drewjensen.inbox 2008-03-12 10:29:24 UTC
Tested w/ OOo 2.4 m_10, Kubuntu

closing
Comment 8 clutz 2008-07-09 08:34:59 UTC
changed component to api as this is not restricted to database access and more
api related