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

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


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

New commits:
commit fbae86ca65f8de53e3f1333fb452e3a1270e895f
Author:     Dennis Francis <dennis.francis at collabora.com>
AuthorDate: Thu May 21 16:09:39 2020 +0530
Commit:     Dennis Francis <dennis.francis at collabora.com>
CommitDate: Sun Jul 5 16:25:34 2020 +0200

    handle 'invalidatesheetgeometry' message
    
    and use it to fetch the changed sheet geometry data and update the view.
    
    Change-Id: I5a72012ce08f23e456cd64388e22385872f665a5
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98099
    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 3e6453e26..35a887817 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -279,6 +279,14 @@ L.CalcTileLayer = L.TileLayer.extend({
 			this.refreshViewData({x: this._map._getTopLeftPoint().x, y: this._map._getTopLeftPoint().y,
 				offset: {x: undefined, y: undefined}}, true /* compatDataSrcOnly */);
 			this._map._socket.sendMessage('commandvalues command=.uno:ViewAnnotationsPosition');
+		} else if (this.options.sheetGeometryDataEnabled &&
+				textMsg.startsWith('invalidatesheetgeometry:')) {
+			var params = textMsg.substring('invalidatesheetgeometry:'.length).trim().split(' ');
+			var flags = {};
+			params.forEach(function (param) {
+				flags[param] = true;
+			});
+			this.requestSheetGeometryData(flags);
 		} else {
 			L.TileLayer.prototype._onMessage.call(this, textMsg, img);
 		}
@@ -539,16 +547,16 @@ L.CalcTileLayer = L.TileLayer.extend({
 	requestSheetGeometryData: function (flags) {
 		var unoCmd = '.uno:SheetGeometryData';
 		var haveArgs = (typeof flags == 'object' &&
-			(flags.columns === true || flags.rows === true) &&
-			(flags.columns !== flags.rows));
+			(flags.columns === true || flags.rows === true || flags.all === true));
 		var payload = 'commandvalues command=' + unoCmd;
 
 		if (haveArgs) {
 			var argList = [];
-			if (flags.columns === true) {
+			var both = (flags.all === true);
+			if (both || flags.columns === true) {
 				argList.push('columns=1');
 			}
-			if (flags.rows === true) {
+			if (both || flags.rows === true) {
 				argList.push('rows=1');
 			}
 


More information about the Libreoffice-commits mailing list