diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2018-02-21 21:29:50 +0530 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-02-21 17:21:47 +0100 |
commit | 7714ed1ee217f54fe6eb79493b20d366774d4f0a (patch) | |
tree | 3e87fc4960c7b75114e53d95ca692c84d56815a3 | |
parent | d490f99a5adcef52d847a65b233609b47f2a73b6 (diff) |
ime: Don't eat space
Encode/decode so that ' ' as payload of compositionupdate event doesn't
get lost.
Change-Id: Ia31abe85f1cf19f8f286c9069097bdc72297e664
(cherry picked from commit fc4d6aeeb9a14b6ff8c2b09cab8c2d358cd0e42d)
Reviewed-on: https://gerrit.libreoffice.org/50117
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r-- | kit/ChildSession.cpp | 5 | ||||
-rw-r--r-- | loleaflet/src/layer/tile/TileLayer.js | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index c98bbe48b..1613e2b30 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 a6fe4cbaf..f32f737d6 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -1374,7 +1374,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) { |