[Libreoffice-commits] core.git: sw/source
László Németh (via logerrit)
logerrit at kemper.freedesktop.org
Tue Nov 10 13:59:09 UTC 2020
sw/source/uibase/uiview/viewstat.cxx | 12 ++++++++++++
1 file changed, 12 insertions(+)
New commits:
commit afbbfb3b55beb937555a972d9edbb47ede91001a
Author: László Németh <nemeth at numbertext.org>
AuthorDate: Tue Nov 10 12:22:11 2020 +0100
Commit: László Németh <nemeth at numbertext.org>
CommitDate: Tue Nov 10 14:58:29 2020 +0100
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 at numbertext.org>
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() ) );
More information about the Libreoffice-commits
mailing list