vcl/source/window/menubarwindow.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
New commits: commit 1f41481fe987b3c183ac3edbd946ecff38721a79 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sun Oct 6 15:02:43 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Fri Nov 29 11:40:53 2024 +0100 cid#1607551 silence Overflowed constant Change-Id: I128a60a312fe15a3333bd7dad37257c80fb20d70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177521 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index db9781a537be..9062e9952d9e 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -778,10 +778,16 @@ bool MenuBarWindow::HandleKeyEvent( const KeyEvent& rKEvent, bool bFromMenu ) sal_uInt16 nLoop = n; - if( nCode == KEY_HOME ) - { n = sal_uInt16(-1); nLoop = n+1; } - if( nCode == KEY_END ) - { n = m_pMenu->GetItemCount(); nLoop = n-1; } + if (nCode == KEY_HOME) + { + n = ITEMPOS_INVALID; + nLoop = 0; + } + else if (nCode == KEY_END) + { + n = m_pMenu->GetItemCount(); + nLoop = n-1; + } do {