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

Samuel Mehrbrodt s.mehrbrodt at gmail.com
Fri Aug 29 01:43:03 PDT 2014


 include/sfx2/sfx.hrc                         |    6 ++++--
 include/sfx2/viewfrm.hxx                     |    1 +
 sc/uiconfig/scalc/toolbar/standardbar.xml    |    2 --
 sc/uiconfig/scalc/toolbar/viewerbar.xml      |    1 -
 sd/uiconfig/sdraw/toolbar/standardbar.xml    |    2 --
 sd/uiconfig/sdraw/toolbar/viewerbar.xml      |    1 -
 sfx2/source/view/view.src                    |   12 +++++++++++-
 sfx2/source/view/viewfrm.cxx                 |   18 ++++++++++++++++--
 sw/uiconfig/sglobal/toolbar/standardbar.xml  |    2 --
 sw/uiconfig/sglobal/toolbar/viewerbar.xml    |    1 -
 sw/uiconfig/sweb/toolbar/standardbar.xml     |    2 --
 sw/uiconfig/sweb/toolbar/viewerbar.xml       |    1 -
 sw/uiconfig/swform/toolbar/standardbar.xml   |    2 --
 sw/uiconfig/swform/toolbar/viewerbar.xml     |    1 -
 sw/uiconfig/swreport/toolbar/standardbar.xml |    2 --
 sw/uiconfig/swreport/toolbar/viewerbar.xml   |    1 -
 sw/uiconfig/swriter/toolbar/standardbar.xml  |    2 --
 sw/uiconfig/swriter/toolbar/viewerbar.xml    |    1 -
 sw/uiconfig/swxform/toolbar/standardbar.xml  |    2 --
 sw/uiconfig/swxform/toolbar/viewerbar.xml    |    1 -
 20 files changed, 32 insertions(+), 29 deletions(-)

New commits:
commit c6270de939d5ee51b61dc4ac02c52f1d9b5b1e47
Author: Samuel Mehrbrodt <s.mehrbrodt at gmail.com>
Date:   Fri Aug 29 00:35:07 2014 +0200

    fdo#80538 Show an infobar when document is in read-only mode
    
    and remove the Edit icon from the toolbar
    
    Change-Id: I27d9506bd0fb76b3f1ad056a9866f7744674a3e2
    Reviewed-on: https://gerrit.libreoffice.org/11182
    Reviewed-by: Bosdonnat Cedric <cedric.bosdonnat at free.fr>
    Tested-by: Bosdonnat Cedric <cedric.bosdonnat at free.fr>

diff --git a/include/sfx2/sfx.hrc b/include/sfx2/sfx.hrc
index 6c8d6e1..6909d1c 100644
--- a/include/sfx2/sfx.hrc
+++ b/include/sfx2/sfx.hrc
@@ -151,8 +151,10 @@
 #define STR_PASSWD_MIN_LEN                  (RID_SFX_START+124)
 #define STR_NONCHECKEDOUT_DOCUMENT          (RID_SFX_START+125)
 #define BT_CHECKOUT                         (RID_SFX_START+126)
-#define STR_PASSWD_MIN_LEN1                 (RID_SFX_START+127)
-#define STR_MODULENOTINSTALLED              (RID_SFX_START+128)
+#define BT_READONLY_EDIT                    (RID_SFX_START+127)
+#define STR_READONLY_DOCUMENT               (RID_SFX_START+128)
+#define STR_PASSWD_MIN_LEN1                 (RID_SFX_START+129)
+#define STR_MODULENOTINSTALLED              (RID_SFX_START+130)
 #define STR_ACCTITLE_PRODUCTIVITYTOOLS      (RID_SFX_START+157)
 
 #define SFX_THUMBNAIL_TEXT                  (RID_SFX_START+158)
diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
index 16088cd..919ed9d 100644
--- a/include/sfx2/viewfrm.hxx
+++ b/include/sfx2/viewfrm.hxx
@@ -77,6 +77,7 @@ private:
 protected:
     virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
 
+    DECL_LINK( SwitchReadOnlyHandler, void * );
     SAL_DLLPRIVATE void KillDispatcher_Impl();
 
     virtual                 ~SfxViewFrame();
