summaryrefslogtreecommitdiff
path: root/sfx2/source/view/viewfrm.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/view/viewfrm.cxx')
-rw-r--r--sfx2/source/view/viewfrm.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index c01974d4ef5c..5434fa6c1add 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -21,6 +21,7 @@
#include <stdio.h>
+#include <svx/fmshell.hxx>
#include <sfx2/infobar.hxx>
#include <sfx2/viewfrm.hxx>
#include <com/sun/star/document/MacroExecMode.hpp>
@@ -866,8 +867,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 )
+ SfxViewShell *pVSh;
+ FmFormShell *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
{