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

Dennis Francis (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 24 13:29:46 UTC 2020


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

New commits:
commit b43ac38e857d6b2afcabc6c680a11c8e5eea71fd
Author:     Dennis Francis <dennis.francis at collabora.com>
AuthorDate: Wed Jul 22 13:27:54 2020 +0530
Commit:     Dennis Francis <dennis.francis at collabora.com>
CommitDate: Fri Jul 24 15:29:26 2020 +0200

    split-panes: introduce 'syncSplits' boolean flag
    
    The default is true.
    
    If set to false the splits created by a user are independent and are not
    synced with other users who are on the same sheet.
    
    Change-Id: Ia2abe8557a448e0029540a85896b913dba5c5e8b
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99369
    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 6a4db23b5..0c25bd78a 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -8,7 +8,8 @@ L.CalcTileLayer = (L.Browser.mobile ? L.TileLayer : L.CanvasTileLayer).extend({
 	options: {
 		// TODO: sync these automatically from SAL_LOK_OPTIONS
 		sheetGeometryDataEnabled: true,
-		printTwipsMsgsEnabled: true
+		printTwipsMsgsEnabled: true,
+		syncSplits: true, // if false, the splits/freezes are not synced with other users viewing the same sheet.
 	},
 
 	STD_EXTRA_WIDTH: 113, /* 2mm extra for optimal width,
@@ -811,6 +812,10 @@ L.CalcTileLayer = (L.Browser.mobile ? L.TileLayer : L.CanvasTileLayer).extend({
 		// This stores the current split-cell state of core, so this should not be modified.
 		this._splitCellState[isSplitCol ? 'x' : 'y'] = newSplitIndex;
 
+		if (!this.options.syncSplits) {
+			return;
+		}
+
 		var changed = isSplitCol ? this._splitPanesContext.setSplitCol(newSplitIndex) :
 			this._splitPanesContext.setSplitRow(newSplitIndex);
 
@@ -821,7 +826,7 @@ L.CalcTileLayer = (L.Browser.mobile ? L.TileLayer : L.CanvasTileLayer).extend({
 
 	sendSplitIndex: function (newSplitIndex, isSplitCol) {
 
-		if (!this._map.isPermissionEdit() || !this._splitCellState) {
+		if (!this._map.isPermissionEdit() || !this._splitCellState || !this.options.syncSplits) {
 			return false;
 		}
 


More information about the Libreoffice-commits mailing list