summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorGökay Şatır <gokaysatir@gmail.com>2024-03-08 13:51:01 +0300
committerMichael Meeks <michael.meeks@collabora.com>2024-03-08 14:55:10 +0100
commitb44a1fdd7e0f5f7be02665407ebbc15b977d2f7b (patch)
treef68d13135e4e78503b6c273c531b519a6478c031 /sfx2
parent963ec97d3325cfb2d6c001100b1941b243fccdb3 (diff)
Allow enabling saving when comment edit is allowed in readonly.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com> Change-Id: I88d535a5b23fb6d5de8e72eec61bdf3550bc757d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164570 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/unoctitm.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 7ddfd50a0796..9b588293082b 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -547,7 +547,20 @@ static bool isCommandAllowedForViewType(const OUString& command)
u"CopyHyperlinkLocation"_ustr
};
- return std::find(std::begin(allowedCommandList), std::end(allowedCommandList), command) != std::end(allowedCommandList);
+ bool allowed = std::find(std::begin(allowedCommandList), std::end(allowedCommandList), command) != std::end(allowedCommandList);
+
+ if (!allowed && SfxViewShell::Current() && SfxViewShell::Current()->IsAllowChangeComments())
+ {
+ constexpr OUString allowedCommentCommandList[] = {
+ u"InsertAnnotation"_ustr,
+ u"DeleteComment"_ustr,
+ u"DeleteAnnotation"_ustr,
+ u"EditAnnotation"_ustr
+ };
+ allowed = std::find(std::begin(allowedCommentCommandList), std::end(allowedCommentCommandList), command) != std::end(allowedCommentCommandList);
+ }
+
+ return allowed;
}
return true;