summaryrefslogtreecommitdiff
path: root/sfx2/source/view/viewfrm.cxx
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2014-08-27 18:34:02 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-09-01 03:20:52 -0500
commit15cea073e7ed4970e60967fe036fc492e2052203 (patch)
treebe449340f060b94428221538b64b0a290509aec6 /sfx2/source/view/viewfrm.cxx
parentc369013edb76cd47ef7e8c193a18a57ff165ddfb (diff)
fdo#44081 don't remove 'edit' pop-up menu entry from form in design mode
Change-Id: I9700d0d729a8f2d1255fcd03a07e05799e21f8d0 Reviewed-on: https://gerrit.libreoffice.org/11152 Reviewed-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr> Tested-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
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
{