fix: undo + sheet switch breaks cursors

Fix description:
Doing an undo causes core to do switch sheets if last change was in some
other sheet. But core sends status message with changed sheet number, so
ask for sheetGeometryData for this selected sheet if the sheetGeometry
we have is not for that sheet.

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I6870bed86e0ffa234d659b8853a9ef9a33e02bc5
pull/1759/head
Dennis Francis 2021-03-18 15:44:25 +05:30 committed by Dennis Francis
parent 75e9889789
commit 09c30c0cac
1 changed files with 8 additions and 0 deletions

View File

@ -516,6 +516,10 @@ L.CalcTileLayer = L.CanvasTileLayer.extend({
this._docType = command.type;
this._parts = command.parts;
this._selectedPart = command.selectedPart;
if (this.sheetGeometry && this._selectedPart != this.sheetGeometry.getPart()) {
// Core initiated sheet switch, need to get full sheetGeometry data for the selected sheet.
this.requestSheetGeometryData();
}
this._viewId = parseInt(command.viewid);
var mapSize = this._map.getSize();
var sizePx = this._twipsToPixels(new L.Point(this._docWidthTwips, this._docHeightTwips));
@ -1275,6 +1279,10 @@ L.SheetGeometry = L.Class.extend({
return true;
},
getPart: function () {
return this._part;
},
getColumnsGeometry: function () {
return this._columns;
},