diff --git a/sc/uiconfig/scalc/toolbar/standardbar.xml b/sc/uiconfig/scalc/toolbar/standardbar.xml
index 5368218..84c9f16 100644
--- a/sc/uiconfig/scalc/toolbar/standardbar.xml
+++ b/sc/uiconfig/scalc/toolbar/standardbar.xml
@@ -26,8 +26,6 @@
  <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:SendMail"/>
  <toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:EditDoc"/>
- <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF"/>
  <toolbar:toolbaritem xlink:href=".uno:PrintDefault" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:Print"/>
diff --git a/sc/uiconfig/scalc/toolbar/viewerbar.xml b/sc/uiconfig/scalc/toolbar/viewerbar.xml
index a371876..926e465 100644
--- a/sc/uiconfig/scalc/toolbar/viewerbar.xml
+++ b/sc/uiconfig/scalc/toolbar/viewerbar.xml
@@ -20,7 +20,6 @@
 <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
  <toolbar:toolbaritem xlink:href=".uno:SaveAs"/>
  <toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:EditDoc"/>
  <toolbar:toolbaritem xlink:href=".uno:SendMail"/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF"/>
diff --git a/sd/uiconfig/sdraw/toolbar/standardbar.xml b/sd/uiconfig/sdraw/toolbar/standardbar.xml
index 8b8af1f..589be80 100644
--- a/sd/uiconfig/sdraw/toolbar/standardbar.xml
+++ b/sd/uiconfig/sdraw/toolbar/standardbar.xml
@@ -26,8 +26,6 @@
  <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:visible="false" toolbar:helpid="5502"/>
  <toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:helpid="5331"/>
  <toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:helpid="6312"/>
- <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF" toolbar:helpid="6674"/>
  <toolbar:toolbaritem xlink:href=".uno:PrintDefault" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:Print"/>
diff --git a/sd/uiconfig/sdraw/toolbar/viewerbar.xml b/sd/uiconfig/sdraw/toolbar/viewerbar.xml
index c57e61d..da905ab 100644
--- a/sd/uiconfig/sdraw/toolbar/viewerbar.xml
+++ b/sd/uiconfig/sdraw/toolbar/viewerbar.xml
@@ -20,7 +20,6 @@
 <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
  <toolbar:toolbaritem xlink:href=".uno:SaveAs"/>
  <toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:EditDoc"/>
  <toolbar:toolbaritem xlink:href=".uno:SendMail"/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF"/>
diff --git a/sfx2/source/view/view.src b/sfx2/source/view/view.src
index c4213fc..85472fe 100644
--- a/sfx2/source/view/view.src
+++ b/sfx2/source/view/view.src
@@ -84,7 +84,11 @@ String STR_REPAIREDDOCUMENT
 
 String STR_NONCHECKEDOUT_DOCUMENT
 {
-    Text [ en-US ] = "Document is not checked out on server" ;
+    Text [ en-US ] = "This document is not checked out on the server." ;
+};
+String STR_READONLY_DOCUMENT
+{
+    Text [ en-US ] = "This document is opened in read-only mode." ;
 };
 
 PushButton BT_CHECKOUT
@@ -93,5 +97,11 @@ PushButton BT_CHECKOUT
     Size = MAP_APPFONT( 30 , 0 );
     Text[ en-US ] = "Check out";
 };
+PushButton BT_READONLY_EDIT
+{
+    Pos = MAP_APPFONT( 0 , 0 );
+    Size = MAP_APPFONT( 70 , 0 );
+    Text[ en-US ] = "Edit document";
+};
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index a01e916..efef8f4 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -416,6 +416,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
                     return;
                 }
 
+                RemoveInfoBar("readonly");
                 pSh->SetReadOnlyUI( false );
             }
 
@@ -1246,7 +1247,6 @@ const SvBorder& SfxViewFrame::GetBorderPixelImpl
 
 void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
 {
-
     if( IsDowning_Impl())
         return;
 
@@ -1268,7 +1268,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
                 SfxDispatcher *pDispat = GetDispatcher();
                 bool bWasReadOnly = pDispat->GetReadOnly_Impl();
                 bool bIsReadOnly = xObjSh->IsReadOnly();
-                if ( !bWasReadOnly != !bIsReadOnly )
+                if ( bWasReadOnly != bIsReadOnly )
                 {
                     // Then also TITLE_CHANGED
                     UpdateTitle();
@@ -1356,6 +1356,14 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
                     // because each document has its own SfxBindings.
                     //GetDispatcher()->GetBindings()->InvalidateAll(true);
                 }
+                else
+                {
+                    std::vector< PushButton* > aButtons;
+                    PushButton* pBtn = new PushButton( &GetWindow(), SfxResId(BT_READONLY_EDIT));
+                    pBtn->SetClickHdl(LINK(this, SfxViewFrame, SwitchReadOnlyHandler));
+                    aButtons.push_back( pBtn );
+                    AppendInfoBar("readonly", SfxResId(STR_READONLY_DOCUMENT), aButtons);
+                }
 
                 break;
             }
