sd/source/ui/view/drviews4.cxx |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit aea7c6a01301a368e47a54cc85408bd9f34ace5a
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Nov 27 15:29:00 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Nov 27 17:23:49 2024 +0100

    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 <m.wegh...@posteo.de>
    Tested-by: Jenkins

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);

Reply via email to