sc/source/ui/app/inputhdl.cxx | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-)
New commits: commit 299227ad81d4a44556fda8cca7b8b79219ba7e6c Author: Dennis Francis <dennis.fran...@collabora.com> AuthorDate: Wed May 19 20:17:01 2021 +0530 Commit: Dennis Francis <dennis.fran...@collabora.com> CommitDate: Wed Jun 9 09:30:45 2021 +0200 autocomplete: allow cycling through possible matches Conflicts: sc/source/ui/app/inputhdl.cxx 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> (cherry picked from commit ccbbd6bac6aaf5691a66a56b82d2592153336191) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116539 Tested-by: Jenkins diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 194049e999e8..a8bf4a39e8f9 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -1975,6 +1975,16 @@ 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 (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; + return; + } + if (!bShowCompletion) return; @@ -2009,17 +2019,6 @@ void ScInputHandler::UseColData() // When typing } 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; } void ScInputHandler::NextAutoEntry( bool bBack ) @@ -2027,7 +2026,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(); @@ -3659,7 +3658,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