@@ -1370,6 +1378,12 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
     }
 }
 
+IMPL_LINK_NOARG(SfxViewFrame, SwitchReadOnlyHandler)
+{
+    GetDispatcher()->Execute(SID_EDITDOC);
+    return 0;
+}
+
 
 void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh )
 {
diff --git a/sw/uiconfig/sglobal/toolbar/standardbar.xml b/sw/uiconfig/sglobal/toolbar/standardbar.xml
index a53f25b..785c375 100644
--- a/sw/uiconfig/sglobal/toolbar/standardbar.xml
+++ b/sw/uiconfig/sglobal/toolbar/standardbar.xml
@@ -26,8 +26,6 @@
  <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:visible="false" toolbar:helpid="5502"/>
  <toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:helpid="5331"/>
  <toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:helpid="6312"/>
- <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF" toolbar:helpid="6674"/>
  <toolbar:toolbaritem xlink:href=".uno:PrintDefault" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:Print"/>
diff --git a/sw/uiconfig/sglobal/toolbar/viewerbar.xml b/sw/uiconfig/sglobal/toolbar/viewerbar.xml
index c57e61d..da905ab 100644
--- a/sw/uiconfig/sglobal/toolbar/viewerbar.xml
+++ b/sw/uiconfig/sglobal/toolbar/viewerbar.xml
@@ -20,7 +20,6 @@
 <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
  <toolbar:toolbaritem xlink:href=".uno:SaveAs"/>
  <toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:EditDoc"/>
  <toolbar:toolbaritem xlink:href=".uno:SendMail"/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF"/>
diff --git a/sw/uiconfig/sweb/toolbar/standardbar.xml b/sw/uiconfig/sweb/toolbar/standardbar.xml
index 1fd6af2..2a086bf 100644
--- a/sw/uiconfig/sweb/toolbar/standardbar.xml
+++ b/sw/uiconfig/sweb/toolbar/standardbar.xml
@@ -26,8 +26,6 @@
  <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:visible="false" toolbar:helpid="5502"/>
  <toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:helpid="5331"/>
  <toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:helpid="6312"/>
- <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF" toolbar:helpid="6674"/>
  <toolbar:toolbaritem xlink:href=".uno:PrintDefault" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:Print"/>
diff --git a/sw/uiconfig/sweb/toolbar/viewerbar.xml b/sw/uiconfig/sweb/toolbar/viewerbar.xml
index c57e61d..da905ab 100644
--- a/sw/uiconfig/sweb/toolbar/viewerbar.xml
+++ b/sw/uiconfig/sweb/toolbar/viewerbar.xml
@@ -20,7 +20,6 @@
 <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
  <toolbar:toolbaritem xlink:href=".uno:SaveAs"/>
  <toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:EditDoc"/>
  <toolbar:toolbaritem xlink:href=".uno:SendMail"/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF"/>
diff --git a/sw/uiconfig/swform/toolbar/standardbar.xml b/sw/uiconfig/swform/toolbar/standardbar.xml
index a53f25b..785c375 100644
--- a/sw/uiconfig/swform/toolbar/standardbar.xml
+++ b/sw/uiconfig/swform/toolbar/standardbar.xml
@@ -26,8 +26,6 @@
  <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:visible="false" toolbar:helpid="5502"/>
  <toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:helpid="5331"/>
  <toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:helpid="6312"/>
- <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF" toolbar:helpid="6674"/>
  <toolbar:toolbaritem xlink:href=".uno:PrintDefault" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:Print"/>
diff --git a/sw/uiconfig/swform/toolbar/viewerbar.xml b/sw/uiconfig/swform/toolbar/viewerbar.xml
index c57e61d..da905ab 100644
--- a/sw/uiconfig/swform/toolbar/viewerbar.xml
+++ b/sw/uiconfig/swform/toolbar/viewerbar.xml
@@ -20,7 +20,6 @@
 <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
  <toolbar:toolbaritem xlink:href=".uno:SaveAs"/>
  <toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:EditDoc"/>
  <toolbar:toolbaritem xlink:href=".uno:SendMail"/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF"/>
diff --git a/sw/uiconfig/swreport/toolbar/standardbar.xml b/sw/uiconfig/swreport/toolbar/standardbar.xml
index a53f25b..785c375 100644
--- a/sw/uiconfig/swreport/toolbar/standardbar.xml
+++ b/sw/uiconfig/swreport/toolbar/standardbar.xml
@@ -26,8 +26,6 @@
  <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:visible="false" toolbar:helpid="5502"/>
  <toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:helpid="5331"/>
  <toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:helpid="6312"/>
- <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF" toolbar:helpid="6674"/>
  <toolbar:toolbaritem xlink:href=".uno:PrintDefault" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:Print"/>
diff --git a/sw/uiconfig/swreport/toolbar/viewerbar.xml b/sw/uiconfig/swreport/toolbar/viewerbar.xml
index c57e61d..da905ab 100644
--- a/sw/uiconfig/swreport/toolbar/viewerbar.xml
+++ b/sw/uiconfig/swreport/toolbar/viewerbar.xml
@@ -20,7 +20,6 @@
 <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
  <toolbar:toolbaritem xlink:href=".uno:SaveAs"/>
  <toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:EditDoc"/>
  <toolbar:toolbaritem xlink:href=".uno:SendMail"/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF"/>
diff --git a/sw/uiconfig/swriter/toolbar/standardbar.xml b/sw/uiconfig/swriter/toolbar/standardbar.xml
index 4eed6fb..c7c2dd3 100644
--- a/sw/uiconfig/swriter/toolbar/standardbar.xml
+++ b/sw/uiconfig/swriter/toolbar/standardbar.xml
@@ -26,8 +26,6 @@
  <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:visible="false" toolbar:helpid="5502"/>
  <toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:helpid="5331"/>
  <toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:helpid="6312"/>
- <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF" toolbar:helpid="6674"/>
  <toolbar:toolbaritem xlink:href=".uno:PrintDefault" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:Print"/>
diff --git a/sw/uiconfig/swriter/toolbar/viewerbar.xml b/sw/uiconfig/swriter/toolbar/viewerbar.xml
index c57e61d..da905ab 100644
--- a/sw/uiconfig/swriter/toolbar/viewerbar.xml
+++ b/sw/uiconfig/swriter/toolbar/viewerbar.xml
@@ -20,7 +20,6 @@
 <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
  <toolbar:toolbaritem xlink:href=".uno:SaveAs"/>
  <toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:EditDoc"/>
  <toolbar:toolbaritem xlink:href=".uno:SendMail"/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF"/>
diff --git a/sw/uiconfig/swxform/toolbar/standardbar.xml b/sw/uiconfig/swxform/toolbar/standardbar.xml
index 28f3769..dc1886e 100644
--- a/sw/uiconfig/swxform/toolbar/standardbar.xml
+++ b/sw/uiconfig/swxform/toolbar/standardbar.xml
@@ -26,8 +26,6 @@
  <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:visible="false" toolbar:helpid="5502"/>
  <toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:helpid="5331"/>
  <toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:helpid="6312"/>
- <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF" toolbar:helpid="6674"/>
  <toolbar:toolbaritem xlink:href=".uno:PrintDefault" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:Print"/>
diff --git a/sw/uiconfig/swxform/toolbar/viewerbar.xml b/sw/uiconfig/swxform/toolbar/viewerbar.xml
index c57e61d..da905ab 100644
--- a/sw/uiconfig/swxform/toolbar/viewerbar.xml
+++ b/sw/uiconfig/swxform/toolbar/viewerbar.xml
@@ -20,7 +20,6 @@
 <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
  <toolbar:toolbaritem xlink:href=".uno:SaveAs"/>
  <toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:EditDoc"/>
  <toolbar:toolbaritem xlink:href=".uno:SendMail"/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF"/>


More information about the Libreoffice-commits mailing list