toolkit/inc/controls/table/tablecontrolinterface.hxx  |    5 +----
 toolkit/source/controls/table/defaultinputhandler.cxx |   12 ++++--------
 2 files changed, 5 insertions(+), 12 deletions(-)

New commits:
commit 8c330cd741a55546ee7fdf416600d3f44dd2a40a
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Aug 2 13:10:44 2023 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Aug 3 16:54:23 2023 +0200

    toolkit: Use range-based for, drop invalidTableControlAction
    
    The `invalidTableControlAction` enum value was apparently
    only used to detect when to stop the iteration and is
    no longer, so drop it.
    
    Change-Id: Idec6572a9f328b246445191f0a3e6a131bb0f688
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155229
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/toolkit/inc/controls/table/tablecontrolinterface.hxx 
b/toolkit/inc/controls/table/tablecontrolinterface.hxx
index 008fe9b2b293..8f5dca676375 100644
--- a/toolkit/inc/controls/table/tablecontrolinterface.hxx
+++ b/toolkit/inc/controls/table/tablecontrolinterface.hxx
@@ -64,10 +64,7 @@ namespace svt::table
         /// selects the row, from the actual cursor till top
         cursorSelectRowAreaTop,
         /// selects the row, from the actual cursor till bottom
-        cursorSelectRowAreaBottom,
-
-        /// invalid and final enumeration value, not to be actually used
-        invalidTableControlAction
+        cursorSelectRowAreaBottom
     };
 
 
diff --git a/toolkit/source/controls/table/defaultinputhandler.cxx 
b/toolkit/source/controls/table/defaultinputhandler.cxx
index ef1ff3c51c60..171458ef7acf 100644
--- a/toolkit/source/controls/table/defaultinputhandler.cxx
+++ b/toolkit/source/controls/table/defaultinputhandler.cxx
@@ -145,17 +145,13 @@ namespace svt::table
             { KEY_UP,       KEY_SHIFT,  cursorSelectRowUp },
             { KEY_DOWN,     KEY_SHIFT,  cursorSelectRowDown },
             { KEY_END,      KEY_SHIFT,  cursorSelectRowAreaBottom },
-            { KEY_HOME,     KEY_SHIFT,  cursorSelectRowAreaTop },
-
-            { 0, 0, invalidTableControlAction }
+            { KEY_HOME,     KEY_SHIFT,  cursorSelectRowAreaTop }
         };
-
-        const ActionMapEntry* pActions = aKnownActions;
-        for ( ; pActions->eAction != invalidTableControlAction; ++pActions )
+        for (const ActionMapEntry& rAction : aKnownActions)
         {
-            if ( ( pActions->nKeyCode == nKeyCode ) && ( 
pActions->nKeyModifier == rKeyCode.GetModifier() ) )
+            if ( ( rAction.nKeyCode == nKeyCode ) && ( rAction.nKeyModifier == 
rKeyCode.GetModifier() ) )
             {
-                bHandled = _rControl.dispatchAction( pActions->eAction );
+                bHandled = _rControl.dispatchAction( rAction.eAction );
                 break;
             }
         }

Reply via email to