diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2019-11-27 22:53:38 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-12-03 07:28:36 +0100 |
commit | e5367efbd15e1d97f8d4de232df1c325d8fff2b8 (patch) | |
tree | ff58530755848954e76b4b16eb30b8d261fc2c29 /sc/source/ui/app | |
parent | 9bbdf2273394f7b9d619973cb8a73e7f846c334f (diff) |
lok: formula bar: function completion
lok clients can request to complete a function name partially typed in
the formula input box.
Change-Id: I8771fd4d2a7f79c20138d9183162da23a92f2ba4
Reviewed-on: https://gerrit.libreoffice.org/83984
Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Tested-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/84258
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sc/source/ui/app')
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 2d03cdecb5df..e8c8ebd0c669 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <iterator> #include <memory> #include <string_view> @@ -1574,6 +1575,21 @@ void ScInputHandler::PasteFunctionData() pActiveView->ShowCursor(); } +void ScInputHandler::LOKPasteFunctionData( sal_uInt32 nIndex ) +{ + if (pFormulaData && miAutoPosFormula != pFormulaData->end() && nIndex < pFormulaData->size()) + { + auto aPos = pFormulaData->begin(); + sal_uInt32 nCurIndex = std::distance(aPos, miAutoPosFormula); + nIndex += nCurIndex; + if (nIndex >= pFormulaData->size()) + nIndex -= pFormulaData->size(); + std::advance(aPos, nIndex); + miAutoPosFormula = aPos; + PasteFunctionData(); + } +} + // Calculate selection and display as tip help static OUString lcl_Calculate( const OUString& rFormula, ScDocument* pDoc, const ScAddress &rPos ) { |