loleaflet/src/layer/tile/TileLayer.js |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit f6667cfea18fb3aa6bc8a5769da5994a7e06e322
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Thu Jul 16 15:51:06 2020 -0400
Commit:     Henry Castro <hcas...@collabora.com>
CommitDate: Fri Jul 17 16:01:41 2020 +0200

    loleaflet: no scroll if editing a cell formula
    
    Change-Id: I2b1bca30c795043c7172dd080e51cfe37c0dc008
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98931
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Henry Castro <hcas...@collabora.com>

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 7a370575e..2bbfd3c8f 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -781,6 +781,10 @@ L.TileLayer = L.GridLayer.extend({
                }
        },
 
+       _isEditFormula: function () {
+               return this._lastFormula && this._map._isCursorVisible;
+       },
+
        _onCellAddressMsg: function (textMsg) {
                // When the user moves the focus to a different cell, a 
'cellformula'
                // message is received from lowsd, *then* a 'celladdress' 
message.
@@ -2266,8 +2270,9 @@ L.TileLayer = L.GridLayer.extend({
                                center.y = Math.round(center.y < 0 ? 0 : 
center.y);
 
                                if (!(this._selectionHandles.start && 
this._selectionHandles.start.isDragged) &&
-                                       !(this._selectionHandles.end && 
this._selectionHandles.end.isDragged) &&
-                                       !(docLayer._followEditor || 
docLayer._followUser)) {
+                                   !(this._selectionHandles.end && 
this._selectionHandles.end.isDragged) &&
+                                   !(docLayer._followEditor || 
docLayer._followUser) &&
+                                   !this._isEditFormula()) {
                                        this._map.fire('scrollto', {x: 
center.x, y: center.y, calledFromInvalidateCursorMsg: scroll !== undefined});
                                }
                        }
@@ -2970,7 +2975,8 @@ L.TileLayer = L.GridLayer.extend({
                                
this._map.dialog._updateTextSelection(inputBarId);
                        }
                        var mapBounds = this._map.getBounds();
-                       if (!this._cellCursorXY.equals(this._prevCellCursorXY)) 
{
+                       if (!this._cellCursorXY.equals(this._prevCellCursorXY) 
&&
+                           !this._isEditFormula()) {
                                var scroll = 
this._calculateScrollForNewCellCursor();
                                console.assert(scroll instanceof L.LatLng, 
'_calculateScrollForNewCellCursor returned wrong type');
                                if (scroll.lng !== 0 || scroll.lat !== 0) {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to