[Libreoffice-commits] core.git: sw/inc sw/source
László Németh (via logerrit)
logerrit at kemper.freedesktop.org
Tue Feb 2 09:59:09 UTC 2021
sw/inc/view.hxx | 3 ++-
sw/source/uibase/uiview/view.cxx | 1 +
sw/source/uibase/uiview/viewstat.cxx | 12 +++++-------
3 files changed, 8 insertions(+), 8 deletions(-)
New commits:
commit 28d65bb877c193b3fa53a038f3b896e4ba2f7ee4
Author: László Németh <nemeth at numbertext.org>
AuthorDate: Mon Feb 1 22:18:56 2021 +0100
Commit: László Németh <nemeth at numbertext.org>
CommitDate: Tue Feb 2 10:58:30 2021 +0100
tdf#138870 sw: fix Track Changes toolbar reappearing
on Save automatically.
Now force enabling only on creating a new View
instead of depending on the state of document
modification (which is "unmodified" after saving the
document, too, not only on load).
Follow-up of commit afbbfb3b55beb937555a972d9edbb47ede91001a
(tdf#83958: sw: enable Track Changes toolbar automatically)
Change-Id: I8e074dadc4ec1280924ef88f589302c9e8dfc6e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110278
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth at numbertext.org>
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index abdba739c3b7..7e3feca87883 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -245,7 +245,8 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
m_bInDtor : 1, //detect destructor to prevent creating of sub shells while closing
m_bOldShellWasPagePreview : 1,
m_bIsPreviewDoubleClick : 1, // #i114045#
- m_bMakeSelectionVisible : 1; // transport the bookmark selection
+ m_bMakeSelectionVisible : 1, // transport the bookmark selection
+ m_bForceChangesToolbar : 1; // on load of documents with change tracking
bool m_bInitOnceCompleted = false;
/// LibreOfficeKit has to force the page size for PgUp/PgDown
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 5f5fd34029af..a6639e3bcb9c 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -747,6 +747,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
m_bOldShellWasPagePreview(false),
m_bIsPreviewDoubleClick(false),
m_bMakeSelectionVisible(false),
+ m_bForceChangesToolbar(true),
m_nLOKPageUpDownOffset(0)
{
static bool bRequestDoubleBuffering = getenv("VCL_DOUBLEBUFFERING_ENABLE");
diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx
index 8dbcbe650090..30c18bdc0180 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -324,17 +324,15 @@ 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() ||
+ // switch on the disabled Tracked Changes toolbar if the view is
+ // new (e.g. on load), and if recording of changes is enabled
+ // or if it contains tracked changes.
+ if ( m_bForceChangesToolbar && ( GetDocShell()->IsChangeRecording() ||
m_pWrtShell->GetDoc()->getIDocumentRedlineAccess().GetRedlineTable().size() ) )
{
ShowUIElement("private:resource/toolbar/changes");
}
+ m_bForceChangesToolbar = false;
break;
case FN_REDLINE_PROTECT :
rSet.Put( SfxBoolItem( nWhich, GetDocShell()->HasChangeRecordProtection() ) );
More information about the Libreoffice-commits
mailing list