[Libreoffice-commits] online.git: kit/ChildSession.cpp loleaflet/src

Pranav Kant pranavk at collabora.co.uk
Wed Feb 21 16:10:13 UTC 2018


 kit/ChildSession.cpp                  |    5 ++++-
 loleaflet/src/layer/tile/TileLayer.js |    2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit fc4d6aeeb9a14b6ff8c2b09cab8c2d358cd0e42d
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Wed Feb 21 21:29:50 2018 +0530

    ime: Don't eat space
    
    Encode/decode so that ' ' as payload of compositionupdate event doesn't
    get lost.
    
    Change-Id: Ia31abe85f1cf19f8f286c9069097bdc72297e664

diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index ef9bfd3d..4b9199f8 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -785,9 +785,12 @@ bool ChildSession::extTextInputEvent(const char* /*buffer*/, int /*length*/,
         return false;
     }
 
+    std::string decodedText;
+    URI::decode(text, decodedText);
+
     std::unique_lock<std::mutex> lock(_docManager.getDocumentMutex());
     getLOKitDocument()->setView(_viewId);
-    getLOKitDocument()->postExtTextInputEvent(id, type, text.c_str());
+    getLOKitDocument()->postExtTextInputEvent(id, type, decodedText.c_str());
 
     return true;
 }
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 8cafab6b..72318ae1 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1470,7 +1470,7 @@ L.TileLayer = L.GridLayer.extend({
 
 	// if winId=0, then event is posted on the document
 	_postCompositionEvent: function(winId, type, text) {
-		this._map._socket.sendMessage('textinput id=' + winId + ' type=' + type + ' text=' + text);
+		this._map._socket.sendMessage('textinput id=' + winId + ' type=' + type + ' text=' + encodeURIComponent(text));
 	},
 
 	_postSelectGraphicEvent: function(type, x, y) {


More information about the Libreoffice-commits mailing list