[Libreoffice-commits] core.git: sc/source

kumar kumarr908 at gmail.com
Wed Feb 3 15:28:52 UTC 2016


 sc/source/ui/app/inputhdl.cxx |   18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

New commits:
commit 94aff0c21989e8be46b1676cef4d2a1db61752d3
Author: kumar <kumarr908 at gmail.com>
Date:   Thu Jan 21 18:41:50 2016 +0530

    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 at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 98783dc..d567842 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();
 }


More information about the Libreoffice-commits mailing list