vcl/source/control/imivctl.hxx | 2 +- vcl/source/control/imivctl1.cxx | 2 +- vcl/source/control/imivctl2.cxx | 23 +++++++++++++++++------ 3 files changed, 19 insertions(+), 8 deletions(-)
New commits: commit 5cf85ec7af074e100caa9b82cc282727c8ec948a Author: Heiko Tietze <[email protected]> AuthorDate: Wed Nov 12 09:15:30 2025 +0100 Commit: Heiko Tietze <[email protected]> CommitDate: Wed Nov 12 13:24:21 2025 +0100 Resolves tdf#169395 - Make ctrl+tab wrap around on VT Change-Id: Ieae483ca3c2fc69e82de93b11e2638d0b1da784d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193838 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index a99c54605aa4..6c8dc43dcc55 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -321,7 +321,7 @@ public: // for Cursortravelling etc. SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, bool bRight ); - SvxIconChoiceCtrlEntry* GoUpDown( const SvxIconChoiceCtrlEntry*, bool bDown ); + SvxIconChoiceCtrlEntry* GoUpDown( const SvxIconChoiceCtrlEntry*, bool bDown, bool bWrap = false); SvxIconChoiceCtrlEntry* GoPageUpDown( const SvxIconChoiceCtrlEntry*, bool bDown ); }; diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 8cc63ecec625..6760ee2e2583 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -538,7 +538,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) { MakeEntryVisible( pCursor ); const bool bDown = !rKEvt.GetKeyCode().IsShift(); - pNewCursor = pImpCursor->GoUpDown(pCursor, bDown); + pNewCursor = pImpCursor->GoUpDown(pCursor, bDown, true); SetCursor_Impl(pNewCursor); if( !pNewCursor ) { diff --git a/vcl/source/control/imivctl2.cxx b/vcl/source/control/imivctl2.cxx index 989343d5fdbb..6a328343053e 100644 --- a/vcl/source/control/imivctl2.cxx +++ b/vcl/source/control/imivctl2.cxx @@ -353,13 +353,24 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( const SvxIconChoiceCtrlEnt return nullptr; } -SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( const SvxIconChoiceCtrlEntry* pCtrlEntry, bool bDown) +SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown(const SvxIconChoiceCtrlEntry* pCtrlEntry, + bool bDown, bool bWrap /* = false */) { - sal_uLong nPos = pView->GetEntryListPos( pCtrlEntry ); - if( bDown && nPos < (pView->maEntries.size() - 1) ) - return pView->maEntries[ nPos + 1 ].get(); - else if( !bDown && nPos > 0 ) - return pView->maEntries[ nPos - 1 ].get(); + sal_uLong nPos = pView->GetEntryListPos(pCtrlEntry); + if (bDown) + { + if (nPos < (pView->maEntries.size() - 1)) + return pView->maEntries[nPos + 1].get(); + else if (bWrap) + return pView->maEntries.front().get(); + } + else //!bDown + { + if (nPos > 0) + return pView->maEntries[nPos - 1].get(); + else if (bWrap) + return pView->maEntries.back().get(); + } return nullptr; }
