summaryrefslogtreecommitdiff
path: root/sd/source/ui/annotations/annotationwindow.cxx
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2024-11-27 12:10:23 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2024-11-27 13:22:12 +0100
commit3be6d3182d023723f4c382c5c30d53797a9036a6 (patch)
tree697b708e57f0a53e15633f889bb2f91c4e825743 /sd/source/ui/annotations/annotationwindow.cxx
parente1967187957e1e4b56962564a81917d0ba92cac0 (diff)
PVS: V560 A part of conditional expression is always true: !bReadOnly
Since commit a39a3f1ad1e5e39b09ce474c0f4c0f9f4e174bbe Author: Caolán McNamara <caolanm@redhat.com> Date: Tue Feb 9 12:07:27 2021 +0000 weld impress annotation window Change-Id: I63855a609d5de49a0c810994fccf240695605456 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177405 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd/source/ui/annotations/annotationwindow.cxx')
-rw-r--r--sd/source/ui/annotations/annotationwindow.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx
index 01b9181f020c..ca134cd8d908 100644
--- a/sd/source/ui/annotations/annotationwindow.cxx
+++ b/sd/source/ui/annotations/annotationwindow.cxx
@@ -646,8 +646,7 @@ bool AnnotationTextWindow::Command(const CommandEvent& rCEvt)
{
if (rCEvt.GetCommand() == CommandEventId::ContextMenu)
{
- const bool bReadOnly = mrContents.DocShell()->IsReadOnly();
- if (bReadOnly)
+ if (mrContents.DocShell()->IsReadOnly())
return true;
SfxDispatcher* pDispatcher = mrContents.DocShell()->GetViewShell()->GetViewFrame()->GetDispatcher();
@@ -679,19 +678,19 @@ bool AnnotationTextWindow::Command(const CommandEvent& rCEvt)
aStr = aStr.replaceFirst("%1", aReplace);
xMenu->set_label(u".uno:DeleteAllAnnotationByAuthor"_ustr, aStr);
- bool bShowReply = sAuthor != sCurrentAuthor && !bReadOnly;
+ bool bShowReply = sAuthor != sCurrentAuthor;
xMenu->set_visible(u".uno:ReplyToAnnotation"_ustr, bShowReply);
xMenu->set_visible(u"separator"_ustr, bShowReply);
- xMenu->set_visible(u".uno:DeleteAnnotation"_ustr, xAnnotation.is() && !bReadOnly);
- xMenu->set_visible(u".uno:DeleteAllAnnotationByAuthor"_ustr, !bReadOnly);
- xMenu->set_visible(u".uno:DeleteAllAnnotation"_ustr, !bReadOnly);
+ xMenu->set_visible(u".uno:DeleteAnnotation"_ustr, xAnnotation.is());
+ xMenu->set_visible(u".uno:DeleteAllAnnotationByAuthor"_ustr, true);
+ xMenu->set_visible(u".uno:DeleteAllAnnotation"_ustr, true);
int nInsertPos = 2;
auto xFrame = mrContents.DocShell()->GetViewShell()->GetViewFrame()->GetFrame().GetFrameInterface();
OUString aModuleName(vcl::CommandInfoProvider::GetModuleIdentifier(xFrame));
- bool bEditable = !mrContents.IsProtected() && !bReadOnly;
+ bool bEditable = !mrContents.IsProtected();
if (bEditable)
{
SfxItemSet aSet(mrContents.GetOutlinerView()->GetAttribs());