sc/source/ui/app/inputhdl.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
New commits: commit 9fc83ae4e479f7e6784dfdce87de35c283fbadd2 Author: Winfried Donkers <winfrieddonk...@libreoffice.org> Date: Thu Aug 7 11:37:02 2014 +0200 fdo#82241 fix autocompletion for calc functions with dot or underscore in function name Change-Id: Id460cad619098265b4ae000894df64a996ef0514 Reviewed-on: https://gerrit.libreoffice.org/10801 Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 91b4cac..050c254 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -1121,7 +1121,7 @@ void ScInputHandler::NextFormulaEntry( bool bBack ) } namespace { - + bool needToExtendSelection(const OUString& rSelectedText, const OUString& rInsertText) { SAL_DEBUG(rSelectedText); @@ -1138,12 +1138,12 @@ void completeFunction( EditView* pView, const OUString& rInsert, bool& rParInser pView->SetSelection(aSel); pView->SelectCurrentWord(); - // a dot is a word separator so we need special - // treatment for any formula containing a dot - if(rInsert.indexOf(".") != -1) + // a dot and underscore are word separators so we need special + // treatment for any formula containing a dot or underscore + if(rInsert.indexOf(".") != -1 || rInsert.indexOf("_") != -1) { // need to make sure that we replace also the part before the dot - // incrementally go through the word to find the match with the insert string + // go through the word to find the match with the insert string aSel = pView->GetSelection(); ESelection aOldSelection = aSel; OUString aSelectedText = pView->GetSelected(); @@ -1156,6 +1156,7 @@ void completeFunction( EditView* pView, const OUString& rInsert, bool& rParInser pView->SelectCurrentWord(); aSelectedText = pView->GetSelected(); } + aSel.nStartPos -= ( aSelectedText.getLength() - 1 ); aSel.nEndPos = aOldSelection.nEndPos; pView->SetSelection(aSel); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits