sc/source/ui/app/inputhdl.cxx | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-)
New commits: commit ccbbd6bac6aaf5691a66a56b82d2592153336191 Author: Dennis Francis <dennis.fran...@collabora.com> AuthorDate: Wed May 19 20:17:01 2021 +0530 Commit: Dennis Francis <dennis.fran...@collabora.com> CommitDate: Tue Jun 1 10:16:19 2021 +0200 autocomplete: allow cycling through possible matches Change-Id: I4a4b11312f36885d1c6fbe43c4850d55293b2557 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115859 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Luboš Luňák <l.lu...@collabora.com> Reviewed-by: Dennis Francis <dennis.fran...@collabora.com> diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 91a5679ddcf2..d274f713334e 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -1952,6 +1952,7 @@ void ScInputHandler::UseColData() // When typing miAutoPosColumn = pColumnData->end(); miAutoPosColumn = findTextAll(*pColumnData, miAutoPosColumn, aText, aResultVec, false, 2); bool bShowCompletion = (aResultVec.size() == 1); + bUseTab = (aResultVec.size() == 2); if (bShowCompletion) { assert(miAutoPosColumn != pColumnData->end()); @@ -1984,18 +1985,14 @@ void ScInputHandler::UseColData() // When typing pTopView->SetSelection( aSelection ); } - aAutoSearch = aText; // To keep searching - nAutoPos is set - - if (aText.getLength() == aNew.getLength()) - { - // If the inserted text is found, consume TAB only if there's more coming - OUString aDummy; - ScTypedCaseStrSet::const_iterator itNextPos = - findText(*pColumnData, miAutoPosColumn, aText, aDummy, false); - bUseTab = itNextPos != pColumnData->end(); - } - else - bUseTab = true; + aAutoSearch = aText; + } + else if (bUseTab) + { + // Allow cycling through possible matches using shortcut. + // Make miAutoPosColumn invalid so that Ctrl+TAB provides the first matching one. + miAutoPosColumn = pColumnData->end(); + aAutoSearch = aText; } } } @@ -2008,7 +2005,7 @@ void ScInputHandler::NextAutoEntry( bool bBack ) EditView* pActiveView = pTopView ? pTopView : pTableView; if ( pActiveView && pColumnData ) { - if (miAutoPosColumn != pColumnData->end() && !aAutoSearch.isEmpty()) + if (!aAutoSearch.isEmpty()) { // Is the selection still valid (could be changed via the mouse)? ESelection aSel = pActiveView->GetSelection(); @@ -3636,7 +3633,7 @@ bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, bool bStartEdit /* = false NextFormulaEntry( bShift ); bUsed = true; } - else if (pColumnData && bUseTab && miAutoPosColumn != pColumnData->end()) + else if (pColumnData && bUseTab) { // Iterate through AutoInput entries NextAutoEntry( bShift ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits