loleaflet/src/control/Control.LokDialog.js |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 0f8402bd5a3c2e9e4f52c4d15842a1b175e8eee3
Author:     Marco Cecchetti <marco.cecche...@collabora.com>
AuthorDate: Wed Jan 1 20:49:33 2020 +0100
Commit:     Marco Cecchetti <marco.cecche...@collabora.com>
CommitDate: Mon Jan 6 09:59:05 2020 +0100

    loleaflet: reverse insertion when entering text in formula bar
    
    This patch fixes the following issue:
    
    - Open a spreadsheet.
    - Enter a few chars in a cell, and press enter.
    - Go back to the cell, and in the formula bar, enter more text.
    
    => Characters are inserted backwards.
    
    Change-Id: I6930fab44c6cacdd4710d363ca3bf15d564b64e4
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86100
    Reviewed-by: Marco Cecchetti <marco.cecche...@collabora.com>
    Tested-by: Marco Cecchetti <marco.cecche...@collabora.com>

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 2e1e52d90..d4040aadc 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -879,9 +879,10 @@ L.Control.LokDialog = L.Control.extend({
                }
 
                $('#sidebar-dock-wrapper').css({display: ''});
-               this._map.fire('editorgotfocus');
-               this._map.focus();
-
+               if (this._map.getWinId() === 0) {
+                       this._map.fire('editorgotfocus');
+                       this._map.focus();
+               }
        },
 
        _onCalcInputBarClose: function(dialogId) {
@@ -1073,8 +1074,10 @@ L.Control.LokDialog = L.Control.extend({
                this._adjustCalcInputBar(deckOffset);
                // If we didn't have the focus, don't steal it form the editor.
                if ($('#' + this._currentDeck.strId + '-cursor').css('display') 
=== 'none') {
-                       this._map.fire('editorgotfocus');
-                       this._map.focus();
+                       if (this._map.getWinId() === 0) {
+                               this._map.fire('editorgotfocus');
+                               this._map.focus();
+                       }
                }
        },
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to