diff options
Diffstat (limited to 'sw/source/core/doc/docnew.cxx')
-rw-r--r-- | sw/source/core/doc/docnew.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 882719e4060b..9ebd79715114 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -677,13 +677,20 @@ void SwDoc::SetDocShell( SwDocShell* pDSh ) } mpLinkMgr->SetPersist( mpDocShell ); + if( GetDocumentDrawModelManager().GetDrawModel() ) { - ((SwDrawDocument*)GetDocumentDrawModelManager().GetDrawModel())->SetObjectShell( mpDocShell ); + GetDocumentDrawModelManager().GetDrawModel()->SetObjectShell( mpDocShell ); GetDocumentDrawModelManager().GetDrawModel()->SetPersist( mpDocShell ); OSL_ENSURE( GetDocumentDrawModelManager().GetDrawModel()->GetPersist() == GetPersist(), "draw model's persist is out of sync" ); } + + // set DocShell pointer also on DrawModel + InitDrawModelAndDocShell(mpDocShell, GetDocumentDrawModelManager().GetDrawModel()); + OSL_ENSURE(!GetDocumentDrawModelManager().GetDrawModel() || + GetDocumentDrawModelManager().GetDrawModel()->GetPersist() == GetPersist(), + "draw model's persist is out of sync"); } } |