diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-10-06 15:01:14 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-10-28 21:22:08 +0100 |
commit | 4b1d4d6cac7cda998f5219858353866f85a44933 (patch) | |
tree | ed1acfb41ef3cc0db3d323afd09f4a1087dc159b /vcl/source | |
parent | 268a82d43425534761ef243d9204bfe4f4d3abc6 (diff) |
cid#1607898 silence Overflowed constant
Change-Id: Ief9b09c5db8ef687c50ab12894d59056be85e8b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175728
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/window/menufloatingwindow.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index 16af78719e55..7de7a5801282 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -972,8 +972,8 @@ void MenuFloatingWindow::ImplCursorUpDown( bool bUp, bool bHomeEnd ) } else { - n = sal_uInt16(-1); - nLoop = n+1; + n = ITEMPOS_INVALID; + nLoop = 0; } } @@ -991,7 +991,7 @@ void MenuFloatingWindow::ImplCursorUpDown( bool bUp, bool bHomeEnd ) } else { - n++; + n = (n == ITEMPOS_INVALID) ? 0 : n + 1; if ( n >= pMenu->GetItemCount() ) { if ( !IsScrollMenu() || ( nHighlightedItem == ITEMPOS_INVALID ) ) |