diff options
Diffstat (limited to 'sfx2/source/view/viewfrm.cxx')
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 33e7d4c6d10a..9cb15a0f1444 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -859,8 +859,15 @@ void SfxViewFrame::StateReload_Impl( SfxItemSet& rSet ) { case SID_EDITDOC: { - if ( !pSh || !pSh->HasName() || !( pSh->Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) - || pSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) + const SfxViewShell *pVSh; + const SfxShell *pFSh; + if ( !pSh || + !pSh->HasName() || + !( pSh->Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) || + ( pSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED && + ( !(pVSh = pSh->GetViewShell()) || + !(pFSh = pVSh->GetFormShell()) || + !pFSh->IsDesignMode()))) rSet.DisableItem( SID_EDITDOC ); else { |