summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--desktop/source/lib/init.cxx3
-rw-r--r--sfx2/source/control/unoctitm.cxx15
2 files changed, 17 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6eba39cc32f3..99c533c20598 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -5079,6 +5079,9 @@ static bool isCommandAllowed(OUString& command) {
return true;
else
{
+ if (command == u".uno:Save"_ustr && SfxViewShell::Current() && SfxViewShell::Current()->IsAllowChangeComments())
+ return true;
+
for (size_t i = 0; i < std::size(nonAllowedList); i++)
{
if (nonAllowedList[i] == command)
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;