[Libreoffice-commits] core.git: sw/source

Mike Kaganski mike.kaganski at collabora.com
Thu Jul 5 07:18:56 UTC 2018


 sw/source/uibase/utlui/content.cxx |   21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

New commits:
commit 44c0d38a06cd5ab765facef3242e2c0e3e7944b4
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Thu Jul 5 07:32:18 2018 +0200

    tdf#43438: SwContentTree: handle ModeChanged notification
    
    Change-Id: Iebb53af7fb06ebab6d5cdd1ce514480caec1b17e
    Reviewed-on: https://gerrit.libreoffice.org/56985
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index c92b39bca0b4..9536891056d7 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -2351,8 +2351,25 @@ void SwContentTree::Notify(SfxBroadcaster & rBC, SfxHint const& rHint)
     {
         SfxListener::Notify(rBC, rHint);
     }
-    if (SfxHintId::DocChanged == rHint.GetId())
-        m_bViewHasChanged = true;
+    switch (rHint.GetId())
+    {
+        case SfxHintId::DocChanged:
+            m_bViewHasChanged = true;
+            break;
+        case SfxHintId::ModeChanged:
+            if (SwWrtShell* pShell = GetWrtShell())
+            {
+                const bool bReadOnly = pShell->GetView().GetDocShell()->IsReadOnly();
+                if (bReadOnly != m_bIsLastReadOnly)
+                {
+                    m_bIsLastReadOnly = bReadOnly;
+                    Select(GetCurEntry());
+                }
+            }
+            break;
+        default:
+            break;
+    }
 }
 
 


More information about the Libreoffice-commits mailing list