https://bugs.documentfoundation.org/show_bug.cgi?id=158862

--- Comment #9 from Mike Kaganski <[email protected]> ---
FTR: an example how this works is in SfxFrameLoader_Impl::load [1], which
employs the Frame-Controller-Model Paradigm [2] [3]. In line 707, it creates an
instance of the class (e.g., "com.sun.star.text.TextDocument"); then it either
calls its attachResource (ln 713), or load (ln 720), to actually create/load
the document.

Before calling these, the object is not properly initialized. Possibly the most
correct is to have a check in the beginning of the UNO methods implementations,
that would check if the doc is, and throw NotInitializedException [4] if it is
not.

[1]
https://opengrok.libreoffice.org/xref/core/sfx2/source/view/frmload.cxx?r=789a737a#706
[2]
https://wiki.documentfoundation.org/Documentation/DevGuide/Office_Development#Frame-Controller-Model_Paradigm_in_LibreOffice
[3]
https://wiki.documentfoundation.org/Documentation/DevGuide/Office_Development#Getting_Frames%2C_Controllers_and_Models_from_Each_Other
[4]
https://api.libreoffice.org/docs/idl/ref/exceptioncom_1_1sun_1_1star_1_1lang_1_1NotInitializedException.html

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to