diff options
author | kumar <kumarr908@gmail.com> | 2016-01-21 18:41:50 +0530 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-02-03 15:28:15 +0000 |
commit | 94aff0c21989e8be46b1676cef4d2a1db61752d3 (patch) | |
tree | 32de6c9b385a9d04581f9c18ff5e7f0b8921b9a6 | |
parent | 403ca446458268ae04d42f666223974f525e8df8 (diff) |
tdf#93936:while creating formula comma appends incorrectly using Ctrl key
Change-Id: I6d0e210f11e52dd16cbd61b1da22d79064796efc
Reviewed-on: https://gerrit.libreoffice.org/21667
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 98783dcbfd7d..d567842f09c6 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -2975,10 +2975,20 @@ void ScInputHandler::AddRefEntry() DataChanging(); // Cannot be new RemoveSelection(); - if (pTableView) - pTableView->InsertText( OUString(cSep) ); - if (pTopView) - pTopView->InsertText( OUString(cSep) ); + OUString aText = GetEditText(pEngine); + sal_Unicode cLastChar = 0; + sal_Int32 nPos = aText.getLength() - 1; + while (nPos >= 0 && ((cLastChar = aText[nPos]) == ' ')) //checking space + --nPos; + + bool bAppendSeparator = (cLastChar != '(' && cLastChar != cSep && cLastChar != '='); + if (bAppendSeparator) + { + if (pTableView) + pTableView->InsertText( OUString(cSep) ); + if (pTopView) + pTopView->InsertText( OUString(cSep) ); + } DataChanged(); } |