summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2021-02-01 22:18:56 +0100
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2021-02-03 18:10:29 +0100
commit1989201c56c03b1ef13a282cfd09af69620040ea (patch)
tree6f9321a40202f1df08f53f3d16d8cdf79643e856 /sw
parent28bdc7916e1875e6827cae3b70977ad6c8c42824 (diff)
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@numbertext.org> (cherry picked from commit 28d65bb877c193b3fa53a038f3b896e4ba2f7ee4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110294 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/view.hxx3
-rw-r--r--sw/source/uibase/uiview/view.cxx1
-rw-r--r--sw/source/uibase/uiview/viewstat.cxx12
3 files changed, 8 insertions, 8 deletions
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 0e12a868f88d..ff6f2bc82349 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 1e501d3d02b7..82b1159952fb 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -312,17 +312,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() ) );