summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-08-17 15:44:39 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-08-17 15:46:55 -0400
commite704e4691186c23e52490817d6b710ef5bf68db6 (patch)
tree22217f60edd4cdf92af68dff0ea1a7e639deab82
parentb798de319da3ce6adc83941cf59e001084ba8424 (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
-rw-r--r--sc/source/ui/app/inputhdl.cxx21
1 files changed, 16 insertions, 5 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 05d1649d6fd7..78fd03e5c3ea 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -125,6 +125,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)
@@ -146,7 +147,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)
{
@@ -1219,9 +1223,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
@@ -1630,9 +1637,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 );