diff options
author | Muthu Subramanian <sumuthu@novell.com> | 2011-04-20 10:03:37 +0530 |
---|---|---|
committer | Muthu Subramanian <sumuthu@novell.com> | 2011-04-20 10:05:32 +0530 |
commit | 44b39fb4da9efa4db11b9185fc084e6b4fbd339d (patch) | |
tree | 645a6f5d193695ae5d90987f20cb36f29270469f /sw/source/ui/uno | |
parent | 90877fcb24fd9af9ad9e2661b8f1149a7b65a8e8 (diff) |
n#681746 - OLE crash fix.
Initialize object completely, otherwise init
would be triggered during dispose(). There could
be better ways to fix this.
Diffstat (limited to 'sw/source/ui/uno')
-rw-r--r-- | sw/source/ui/uno/unotxdoc.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index a48988c65d08..da73b0a969b0 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -1354,10 +1354,13 @@ Reference< drawing::XDrawPage > SwXTextDocument::getDrawPage(void) throw( Runti throw RuntimeException(); if(!pxXDrawPage) { - // simplified this creation, keeping original below as reference - // for the case that it did something by purpose ((SwXTextDocument*)this)->pDrawPage = new SwXDrawPage(pDocShell->GetDoc()); ((SwXTextDocument*)this)->pxXDrawPage = new Reference< drawing::XDrawPage >(pDrawPage); + // Create a Reference to trigger the complete initialization of the + // object. Otherwise in some corner cases it would get initialized + // at ::InitNewDoc -> which would get called during + // close() or dispose() -> n#681746 + uno::Reference<lang::XComponent> xComp( *pxXDrawPage, uno::UNO_QUERY ); } return *pxXDrawPage; } |