diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-08-17 15:44:39 -0400 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-08-22 06:45:19 +0000 |
commit | 2d7d1e59b908ee095e21a55101b380d2dc23008e (patch) | |
tree | 356d0c69cfb6d4b87196c6fa4b42edd1855991bd | |
parent | 1e49061273f1f64fe02e4ec916dc7b4b45207d21 (diff) |
fdo#48868: Allow Ctrl-TAB and Ctrl-Shift-TAB to cycle through candidates.
This applies to two scenarios: 1) cycling through cell values, and 2)
cycling through cell functions in a formula tip window. Both were broken
and this commit fixes both.
Change-Id: I7826efbada827b8ec3edc5f34a1876c84e5e6236
Reviewed-on: https://gerrit.libreoffice.org/441
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index ea0d8305b7cd..727799a99476 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -129,6 +129,7 @@ ScTypedCaseStrSet::const_iterator findText( size_t nPos = std::distance(rDataSet.begin(), itPos); size_t nRPos = rDataSet.size() - 1 - nPos; std::advance(it, nRPos); + ++it; } for (; it != itEnd; ++it) @@ -150,7 +151,10 @@ ScTypedCaseStrSet::const_iterator findText( { ScTypedCaseStrSet::const_iterator it = rDataSet.begin(), itEnd = rDataSet.end(); if (itPos != rDataSet.end()) + { it = itPos; + ++it; + } for (; it != itEnd; ++it) { @@ -1223,9 +1227,12 @@ void ScInputHandler::NextFormulaEntry( bool bBack ) if ( pActiveView && pFormulaData ) { rtl::OUString aNew; - miAutoPosFormula = findText(*pFormulaData, miAutoPosFormula, aAutoSearch, aNew, bBack); - if (miAutoPosFormula != pFormulaData->end()) - ShowTip( aNew ); // als QuickHelp anzeigen + ScTypedCaseStrSet::const_iterator itNew = findText(*pFormulaData, miAutoPosFormula, aAutoSearch, aNew, bBack); + if (itNew != pFormulaData->end()) + { + miAutoPosFormula = itNew; + ShowTip(aNew); // Display a quick help. + } } // bei Tab wird vorher immer HideCursor gerufen @@ -1633,9 +1640,13 @@ void ScInputHandler::NextAutoEntry( bool bBack ) if ( aSel.nEndPos == nParLen && aText.getLength() == aAutoSearch.getLength() + nSelLen ) { rtl::OUString aNew; - miAutoPosColumn = findText(*pColumnData, miAutoPosColumn, aAutoSearch, aNew, bBack); - if (miAutoPosColumn != pColumnData->end()) + ScTypedCaseStrSet::const_iterator itNew = + findText(*pColumnData, miAutoPosColumn, aAutoSearch, aNew, bBack); + + if (itNew != pColumnData->end()) { + // match found! + miAutoPosColumn = itNew; bInOwnChange = true; // disable ModifyHdl (reset below) lcl_RemoveLineEnd( aNew ); |