summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2020-05-21 16:09:39 +0530
committerDennis Francis <dennis.francis@collabora.com>2020-05-25 00:52:44 +0530
commit339be9e5470197b960c372bdd819b5b91811c95a (patch)
treeca78416611f97fbdc6e3c4a408eb9c63e7797378
parentIgnore the "invalidateheader:" msgs when... (diff)
downloadonline-339be9e5470197b960c372bdd819b5b91811c95a.tar.gz
online-339be9e5470197b960c372bdd819b5b91811c95a.zip
handle 'invalidatesheetgeometry' message
and use it to fetch the changed sheet geometry data and update the view. Change-Id: I5a72012ce08f23e456cd64388e22385872f665a5
-rw-r--r--loleaflet/src/layer/tile/CalcTileLayer.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js
index b261ebadc3..e8a2c47bda 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');
}