summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-07-05 07:32:18 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2018-07-05 09:18:32 +0200
commit44c0d38a06cd5ab765facef3242e2c0e3e7944b4 (patch)
tree0a2fc958f2f3851b324e3975c5384d1dabca7dff
parent450482220a14a5e083f11bfa1c9561994dc91ec8 (diff)
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@collabora.com>
-rw-r--r--sw/source/uibase/utlui/content.cxx21
1 files changed, 19 insertions, 2 deletions
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;
+ }
}