summaryrefslogtreecommitdiff
path: root/sw/source/uibase/misc/redlndlg.cxx
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-04-25 17:25:41 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2022-04-26 10:40:06 +0200
commit82e789bfc8c215a7b27d4ca8d6567590717168da (patch)
tree9a024139eeea621efbb4f6f425feefc11e4e97c8 /sw/source/uibase/misc/redlndlg.cxx
parent6e80ee919b9ab3cb4d9f32059b5e213f1885bcc1 (diff)
sw: show Manage Changes dialog for read-only documents too...
... and also the panel in the in sidebar, to allow navigating the tracked changes. Disable all the Accept/Reject buttons if document is read-only. This appears to work, even when switching between 2 documents, one editable and the other read-only, with the dialog open. Change-Id: I51cce414326d50e86ba2da35c31b87d4b6daf53b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133414 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw/source/uibase/misc/redlndlg.cxx')
-rw-r--r--sw/source/uibase/misc/redlndlg.cxx18
1 files changed, 16 insertions, 2 deletions
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index 403dece0514c..9cc010c288ec 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -277,7 +277,9 @@ void SwRedlineAcceptDlg::InitAuthors()
pFilterPage->SelectAuthor(aStrings[0]);
weld::TreeView& rTreeView = m_pTable->GetWidget();
- bool bEnable = rTreeView.n_children() != 0 && !pSh->getIDocumentRedlineAccess().GetRedlinePassword().hasElements();
+ bool const bEnable = !pSh->GetDoc()->GetDocShell()->IsReadOnly()
+ && rTreeView.n_children() != 0
+ && !pSh->getIDocumentRedlineAccess().GetRedlinePassword().hasElements();
bool bSel = rTreeView.get_selected(nullptr);
rTreeView.selected_foreach([this, pSh, &bIsNotFormated](weld::TreeIter& rEntry){
@@ -367,6 +369,17 @@ void SwRedlineAcceptDlg::Activate()
SwWait aWait( *pView->GetDocShell(), false );
+ if (pView->GetDocShell()->IsReadOnly())
+ {
+ m_pTPView->EnableAccept(false);
+ m_pTPView->EnableReject(false);
+ m_pTPView->EnableClearFormat(false);
+ m_pTPView->EnableAcceptAll(false);
+ m_pTPView->EnableRejectAll(false);
+ m_pTPView->EnableClearFormatAll(false);
+ // note: enabling is done in InitAuthors below
+ }
+
m_aUsedSeqNo.clear();
// did something change?
@@ -1164,7 +1177,8 @@ IMPL_LINK_NOARG(SwRedlineAcceptDlg, GotoHdl, Timer *, void)
}
}
- bool bEnable = !pSh->getIDocumentRedlineAccess().GetRedlinePassword().hasElements();
+ bool const bEnable = !pSh->GetDoc()->GetDocShell()->IsReadOnly()
+ && !pSh->getIDocumentRedlineAccess().GetRedlinePassword().hasElements();
m_pTPView->EnableAccept( bEnable && bSel /*&& !bReadonlySel*/ );
m_pTPView->EnableReject( bEnable && bSel /*&& !bReadonlySel*/ );
m_pTPView->EnableClearFormat( bEnable && bSel && !bIsNotFormated /*&& !bReadonlySel*/ );