From aea7c6a01301a368e47a54cc85408bd9f34ace5a Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Wed, 27 Nov 2024 15:29:00 +0100 Subject: sd: Drop unnecessary non-zero check The second part of the condition already makes sure that the mark count is non-zero. Change-Id: I174bfc2ff3112616a63dda64f4435cd3d235343c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177424 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- sd/source/ui/view/drviews4.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'sd/source/ui/view/drviews4.cxx') diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index 6db20f982c80..55204c760178 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -646,8 +646,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) { // is something selected? const SdrMarkList& rMarkList(mpDrawView->GetMarkedObjectList()); - if (rMarkList.GetMarkCount() != 0 && - rMarkList.GetMarkCount() == 1 ) + if (rMarkList.GetMarkCount() == 1) { pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); if( HasCurrentFunction(SID_BEZIER_EDIT) && (dynamic_cast< SdrPathObj * >( pObj ) != nullptr ) ) @@ -788,8 +787,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) } // multiple selection - else if (rMarkList.GetMarkCount() != 0 && - rMarkList.GetMarkCount() > 1 ) + else if (rMarkList.GetMarkCount() > 1) { aPopupId = "multiselect"; } @@ -822,7 +820,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) const SdrMarkList& rMarkList(mpDrawView->GetMarkedObjectList()); //middle of the bounding rect if something is marked - if( rMarkList.GetMarkCount() != 0 && rMarkList.GetMarkCount() >= 1 ) + if (rMarkList.GetMarkCount() >= 1) { ::tools::Rectangle aMarkRect; rMarkList.TakeBoundRect(nullptr,aMarkRect); -- cgit