diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2009-11-20 15:30:25 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2009-11-20 15:30:25 +0100 |
commit | ac9a1cd44c34c7692b5c0ffb36f21d42420e80a7 (patch) | |
tree | c46377b27a28c688b687c2ffc029d00b7108f10e /sd/source | |
parent | d78e19009f4cc8af969da61b3e35ac6c6527231d (diff) |
[CWS autorecovery] introduced status SfxFrame::InsertDocument which encapsulates a usage pattern comprised of the old InsertDocument/CreateViewFrame pair
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/app/sdmod1.cxx | 50 |
1 files changed, 8 insertions, 42 deletions
diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index 4144b4afb774..8f27f8cadf59 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -305,13 +305,8 @@ void SdModule::OutlineToImpress (SfxRequest& rRequest) } SFX_REQUEST_ARG( rRequest, pFrmItem, SfxFrameItem, SID_DOCFRAME, FALSE); - if ( pFrmItem ) - { - SfxFrame* pFrame = pFrmItem->GetFrame(); - pFrame->InsertDocument( pDocSh ); - } - else - SfxViewFrame::CreateViewFrame(*pDocSh, ::sd::OUTLINE_FACTORY_ID); + SfxFrame* pFrame = pFrmItem ? pFrmItem->GetFrame() : NULL; + SfxFrame::InsertDocument( *pDocSh, pFrame, ::sd::OUTLINE_FACTORY_ID ); ::sd::ViewShell* pViewSh = pDocSh->GetViewShell(); @@ -555,17 +550,8 @@ SfxFrame* SdModule::CreateFromTemplate( const String& rTemplatePath, SfxFrame* p } else if( pDocShell ) { - if ( pTargetFrame ) - { - pFrame = pTargetFrame; - pFrame->InsertDocument( pDocShell ); - } - else - { - SfxViewFrame* pViewFrame = SfxViewFrame::CreateViewFrame( *pDocShell ); - if( pViewFrame ) - pFrame = pViewFrame->GetFrame(); - } + pFrame = pTargetFrame; + SfxFrame::InsertDocument( *pDocShell, pFrame ); } return pFrame; @@ -694,19 +680,8 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq ) SfxObjectShell* pShell = xShell; if( pShell ) { - if ( pTargetFrame ) - { - pFrame = pTargetFrame; - pFrame->InsertDocument( pShell ); - pViewFrame = pFrame->GetCurrentViewFrame(); - } - else - { - pViewFrame = SfxViewFrame::CreateViewFrame( *pShell ); - if( pViewFrame ) - pFrame = pViewFrame->GetFrame(); - } - + pFrame = pTargetFrame; + pViewFrame = SfxFrame::InsertDocument( *pShell, pFrame ); DBG_ASSERT( pViewFrame, "no ViewFrame!!" ); if(bNewDocDirect && !bStartWithTemplate) @@ -810,17 +785,8 @@ SfxFrame* SdModule::CreateEmptyDocument( DocumentType eDocType, SfxFrame* pTarge pDoc->StopWorkStartupDelay(); } - if ( pTargetFrame ) - { - pFrame = pTargetFrame; - pFrame->InsertDocument( pNewDocSh ); - } - else - { - SfxViewFrame* pViewFrame = SfxViewFrame::CreateViewFrame( *pNewDocSh ); - if( pViewFrame ) - pFrame = pViewFrame->GetFrame(); - } + pFrame = pTargetFrame; + SfxFrame::InsertDocument( *pNewDocSh, pFrame ); } return pFrame; |