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

Lionel Elie Mamane lionel at mamane.lu
Tue Sep 2 09:16:33 PDT 2014


 include/sfx2/shell.hxx         |    4 +++-
 include/sfx2/viewsh.hxx        |    3 +++
 include/svx/fmshell.hxx        |    4 ++--
 sc/source/ui/inc/tabvwsh.hxx   |    5 +++--
 sfx2/source/view/viewfrm.cxx   |   19 ++++++++++++++++---
 svx/source/form/fmview.cxx     |    3 ---
 sw/source/uibase/app/docsh.cxx |    1 +
 sw/source/uibase/inc/view.hxx  |    6 +++---
 8 files changed, 31 insertions(+), 14 deletions(-)

New commits:
commit 7fb4fdcddca89a4191b83896a400e8835314da87
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Sun Aug 31 21:48:12 2014 +0200

    fdo#83302 don't display read-only infobar for Base form in normal mode
    
    Change-Id: I03c32883dbf8421824069efea2318e67c8dc4313
    Reviewed-on: https://gerrit.libreoffice.org/11231
    Reviewed-by: Lionel Elie Mamane <lionel at mamane.lu>
    Tested-by: Lionel Elie Mamane <lionel at mamane.lu>

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 2bf0989..479dde2 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1353,7 +1353,13 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
                 SfxBindings& rBind = GetBindings();
                 rBind.Invalidate( SID_RELOAD );
                 rBind.Invalidate( SID_EDITDOC );
-                if ( !xObjSh->IsReadOnly() )
+                const SfxViewShell *pVSh;
+                const SfxShell *pFSh;
+                if ( !xObjSh->IsReadOnly() ||
+                     ( xObjSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED &&
+                       (pVSh = xObjSh->GetViewShell()) &&
+                       (pFSh = pVSh->GetFormShell()) &&
+                       !pFSh->IsDesignMode()))
                 {
                     // In contrast to above (TITLE_CHANGED) does the UI not
                     // have to be updated because it was not obstructed
commit b3062ae65fc7069442cb5fc23dd68c2e8344e999
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: I009b0e1a155c298bd7f461547125df4ba76805d9
    Reviewed-on: https://gerrit.libreoffice.org/11230
    Reviewed-by: Lionel Elie Mamane <lionel at mamane.lu>
    Tested-by: Lionel Elie Mamane <lionel at mamane.lu>

diff --git a/include/sfx2/shell.hxx b/include/sfx2/shell.hxx
index b79fd2d..44c8d8c 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 );
@@ -351,6 +351,8 @@ public:
         */
     virtual void                Invalidate(sal_uInt16 nId = 0);
 
+    virtual bool                IsDesignMode() const { return false; };
+
     bool                        IsActive() const;
 
     /**
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 5cde831..b32c789 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -207,6 +207,9 @@ public:
     void                        RemoveSubShell( SfxShell *pShell=NULL );
     SfxShell*                   GetSubShell( sal_uInt16 );
 
+    virtual       SfxShell*     GetFormShell()       { return 0; };
+    virtual const SfxShell*     GetFormShell() const { return 0; };
+
     // Focus, KeyInput, Cursor
     void                        GotFocus() const;
     inline void                 LostFocus() const;
diff --git a/include/svx/fmshell.hxx b/include/svx/fmshell.hxx
index b733b25..40228fc 100644
--- a/include/svx/fmshell.hxx
+++ b/include/svx/fmshell.hxx
@@ -166,8 +166,8 @@ public:
                 const OutputDevice& i_rDevice
             ) const;
 
-    bool        IsDesignMode() const { return m_bDesignMode; }
-    void        SetDesignMode( bool _bDesignMode );
+    virtual bool IsDesignMode() const { return m_bDesignMode; }
+    void         SetDesignMode( bool _bDesignMode );
 
 protected:
     void GetFormState(SfxItemSet &rSet, sal_uInt16 nWhich);
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index b20b829..e657308 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -20,6 +20,7 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_TABVWSH_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_TABVWSH_HXX
 
+#include <svx/fmshell.hxx>
 #include <svtools/htmlcfg.hxx>
 #include <sfx2/viewsh.hxx>
 #include <sfx2/viewfac.hxx>
@@ -33,7 +34,6 @@
 
 #include <boost/ptr_container/ptr_map.hpp>
 
-class FmFormShell;
 class SbxObject;
 class SdrOle2Obj;
 class SfxBindings;
@@ -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 1e70bd6..2bf0989 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -866,8 +866,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
                 {
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..627b022 100644
--- a/sw/source/uibase/inc/view.hxx
+++ b/sw/source/uibase/inc/view.hxx
@@ -29,6 +29,7 @@
 #include <editeng/svxenum.hxx>
 #include <sfx2/zoomitem.hxx>
 #include <svx/svxids.hrc>
+#include <svx/fmshell.hxx>
 #include <editeng/editstat.hxx>
 #include "swdllapi.h"
 #include <swtypes.hxx>
@@ -63,7 +64,6 @@ class SwEditWin;
 class SwWrtShell;
 class SwView_Impl;
 struct SwSearchOptions;
-class FmFormShell;
 class CommandEvent;
 class InsCaptionOpt;
 class SvGlobalName;
@@ -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