summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinfried Donkers <winfrieddonkers@libreoffice.org>2014-08-07 11:37:02 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-08-07 15:46:18 +0000
commit9fc83ae4e479f7e6784dfdce87de35c283fbadd2 (patch)
tree60d2ddd1a56fe477ef2dcb83d8726dd23cd34f4b
parent38a3d53d8b9e6dd66c19f721be9b4b3e350eb249 (diff)
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.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--sc/source/ui/app/inputhdl.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 91b4cac5dd78..050c254031f2 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);
}