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

Dennis Francis (via logerrit) logerrit at kemper.freedesktop.org
Sun Jul 5 14:27:06 UTC 2020


 loleaflet/src/layer/tile/CalcTileLayer.js |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 2d8f0d5a6fe09e84e1f6eb9a35bf135620feef6f
Author:     Dennis Francis <dennis.francis at collabora.com>
AuthorDate: Thu May 21 23:30:04 2020 +0530
Commit:     Dennis Francis <dennis.francis at collabora.com>
CommitDate: Sun Jul 5 16:26:46 2020 +0200

    Supress multiple .uno:SheetGeometryData requests...
    
    at document load till we get a response, by using flag.
    
    Change-Id: I6296d6e18a122ee3cb714f26c019f9080c7febc7
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98101
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Dennis Francis <dennis.francis at collabora.com>

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js
index 35a887817..1f9b8d966 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -530,8 +530,10 @@ L.CalcTileLayer = L.TileLayer.extend({
 			return;
 		}
 
-		this.sheetGeometry.setViewArea(pos, size);
-		this._updateHeadersGridLines(undefined, updateCols, updateRows);
+		if (this.sheetGeometry) {
+			this.sheetGeometry.setViewArea(pos, size);
+			this._updateHeadersGridLines(undefined, updateCols, updateRows);
+		}
 	},
 
 	// This send .uno:ViewRowColumnHeaders command to core with the new view coordinates (tile-twips).
@@ -545,6 +547,13 @@ L.CalcTileLayer = L.TileLayer.extend({
 
 	// sends the .uno:SheetGeometryData command optionally with arguments.
 	requestSheetGeometryData: function (flags) {
+		if (!this.sheetGeometry) {
+			// Supress multiple requests at document load, till we get a response.
+			if (this._sheetGeomFirstWait === true) {
+				return;
+			}
+			this._sheetGeomFirstWait = true;
+		}
 		var unoCmd = '.uno:SheetGeometryData';
 		var haveArgs = (typeof flags == 'object' &&
 			(flags.columns === true || flags.rows === true || flags.all === true));
@@ -599,6 +608,7 @@ L.CalcTileLayer = L.TileLayer.extend({
 
 	_handleSheetGeometryDataMsg: function (jsonMsgObj) {
 		if (!this.sheetGeometry) {
+			this._sheetGeomFirstWait = false;
 			this.sheetGeometry = new L.SheetGeometry(jsonMsgObj,
 				this._tileWidthTwips, this._tileHeightTwips,
 				this._tileSize, this._tilePixelScale);


More information about the Libreoffice-commits mailing list