diff options
author | Gökay Şatır <gokaysatir@gmail.com> | 2024-03-08 13:51:01 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-03-26 16:48:51 +0100 |
commit | c15b872784c8fc0f5e5e813d38c7722f034034d2 (patch) | |
tree | 57044269952af9f32e1b189d34beca87f706b6e7 /sfx2 | |
parent | f2ac3dff7858c1ef49474c1e703ddc0e4127b0cf (diff) |
Allow enabling saving when comment edit is allowed in readonly.
Change-Id: I88d535a5b23fb6d5de8e72eec61bdf3550bc757d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165334
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/unoctitm.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 24beba448818..1068b28e0ac8 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; |