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

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 17 14:02:02 UTC 2020


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

New commits:
commit f6667cfea18fb3aa6bc8a5769da5994a7e06e322
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Thu Jul 16 15:51:06 2020 -0400
Commit:     Henry Castro <hcastro at 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 <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Henry Castro <hcastro at 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) {


More information about the Libreoffice-commits mailing list