summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sfx2/objsh.hxx2
-rw-r--r--sc/source/ui/docshell/docsh.cxx2
-rw-r--r--sc/source/ui/inc/docsh.hxx2
-rw-r--r--sfx2/source/doc/objxtor.cxx2
-rw-r--r--sw/inc/docsh.hxx2
-rw-r--r--sw/source/uibase/app/docsh.cxx13
-rw-r--r--sw/source/uibase/uiview/view2.cxx7
7 files changed, 18 insertions, 12 deletions
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 40ab5b46639a..ee3d3d6eefb7 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -671,7 +671,7 @@ public:
// slots used for Calc: FID_CHG_RECORD, SID_CHG_PROTECT
virtual bool IsChangeRecording() const;
virtual bool HasChangeRecordProtection() const;
- virtual void SetChangeRecording( bool bActivate );
+ virtual void SetChangeRecording( bool bActivate, bool bLockAllViews = false );
virtual void SetProtectionPassword( const OUString &rPassword );
virtual bool GetProtectionHash( /*out*/ css::uno::Sequence< sal_Int8 > &rPasswordHash );
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 0d7345e29fcc..91020db0b2e0 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -3190,7 +3190,7 @@ bool ScDocShell::HasChangeRecordProtection() const
return bRes;
}
-void ScDocShell::SetChangeRecording( bool bActivate )
+void ScDocShell::SetChangeRecording( bool bActivate, bool /*bLockAllViews*/ )
{
bool bOldChangeRecording = IsChangeRecording();
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index bfdaf85af4b3..41c0b30a42a8 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -418,7 +418,7 @@ public:
// see also: FID_CHG_RECORD, SID_CHG_PROTECT
virtual bool IsChangeRecording() const override;
virtual bool HasChangeRecordProtection() const override;
- virtual void SetChangeRecording( bool bActivate ) override;
+ virtual void SetChangeRecording( bool bActivate, bool bLockAllViews = false ) override;
virtual void SetProtectionPassword( const OUString &rPassword ) override;
virtual bool GetProtectionHash( /*out*/ css::uno::Sequence< sal_Int8 > &rPasswordHash ) override;
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index d97731486ccf..a746d1ac89fb 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -1092,7 +1092,7 @@ bool SfxObjectShell::HasChangeRecordProtection() const
}
-void SfxObjectShell::SetChangeRecording( bool /*bActivate*/ )
+void SfxObjectShell::SetChangeRecording( bool /*bActivate*/, bool /*bLockAllViews*/ )
{
// currently this function needs to be overwritten by Writer and Calc only
SAL_WARN( "sfx.doc", "function not implemented" );
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index d58a3fdb9844..070033306af4 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -311,7 +311,7 @@ public:
see also: FN_REDLINE_ON, FN_REDLINE_ON */
virtual bool IsChangeRecording() const override;
virtual bool HasChangeRecordProtection() const override;
- virtual void SetChangeRecording( bool bActivate ) override;
+ virtual void SetChangeRecording( bool bActivate, bool bLockAllViews = false ) override;
virtual void SetProtectionPassword( const OUString &rPassword ) override;
virtual bool GetProtectionHash( /*out*/ css::uno::Sequence< sal_Int8 > &rPasswordHash ) override;
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index 64564cb39c9b..7a9620b876cf 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -1339,11 +1339,20 @@ bool SwDocShell::HasChangeRecordProtection() const
return m_pWrtShell->getIDocumentRedlineAccess().GetRedlinePassword().hasElements();
}
-void SwDocShell::SetChangeRecording( bool bActivate )
+void SwDocShell::SetChangeRecording( bool bActivate, bool bLockAllViews )
{
RedlineFlags nOn = bActivate ? RedlineFlags::On : RedlineFlags::NONE;
RedlineFlags nMode = m_pWrtShell->GetRedlineFlags();
- m_pWrtShell->SetRedlineFlagsAndCheckInsMode( (nMode & ~RedlineFlags::On) | nOn );
+ if (bLockAllViews)
+ {
+ // tdf#107870: prevent jumping to cursor
+ auto aViewGuard(LockAllViews());
+ m_pWrtShell->SetRedlineFlagsAndCheckInsMode( (nMode & ~RedlineFlags::On) | nOn );
+ }
+ else
+ {
+ m_pWrtShell->SetRedlineFlagsAndCheckInsMode( (nMode & ~RedlineFlags::On) | nOn );
+ }
}
void SwDocShell::SetProtectionPassword( const OUString &rNewPassword )
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 4b83a3d00e95..e44925380ff2 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -673,13 +673,10 @@ void SwView::Execute(SfxRequest &rReq)
}
}
- const RedlineFlags nOn = static_cast<const SfxBoolItem*>(pItem)->GetValue()
- ? RedlineFlags::On : RedlineFlags::NONE;
- const RedlineFlags nMode = m_pWrtShell->GetRedlineFlags();
- m_pWrtShell->SetRedlineFlagsAndCheckInsMode( (nMode & ~RedlineFlags::On) | nOn);
+ SwDocShell* pDocShell = GetDocShell();
+ pDocShell->SetChangeRecording( static_cast<const SfxBoolItem*>(pItem)->GetValue(), /*bLockAllViews=*/true );
// Notify all view shells of this document, as the track changes mode is document-global.
- SwDocShell* pDocShell = GetDocShell();
for (SfxViewFrame* pViewFrame = SfxViewFrame::GetFirst(pDocShell); pViewFrame; pViewFrame = SfxViewFrame::GetNext(*pViewFrame, pDocShell))
{
pViewFrame->GetBindings().Invalidate(FN_REDLINE_ON);