[Libreoffice-commits] core.git: include/sfx2 sc/source sfx2/source svx/source sw/source

Lionel Elie Mamane lionel at mamane.lu
Mon Sep 1 01:21:17 PDT 2014


 include/sfx2/shell.hxx         |    2 +-
 include/sfx2/viewsh.hxx        |    4 ++++
 sc/source/ui/inc/tabvwsh.hxx   |    3 ++-
 sfx2/source/view/viewfrm.cxx   |   12 ++++++++++--
 svx/source/form/fmview.cxx     |    3 ---
 sw/source/uibase/app/docsh.cxx |    1 +
 sw/source/uibase/inc/view.hxx  |    4 ++--
 7 files changed, 20 insertions(+), 9 deletions(-)

New commits:
commit 15cea073e7ed4970e60967fe036fc492e2052203
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Wed Aug 27 18:34:02 2014 +0200

    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 at free.fr>
    Tested-by: Bosdonnat Cedric <cedric.bosdonnat at free.fr>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/include/sfx2/shell.hxx b/include/sfx2/shell.hxx
index b79fd2d..9359324 100644
--- a/include/sfx2/shell.hxx
+++ b/include/sfx2/shell.hxx
@@ -160,7 +160,7 @@ protected:
         */
     SfxShell( SfxViewShell *pViewSh );
 
-    SAL_DLLPRIVATE void SetViewShell_Impl( SfxViewShell* pView );
+    void SetViewShell_Impl( SfxViewShell* pView );
     SAL_DLLPRIVATE void Invalidate_Impl( SfxBindings& rBindings, sal_uInt16 nId );
     SAL_DLLPRIVATE SfxShellObject* GetShellObj_Impl() const;
     SAL_DLLPRIVATE void SetShellObj_Impl( SfxShellObject* pObj );
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 5cde831..0ed5838 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -59,6 +59,7 @@ class SfxFrameItem;
 class Dialog;
 class Menu;
 class NotifyEvent;
+class FmFormShell;
 
 #define SFX_PRINTER_PRINTER               1  // without JOB SETUP => Temporary
 #define SFX_PRINTER_JOBSETUP         2
@@ -207,6 +208,9 @@ public:
     void                        RemoveSubShell( SfxShell *pShell=NULL );
     SfxShell*                   GetSubShell( sal_uInt16 );
 
+    virtual       FmFormShell*  GetFormShell()       { return 0; };
+    virtual const FmFormShell*  GetFormShell() const { return 0; };
+
     // Focus, KeyInput, Cursor
     void                        GotFocus() const;
     inline void                 LostFocus() const;
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index b20b829..d1be501 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -366,7 +366,8 @@ public:
     inline void     SetScSbxObject( SbxObject* pOb )
                     { pScSbxObject = pOb; }
 
-    FmFormShell*    GetFormShell() const    { return pFormShell; }
+    virtual const FmFormShell* GetFormShell() const SAL_OVERRIDE { return pFormShell; }
+    virtual       FmFormShell* GetFormShell()       SAL_OVERRIDE { return pFormShell; }
 
     void    InsertURL( const OUString& rName, const OUString& rURL, const OUString& rTarget,
                             sal_uInt16 nMode );
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index c01974d..5434fa6 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
                 {
diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx
index 343c624..b4e8a96 100644
--- a/svx/source/form/fmview.cxx
+++ b/svx/source/form/fmview.cxx
@@ -130,9 +130,6 @@ void FmFormView::Init()
         }
     }
 
-    if( pObjShell && pObjShell->IsReadOnly() )
-        bInitDesignMode = false;
-
     // dieses wird in der Shell vorgenommen
     // bDesignMode = !bInitDesignMode;  // erzwingt, dass SetDesignMode ausgefuehrt wird
     SetDesignMode( bInitDesignMode );
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index e3491cb..3da9550 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -1084,6 +1084,7 @@ SfxStyleSheetBasePool*  SwDocShell::GetStyleSheetPool()
 
 void SwDocShell::SetView(SwView* pVw)
 {
+    SetViewShell_Impl(pVw);
     if ( 0 != (mpView = pVw) )
         mpWrtShell = &mpView->GetWrtShell();
     else
diff --git a/sw/source/uibase/inc/view.hxx b/sw/source/uibase/inc/view.hxx
index fd09bf4..6e7db31 100644
--- a/sw/source/uibase/inc/view.hxx
+++ b/sw/source/uibase/inc/view.hxx
@@ -588,8 +588,8 @@ public:
                  SfxShell       *GetCurShell()  { return m_pShell; }
                  SwDocShell     *GetDocShell();
     inline const SwDocShell     *GetDocShell() const;
-    inline       FmFormShell    *GetFormShell() { return m_pFormShell; }
-    inline const FmFormShell    *GetFormShell() const { return m_pFormShell; }
+    inline virtual       FmFormShell    *GetFormShell()       SAL_OVERRIDE { return m_pFormShell; }
+    inline virtual const FmFormShell    *GetFormShell() const SAL_OVERRIDE { return m_pFormShell; }
 
     // so that in the SubShells' DTors m_pShell can be reset if applicable
     void ResetSubShell()    { m_pShell = 0; }


More information about the Libreoffice-commits mailing list