sc/source/ui/view/output.cxx | 7 +++---- sd/source/ui/annotations/annotationwindow.cxx | 13 ++++++------- 2 files changed, 9 insertions(+), 11 deletions(-)
New commits: commit 3be6d3182d023723f4c382c5c30d53797a9036a6 Author: Xisco Fauli <[email protected]> AuthorDate: Wed Nov 27 12:10:23 2024 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Wed Nov 27 13:22:12 2024 +0100 PVS: V560 A part of conditional expression is always true: !bReadOnly Since commit a39a3f1ad1e5e39b09ce474c0f4c0f9f4e174bbe Author: Caolán McNamara <[email protected]> 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 <[email protected]> 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()); commit e1967187957e1e4b56962564a81917d0ba92cac0 Author: Xisco Fauli <[email protected]> AuthorDate: Wed Nov 27 11:56:46 2024 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Wed Nov 27 13:22:00 2024 +0100 PVS: V560 A part of conditional expression is always true: !bSingle Since commit 5a725d1fde7381ef9c02afcb639235a11e52182c Author: Noel Grandin <[email protected]> Date: Tue Mar 28 15:27:36 2017 +0200 loplugin:singlevalfields Change-Id: I5fabc0537f385531fedb34a0becf69e480d39394 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177404 Reviewed-by: Xisco Fauli <[email protected]> Tested-by: Jenkins diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 2fa575982783..ddf3dd5e0b78 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -361,7 +361,6 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool ScBreakType nBreak = ScBreakType::NONE; ScBreakType nBreakOld = ScBreakType::NONE; - bool bSingle; bool bDashed = false; Color aPageColor; Color aManualColor; @@ -469,8 +468,8 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool bool bDraw = bGrid || nBreakOld != ScBreakType::NONE || bMergeCover; // simple grid only if set that way sal_uInt16 nWidthXplus1 = pRowInfo[0].basicCellInfo(nX+1).nWidth; - bSingle = false; //! get into Fillinfo !!!!! - if ( nX<mpDoc->MaxCol() && !bSingle ) + bool bSingle = false; //! get into Fillinfo !!!!! + if ( nX<mpDoc->MaxCol() ) { bSingle = ( nWidthXplus1 == 0 ); for (nArrY=1; nArrY+1<nArrCount && !bSingle; nArrY++) @@ -586,7 +585,7 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool bool bDraw = bGrid || nBreakOld != ScBreakType::NONE || bMergeCover; // simple grid only if set so bool bNextYisNextRow = (pRowInfo[nArrYplus1].nRowNo == nYplus1); - bSingle = !bNextYisNextRow; // Hidden + bool bSingle = !bNextYisNextRow; // Hidden for (SCCOL i=nX1; i<=nX2 && !bSingle; i++) { if (pRowInfo[nArrYplus1].cellInfo(i).bVOverlapped)
