diff options
author | László Németh <nemeth@numbertext.org> | 2020-11-10 12:22:11 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-11-10 14:58:29 +0100 |
commit | afbbfb3b55beb937555a972d9edbb47ede91001a (patch) | |
tree | 01953156c1474505e8df94a5f813d048ca7dbbb6 | |
parent | ed564a411beb13a75a8f06d7cd040acad3e93dcb (diff) |
tdf#83958: sw: enable Track Changes toolbar automatically
Switch on the disabled Tracked Changes toolbar if the document hasn't
modified, yet (i.e. on load), only if recording of changes is enabled
or the document contains tracked changes.
Note: the toolbar stays there, but there is no need for it to manage
changes only with the menus Edit/View, keyboard shortcuts or the
experimental sidebar, so it may worth to add a View option for this
behaviour.
Change-Id: Ia46b552b3669e147cdcbf0cc0be164883e9fb2cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105519
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
-rw-r--r-- | sw/source/uibase/uiview/viewstat.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx index 904af3e672a4..1e501d3d02b7 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -52,6 +52,7 @@ #include <cmdid.h> #include <IDocumentRedlineAccess.hxx> +#include <IDocumentState.hxx> #include <doc.hxx> @@ -311,6 +312,17 @@ void SwView::GetState(SfxItemSet &rSet) break; case FN_REDLINE_ON: rSet.Put( SfxBoolItem( nWhich, GetDocShell()->IsChangeRecording() ) ); + // switch on the disabled Tracked Changes toolbar if the document hasn't + // modified, yet (i.e. on load), and if recording of changes is enabled + // or if it contains tracked changes. TODO: the toolbar stays there, but + // there is no need for it to manage changes only with the menus Edit/View, + // keyboard shortcuts or the experimental sidebar, so it's worth to add + // a View option for this behaviour. + if ( !GetDocShell()->IsModified() && ( GetDocShell()->IsChangeRecording() || + m_pWrtShell->GetDoc()->getIDocumentRedlineAccess().GetRedlineTable().size() ) ) + { + ShowUIElement("private:resource/toolbar/changes"); + } break; case FN_REDLINE_PROTECT : rSet.Put( SfxBoolItem( nWhich, GetDocShell()->HasChangeRecordProtection() ) ); |