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

2020-07-06 Thread Tor Lillqvist (via logerrit)
 loleaflet/src/map/Map.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 24a0c7c3dccb5005f5d2f0ee02a88a989870a922
Author: Tor Lillqvist 
AuthorDate: Mon Jul 6 11:59:27 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Mon Jul 6 11:42:38 2020 +0200

Return early in L.Map.showBusy() in the iOS app, too

Change-Id: If4d76601ed618a2e52f3dd1a116d03835c2342e7
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98194
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 0cd8f9282..b02638aaf 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -445,7 +445,7 @@ L.Map = L.Evented.extend({
},
 
showBusy: function(label, bar) {
-   if (window.ThisIsTheAndroidApp)
+   if (window.ThisIsTheAndroidApp || window.ThisIsTheiOSApp)
return;
 
// If document is already loaded, ask the toolbar widget to 
show busy
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |  125 ++
 loleaflet/src/layer/tile/TileLayer.js |   14 ++-
 2 files changed, 135 insertions(+), 4 deletions(-)

New commits:
commit e0eca220541fcd8d9ab236e6a274f00e256cc2e7
Author: Dennis Francis 
AuthorDate: Thu May 28 06:41:23 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 16:39:53 2020 +0200

Replay print-twips messages for a couple of reasons...

If L.CalcTileLayer.options.printTwipsMsgsEnabled is set, we will not get
some messages (with coordinates) from core when zoom changes because
print-twips coordinates are zoom-invariant. So we need to remember the
last version of each of them and replay, when zoom is changed.  We also
need to replay the messages, when sheet-geometry changes. This is
because it is possible for the updated print-twips messages to arrive
before the sheet-geometry update message arrives.

Change-Id: Icd77ad77c7642aae24e68fb0b7f229c7ec62484a
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98114
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index db08b2019..f37caa6c5 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -238,7 +238,60 @@ L.CalcTileLayer = L.TileLayer.extend({
}
},
 
+   _saveMessageForReplay: function (textMsg, viewId) {
+   // If this.options.printTwipsMsgsEnabled is set, we will not 
get some messages (with coordinates)
+   // from core when zoom changes because print-twips coordinates 
are zoom-invariant. So we need to
+   // remember the last version of them and replay, when zoom is 
changed.
+   // We also need to replay the messages, when sheet-geometry 
changes. This is because it is possible for
+   // the updated print-twips messages to arrive before the 
sheet-geometry update message arrives.
+   if (!this.options.printTwipsMsgsEnabled) {
+   return;
+   }
+
+   if (!this._printTwipsMessagesForReplay) {
+   var ownViewTypes = [
+   'cellcursor',
+   'referencemarks',
+   'cellselectionarea',
+   'textselection',
+   ];
+
+   var otherViewTypes = [
+   'cellviewcursor',
+   'textviewselection',
+   ];
+
+   this._printTwipsMessagesForReplay = new 
L.MessageStore(ownViewTypes, otherViewTypes);
+   }
+
+   var colonIndex = textMsg.indexOf(':');
+   if (colonIndex === -1) {
+   return;
+   }
+
+   var msgType = textMsg.substring(0, colonIndex);
+   this._printTwipsMessagesForReplay.save(msgType, textMsg, 
viewId);
+   },
+
+   _clearMsgReplayStore: function () {
+   if (!this.options.printTwipsMsgsEnabled || 
!this._printTwipsMessagesForReplay) {
+   return;
+   }
+
+   this._printTwipsMessagesForReplay.clear();
+   },
+
+   // See _saveMessageForReplay.
+   _replayPrintTwipsMsgs: function () {
+   if (!this.options.printTwipsMsgsEnabled || 
!this._printTwipsMessagesForReplay) {
+   return;
+   }
+
+   
this._printTwipsMessagesForReplay.forEach(this._onMessage.bind(this));
+   },
+
_onMessage: function (textMsg, img) {
+   this._saveMessageForReplay(textMsg);
if (textMsg.startsWith('comment:')) {
var obj = 
JSON.parse(textMsg.substring('comment:'.length + 1));
obj.comment.tab = parseInt(obj.comment.tab);
@@ -377,6 +430,7 @@ L.CalcTileLayer = L.TileLayer.extend({
_onSetPartMsg: function (textMsg) {
var part = parseInt(textMsg.match(/\d+/g)[0]);
if (!this.isHiddenPart(part)) {
+   this._clearMsgReplayStore();
this.refreshViewData(undefined, false /* 
compatDataSrcOnly */, true /* sheetGeometryChanged */);
}
},
@@ -387,6 +441,7 @@ L.CalcTileLayer = L.TileLayer.extend({

this.sheetGeometry.setTileGeometryData(this._tileWidthTwips, 
this._tileHeightTwips,
this._tileSize, this._tilePixelScale);
}
+   this._replayPrintTwipsMsgs();
this.refreshViewData();
this._map._socket.sendMessage('commandvalues 
command=.uno:ViewAnnotationsPosition');
},
@@ -621,6 +676,8 @@ L.CalcTileLayer = 

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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit 33850593011b96ba2ed485811c6ff920b906d1dd
Author: Dennis Francis 
AuthorDate: Wed May 27 20:26:30 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 16:37:25 2020 +0200

Avoid position recomputations if no change in zoom

Change-Id: I25bab150c9e8f13a52f67c8f908f0d27206e6993
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98113
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 16b1005e0..db08b2019 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -1003,6 +1003,17 @@ L.SheetDimension = L.Class.extend({
updatePositions = true;
}
 
+   // Avoid position re-computations if no change in Zoom/dpiScale.
+   if (this._tileSizeTwips === tileSizeTwips &&
+   this._tileSizeCSSPixels === tileSizeCSSPixels &&
+   this._dpiScale === dpiScale) {
+   return;
+   }
+
+   this._tileSizeTwips = tileSizeTwips;
+   this._tileSizeCSSPixels = tileSizeCSSPixels;
+   this._dpiScale = dpiScale;
+
this._twipsPerCSSPixel = tileSizeTwips / tileSizeCSSPixels;
this._devPixelsPerCssPixel = dpiScale;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 051803327a20fd176de29fb294f35860eaccf51a
Author: Dennis Francis 
AuthorDate: Wed May 27 20:19:14 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 16:36:25 2020 +0200

Handle print-twips 'comment' msg correctly

Change-Id: I36687aab705eef0e3dab3af7d39de7ac390129c0
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98112
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index b067c9dcc..16b1005e0 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -243,7 +243,8 @@ L.CalcTileLayer = L.TileLayer.extend({
var obj = 
JSON.parse(textMsg.substring('comment:'.length + 1));
obj.comment.tab = parseInt(obj.comment.tab);
if (obj.comment.action === 'Add') {
-   obj.comment.cellPos = 
L.LOUtil.stringToBounds(obj.comment.cellPos);
+   var cellPos = 
L.LOUtil.stringToBounds(obj.comment.cellPos);
+   obj.comment.cellPos = 
this._convertToTileTwipsSheetArea(cellPos);
obj.comment.cellPos = 
L.latLngBounds(this._twipsToLatLng(obj.comment.cellPos.getBottomLeft()),

this._twipsToLatLng(obj.comment.cellPos.getTopRight()));
if (!this._annotations[obj.comment.tab]) {
@@ -261,7 +262,8 @@ L.CalcTileLayer = L.TileLayer.extend({
}
} else if (obj.comment.action === 'Modify') {
var modified = 
this._annotations[obj.comment.tab][obj.comment.id];
-   obj.comment.cellPos = 
L.LOUtil.stringToBounds(obj.comment.cellPos);
+   cellPos = 
L.LOUtil.stringToBounds(obj.comment.cellPos);
+   obj.comment.cellPos = 
this._convertToTileTwipsSheetArea(cellPos);
obj.comment.cellPos = 
L.latLngBounds(this._twipsToLatLng(obj.comment.cellPos.getBottomLeft()),

this._twipsToLatLng(obj.comment.cellPos.getTopRight()));
if (modified) {
@@ -751,7 +753,6 @@ L.SheetGeometry = L.Class.extend({
 
setTileGeometryData: function (tileWidthTwips, tileHeightTwips, 
tileSizeCSSPixels,
dpiScale, updatePositions) {
-
this._columns.setTileGeometryData(tileWidthTwips, 
tileSizeCSSPixels, dpiScale, updatePositions);
this._rows.setTileGeometryData(tileHeightTwips, 
tileSizeCSSPixels, dpiScale, updatePositions);
},
@@ -997,6 +998,7 @@ L.SheetDimension = L.Class.extend({
},
 
setTileGeometryData: function (tileSizeTwips, tileSizeCSSPixels, 
dpiScale, updatePositions) {
+
if (updatePositions === undefined) {
updatePositions = true;
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/TileLayer.js |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 31b30936865b672f3015763fb8f6d3705a10a8b3
Author: Dennis Francis 
AuthorDate: Wed May 27 17:30:39 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 16:35:16 2020 +0200

Handle print-twips 'textviewselection' msg correctly

Change-Id: I94a40b5a53a33a6658a8c8e4cd1cdbbd5ae4f460
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98111
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index f34ca10a9..f2268776c 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1711,10 +1711,11 @@ L.TileLayer = L.GridLayer.extend({
for (var i = 0; i < strTwips.length; i += 4) {
var topLeftTwips = new 
L.Point(parseInt(strTwips[i]), parseInt(strTwips[i + 1]));
var offset = new L.Point(parseInt(strTwips[i + 
2]), parseInt(strTwips[i + 3]));
-   var topRightTwips = topLeftTwips.add(new 
L.Point(offset.x, 0));
-   var bottomLeftTwips = topLeftTwips.add(new 
L.Point(0, offset.y));
var bottomRightTwips = topLeftTwips.add(offset);
-   rectangles.push([bottomLeftTwips, 
bottomRightTwips, topLeftTwips, topRightTwips]);
+   var boundsTwips = 
this._convertToTileTwipsSheetArea(
+   new L.Bounds(topLeftTwips, 
bottomRightTwips));
+   rectangles.push([boundsTwips.getBottomLeft(), 
boundsTwips.getBottomRight(),
+   boundsTwips.getTopLeft(), 
boundsTwips.getTopRight()]);
}
 
this._viewSelections[viewId].part = viewPart;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/TileLayer.js |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 210b5ecde95ac1d7716016bfdee9c1077e276105
Author: Dennis Francis 
AuthorDate: Wed May 27 16:22:39 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 16:34:22 2020 +0200

Handle print-twips 'textselection' msg correctly

Change-Id: I6da579fe74827ad6cf127a58300b0ffd9c50b248
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98110
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 6c4ede99e..f34ca10a9 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1669,10 +1669,11 @@ L.TileLayer = L.GridLayer.extend({
for (var i = 0; i < strTwips.length; i += 4) {
var topLeftTwips = new 
L.Point(parseInt(strTwips[i]), parseInt(strTwips[i + 1]));
var offset = new L.Point(parseInt(strTwips[i + 
2]), parseInt(strTwips[i + 3]));
-   var topRightTwips = topLeftTwips.add(new 
L.Point(offset.x, 0));
-   var bottomLeftTwips = topLeftTwips.add(new 
L.Point(0, offset.y));
var bottomRightTwips = topLeftTwips.add(offset);
-   rectangles.push([bottomLeftTwips, 
bottomRightTwips, topLeftTwips, topRightTwips]);
+   var boundsTwips = 
this._convertToTileTwipsSheetArea(
+   new L.Bounds(topLeftTwips, 
bottomRightTwips));
+   rectangles.push([boundsTwips.getBottomLeft(), 
boundsTwips.getBottomRight(),
+   boundsTwips.getTopLeft(), 
boundsTwips.getTopRight()]);
}
 
var polygons = 
L.PolyUtil.rectanglesToPolygons(rectangles, this);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/TileLayer.js |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 72fd12904e5228b4db670ac02d56966e9509e74e
Author: Dennis Francis 
AuthorDate: Wed May 27 12:48:50 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 16:33:07 2020 +0200

Handle print-twips 'cellselectionarea' msg correctly

Change-Id: Ib8a13f66a4ffd3d63eeff8951960ebf176733a18
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98109
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index fd92bb468..6c4ede99e 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1858,10 +1858,12 @@ L.TileLayer = L.GridLayer.extend({
var topLeftTwips = new L.Point(parseInt(strTwips[0]), 
parseInt(strTwips[1]));
var offset = new L.Point(parseInt(strTwips[2]), 
parseInt(strTwips[3]));
var bottomRightTwips = topLeftTwips.add(offset);
+   var boundsTwips = this._convertToTileTwipsSheetArea(
+   new L.Bounds(topLeftTwips, 
bottomRightTwips));
var oldSelection = this._cellSelectionArea;
this._cellSelectionArea = new L.LatLngBounds(
-   
this._twipsToLatLng(topLeftTwips, this._map.getZoom()),
-   
this._twipsToLatLng(bottomRightTwips, this._map.getZoom()));
+   
this._twipsToLatLng(boundsTwips.getTopLeft(), this._map.getZoom()),
+   
this._twipsToLatLng(boundsTwips.getBottomRight(), this._map.getZoom()));
 
this._updateScrollOnCellSelection(oldSelection, 
this._cellSelectionArea);
} else {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/TileLayer.js |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 034a17b4ec41b2380b0d34c342fb2ae038833d49
Author: Dennis Francis 
AuthorDate: Sun May 24 22:58:36 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 16:32:25 2020 +0200

Handle print-twips 'cellviewcursor' msg correctly

Change-Id: I744a24aa54768f12ea8801f6ceabdd4c79fa483a
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98108
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 949e8354b..fd92bb468 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1365,9 +1365,11 @@ L.TileLayer = L.GridLayer.extend({
var topLeftTwips = new L.Point(parseInt(strTwips[0]), 
parseInt(strTwips[1]));
var offset = new L.Point(parseInt(strTwips[2]), 
parseInt(strTwips[3]));
var bottomRightTwips = topLeftTwips.add(offset);
+   var boundsTwips = this._convertToTileTwipsSheetArea(
+   new L.Bounds(topLeftTwips, bottomRightTwips));
this._cellViewCursors[viewId].bounds = new 
L.LatLngBounds(
-   this._twipsToLatLng(topLeftTwips, 
this._map.getZoom()),
-   this._twipsToLatLng(bottomRightTwips, 
this._map.getZoom()));
+   this._twipsToLatLng(boundsTwips.getTopLeft(), 
this._map.getZoom()),
+   
this._twipsToLatLng(boundsTwips.getBottomRight(), this._map.getZoom()));
}
 
this._cellViewCursors[viewId].part = parseInt(obj.part);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/TileLayer.js |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit e2409e27cad531043719d382542ad143917995db
Author: Dennis Francis 
AuthorDate: Sun May 24 20:34:25 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 16:31:38 2020 +0200

Handle print-twips referencemarks msg correctly

Change-Id: I53f283e267a5fd84cf3232cc346921b67d3487bc
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98107
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index e0ac093c6..949e8354b 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1755,10 +1755,10 @@ L.TileLayer = L.GridLayer.extend({
for (var i = 0; i < strTwips.length; i += 4) {
var topLeftTwips = new 
L.Point(parseInt(strTwips[i]), parseInt(strTwips[i + 1]));
var offset = new 
L.Point(parseInt(strTwips[i + 2]), parseInt(strTwips[i + 3]));
-   var topRightTwips = 
topLeftTwips.add(new L.Point(offset.x, 0));
-   var bottomLeftTwips = 
topLeftTwips.add(new L.Point(0, offset.y));
-   var bottomRightTwips = 
topLeftTwips.add(offset);
-   rectangles.push([bottomLeftTwips, 
bottomRightTwips, topLeftTwips, topRightTwips]);
+   var boundsTwips = 
this._convertToTileTwipsSheetArea(
+   new L.Bounds(topLeftTwips, 
topLeftTwips.add(offset)));
+   
rectangles.push([boundsTwips.getBottomLeft(), boundsTwips.getBottomRight(),
+   boundsTwips.getTopLeft(), 
boundsTwips.getTopRight()]);
}
 
var polygons = 
L.PolyUtil.rectanglesToPolygons(rectangles, this);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |4 +++-
 loleaflet/src/layer/tile/TileLayer.js |   16 +---
 2 files changed, 16 insertions(+), 4 deletions(-)

New commits:
commit e2c8e486fe208af1f84c9f8f75f7b111c81c8a5d
Author: Dennis Francis 
AuthorDate: Sun May 24 18:26:05 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 16:30:54 2020 +0200

Handle print-twips 'cellcursor' msg from correctly

This is conditioned on the flag printTwipsMsgsEnabled.

Change-Id: I61a9165a9f81ce7473c3fa6579947f34552dbdaf
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98106
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 478ea87e8..b067c9dcc 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -6,7 +6,9 @@
 /* global */
 L.CalcTileLayer = L.TileLayer.extend({
options: {
-   sheetGeometryDataEnabled: false
+   // TODO: sync these automatically from SAL_LOK_OPTIONS
+   sheetGeometryDataEnabled: false,
+   printTwipsMsgsEnabled: false
},
 
STD_EXTRA_WIDTH: 113, /* 2mm extra for optimal width,
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 0fe28e7ea..e0ac093c6 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1145,10 +1145,11 @@ L.TileLayer = L.GridLayer.extend({
var topLeftTwips = new L.Point(parseInt(strTwips[0]), 
parseInt(strTwips[1]));
var offset = new L.Point(parseInt(strTwips[2]), 
parseInt(strTwips[3]));
var bottomRightTwips = topLeftTwips.add(offset);
-   this._cellCursorTwips = new L.Bounds(topLeftTwips, 
bottomRightTwips);
+   this._cellCursorTwips = 
this._convertToTileTwipsSheetArea(
+   new 
L.Bounds(topLeftTwips, bottomRightTwips));
this._cellCursor = new L.LatLngBounds(
-   
this._twipsToLatLng(topLeftTwips, this._map.getZoom()),
-   
this._twipsToLatLng(bottomRightTwips, this._map.getZoom()));
+   
this._twipsToLatLng(this._cellCursorTwips.getTopLeft(), this._map.getZoom()),
+   
this._twipsToLatLng(this._cellCursorTwips.getBottomRight(), 
this._map.getZoom()));
this._cellCursorXY = new L.Point(parseInt(strTwips[4]), 
parseInt(strTwips[5]));
}
 
@@ -3380,6 +3381,15 @@ L.TileLayer = L.GridLayer.extend({
}
},
 
+   // convert the area in print-twips to tile-twips by computing the 
involved cell-range.
+   _convertToTileTwipsSheetArea: function (rectangle) {
+   if (!(rectangle instanceof L.Bounds) || 
!this.options.printTwipsMsgsEnabled) {
+   return rectangle;
+   }
+
+   return 
this.sheetGeometry.getTileTwipsSheetAreaFromPrint(rectangle);
+   },
+
_debugGetTimeArray: function() {
return {count: 0, ms: 0, best: Number.MAX_SAFE_INTEGER, worst: 
0, date: 0};
},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/geometry/Bounds.js  |8 +
 loleaflet/src/layer/tile/CalcTileLayer.js |  125 --
 2 files changed, 125 insertions(+), 8 deletions(-)

New commits:
commit f716d610c1f98af0c187061528d67a97d2b59c14
Author: Dennis Francis 
AuthorDate: Sun May 24 18:08:52 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 16:29:34 2020 +0200

Allow conversion of print-twips coordinates to tile-twips...

in L.SheetGeometry/L.SheetDimension classes.

Change-Id: If212e6ef2bebfeae32635f58a3025fbdf42e6ef2
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98105
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/geometry/Bounds.js b/loleaflet/src/geometry/Bounds.js
index b1b73ec1d..212089d86 100644
--- a/loleaflet/src/geometry/Bounds.js
+++ b/loleaflet/src/geometry/Bounds.js
@@ -44,6 +44,14 @@ L.Bounds.prototype = {
return new L.Point(this.max.x, this.min.y);
},
 
+   getTopLeft: function () { // -> Point
+   return new L.Point(this.min.x, this.min.y);
+   },
+
+   getBottomRight: function () { // -> Point
+   return new L.Point(this.max.x, this.max.y);
+   },
+
getSize: function () {
return this.max.subtract(this.min);
},
diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index dd648be91..478ea87e8 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -847,6 +847,26 @@ L.SheetGeometry = L.Class.extend({
return this._rows.getGroupsDataInView();
},
 
+   // accepts a rectangle in print twips coordinates and returns the 
equivalent rectangle
+   // in tile-twips aligned to the cells.
+   getTileTwipsSheetAreaFromPrint: function (rectangle) { // (L.Bounds) -> 
L.Bounds
+   if (!(rectangle instanceof L.Bounds)) {
+   console.error('Bad argument type, expected L.Bounds');
+   return rectangle;
+   }
+
+   var topLeft = rectangle.getTopLeft();
+   var bottomRight = rectangle.getBottomRight();
+
+   var horizBounds = 
this._columns.getTileTwipsRangeFromPrint(topLeft.x, bottomRight.x);
+   var vertBounds = 
this._rows.getTileTwipsRangeFromPrint(topLeft.y, bottomRight.y);
+
+   topLeft = new L.Point(horizBounds.startpos, 
vertBounds.startpos);
+   bottomRight = new L.Point(horizBounds.endpos, 
vertBounds.endpos);
+
+   return new L.Bounds(topLeft, bottomRight);
+   },
+
_testValidity: function (sheetGeomJSON, checkCompleteness) {
 
if (!sheetGeomJSON.hasOwnProperty('commandName')) {
@@ -998,6 +1018,7 @@ L.SheetDimension = L.Class.extend({
_updatePositions: function() {
 
var posDevPx = 0; // position in device pixels.
+   var posPrintTwips = 0;
var dimensionObj = this;
this._visibleSizes.addCustomDataForEachSpan(function (
index,
@@ -1010,12 +1031,14 @@ L.SheetDimension = L.Class.extend({
var posCssPx = posDevPx / 
dimensionObj._devPixelsPerCssPixel;
// position in device-pixel aligned twips.
var posTileTwips = Math.floor(posCssPx * 
dimensionObj._twipsPerCSSPixel);
+   posPrintTwips += (size * spanLength);
 
var customData = {
sizedev: sizeDevPxOne,
posdevpx: posDevPx,
poscsspx: posCssPx,
-   postiletwips: posTileTwips
+   postiletwips: posTileTwips,
+   posprinttwips: posPrintTwips
};
 
return customData;
@@ -1034,15 +1057,48 @@ L.SheetDimension = L.Class.extend({
 
// returns element pos/size in css pixels by default.
_getElementDataFromSpanByIndex: function (index, span, useDevicePixels) 
{
+   return this._getElementDataAnyFromSpanByIndex(index, span,
+   useDevicePixels ? 'devpixels' : 'csspixels');
+   },
+
+   // returns element pos/size in the requested unit.
+   _getElementDataAnyFromSpanByIndex: function (index, span, unitName) {
+
if (span === undefined || index < span.start || span.end < 
index) {
return undefined;
}
 
+   if (unitName !== 'csspixels' && unitName !== 'devpixels' &&
+   unitName !== 'tiletwips' && unitName !== 
'printtwips') {
+   console.error('unsupported unitName: ' + unitName);
+   return undefined;
+   }

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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9909f20a05ec6130e0d8f3f586d6ce517ea86857
Author: Dennis Francis 
AuthorDate: Fri May 22 22:52:12 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 16:28:11 2020 +0200

fix a logical error regarding useDevicePixels flag

Change-Id: I4a930544a8f09d4d97c5e8257f0a353b4fccefac
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98103
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 24bcba0ab..dd648be91 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -1039,7 +1039,7 @@ L.SheetDimension = L.Class.extend({
}
 
var numSizes = span.end - index + 1;
-   var pixelScale = useDevicePixels ? this._devPixelsPerCssPixel : 
1;
+   var pixelScale = useDevicePixels ? 1 : 
this._devPixelsPerCssPixel;
return {
startpos: (span.data.posdevpx - span.data.sizedev * 
numSizes) / pixelScale,
size: span.data.sizedev / pixelScale
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 7b8df1fd0e568cb34e24c81cf88c758b8e3b0e2a
Author: Dennis Francis 
AuthorDate: Thu May 21 23:43:17 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 16:27:26 2020 +0200

Avoid double parse/load of the first sheet geometry message

Change-Id: I381c63608dd4858b7f4e6e22d3f1d010cd2308e0
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98102
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 1f9b8d966..24bcba0ab 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -613,8 +613,10 @@ L.CalcTileLayer = L.TileLayer.extend({
this._tileWidthTwips, this._tileHeightTwips,
this._tileSize, this._tilePixelScale);
}
+   else {
+   this.sheetGeometry.update(jsonMsgObj);
+   }
 
-   this.sheetGeometry.update(jsonMsgObj);

this.sheetGeometry.setViewArea(this._pixelsToTwips(this._map._getTopLeftPoint()),
this._pixelsToTwips(this._map.getSize()));
this._updateHeadersGridLines(undefined, true /* updateCols */,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |   14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 2d8f0d5a6fe09e84e1f6eb9a35bf135620feef6f
Author: Dennis Francis 
AuthorDate: Thu May 21 23:30:04 2020 +0530
Commit: Dennis Francis 
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 
Reviewed-by: Dennis Francis 

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);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/core/Socket.js |2 --
 1 file changed, 2 deletions(-)

New commits:
commit a695506c732f222972616ea4cc9837065d58974e
Author: Dennis Francis 
AuthorDate: Thu May 21 21:41:38 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 16:26:06 2020 +0200

loleaflet: avoid double logging of messages

Change-Id: Ib19e3f26ec0fe5bb66364a488f764bdcf88acf83
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98100
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 35c7ceb15..b4f918da7 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -772,8 +772,6 @@ L.Socket = L.Class.extend({
this._map.fire(mobileEvent);
}
else if (!textMsg.startsWith('tile:') && 
!textMsg.startsWith('renderfont:') && !textMsg.startsWith('windowpaint:')) {
-   // log the tile msg separately as we need the tile 
coordinates
-   this._logSocket('INCOMING', textMsg);
 
if (imgBytes !== undefined) {
try {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |   16 
 1 file changed, 12 insertions(+), 4 deletions(-)

New commits:
commit fbae86ca65f8de53e3f1333fb452e3a1270e895f
Author: Dennis Francis 
AuthorDate: Thu May 21 16:09:39 2020 +0530
Commit: Dennis Francis 
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 
Reviewed-by: Dennis Francis 

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');
}
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 7b78a2e66470969f7daba9846b55b30eda311c0c
Author: Dennis Francis 
AuthorDate: Thu May 21 12:29:52 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 16:24:27 2020 +0200

Ignore the "invalidateheader:" msgs when...

sheet-geometry data source is enabled, because these messages are not
just for sheet geometry changes.

Change-Id: I8b2cca968a189607e46a4f9512c60e4b29f124bc
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98098
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index ff75e6b99..3e6453e26 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -269,15 +269,15 @@ L.CalcTileLayer = L.TileLayer.extend({
}
} else if (textMsg.startsWith('invalidateheader: column')) {
this.refreshViewData({x: 
this._map._getTopLeftPoint().x, y: 0,
-   offset: {x: undefined, y: 0}});
+   offset: {x: undefined, y: 0}}, true /* 
compatDataSrcOnly */);
this._map._socket.sendMessage('commandvalues 
command=.uno:ViewAnnotationsPosition');
} else if (textMsg.startsWith('invalidateheader: row')) {
this.refreshViewData({x: 0, y: 
this._map._getTopLeftPoint().y,
-   offset: {x: 0, y: undefined}});
+   offset: {x: 0, y: undefined}}, true /* 
compatDataSrcOnly */);
this._map._socket.sendMessage('commandvalues 
command=.uno:ViewAnnotationsPosition');
} else if (textMsg.startsWith('invalidateheader: all')) {
this.refreshViewData({x: 
this._map._getTopLeftPoint().x, y: this._map._getTopLeftPoint().y,
-   offset: {x: undefined, y: undefined}});
+   offset: {x: undefined, y: undefined}}, true /* 
compatDataSrcOnly */);
this._map._socket.sendMessage('commandvalues 
command=.uno:ViewAnnotationsPosition');
} else {
L.TileLayer.prototype._onMessage.call(this, textMsg, 
img);
@@ -365,7 +365,7 @@ L.CalcTileLayer = L.TileLayer.extend({
_onSetPartMsg: function (textMsg) {
var part = parseInt(textMsg.match(/\d+/g)[0]);
if (!this.isHiddenPart(part)) {
-   this.refreshViewData(undefined, true /* 
sheetGeometryChanged */);
+   this.refreshViewData(undefined, false /* 
compatDataSrcOnly */, true /* sheetGeometryChanged */);
}
},
 
@@ -467,8 +467,11 @@ L.CalcTileLayer = L.TileLayer.extend({
// zooming, cursor moving out of view-area etc.).  Depending on the
// active sheet geometry data-source, it may ask core to send current
// view area's data or the global data on geometry changes.
-   refreshViewData: function (coordinatesData, sheetGeometryChanged) {
+   refreshViewData: function (coordinatesData, compatDataSrcOnly, 
sheetGeometryChanged) {
 
+   if (this.options.sheetGeometryDataEnabled && compatDataSrcOnly) 
{
+   return;
+   }
// There are places that call this function with no arguments 
to indicate that the
// command arguments should be the current map area coordinates.
if (typeof coordinatesData != 'object') {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |1 +
 1 file changed, 1 insertion(+)

New commits:
commit b7cc5d0044d220869db8ce47226468059b8320c7
Author: Dennis Francis 
AuthorDate: Sat May 16 18:36:04 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 10:06:29 2020 +0200

Initialize outlines ds on empty outline

Change-Id: If845991272a05f026fad7819d39ff4b23622abae
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97953
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 1d206711e..ff75e6b99 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -1469,6 +1469,7 @@ L.DimensionOutlines = L.Class.extend({
var levels = encoding.split(' ');
if (levels.length < 2) {
// No outline.
+   this._outlines = [];
return true;
}
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 36f06284407aa9d6145410d0e74350030fcb732a
Author: Dennis Francis 
AuthorDate: Sat May 16 18:07:56 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 10:05:46 2020 +0200

call refreshViewData() on setpart message...

if the part is not hidden. The member _selectedPart is already set
to the new part in Parts.js's setPart(), as a result the code inside
the if was never getting executed. There is no need to call
map.setPart() as this was also done in Parts.js setPart(), and finally
there are no handler for 'setpart' event as of now, so lets remove the
fire() call too. All of this was not a problem when the
'.uno:ViewRowColumnHeader' data source was used, because that data
was getting requested unintentionally as part of related scroll events
during a sheet switch.

Change-Id: I3ea3916ba738d9616e822659fc64903eda8f99cf
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97952
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 030152594..1d206711e 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -364,9 +364,7 @@ L.CalcTileLayer = L.TileLayer.extend({
 
_onSetPartMsg: function (textMsg) {
var part = parseInt(textMsg.match(/\d+/g)[0]);
-   if (part !== this._selectedPart && !this.isHiddenPart(part)) {
-   this._map.setPart(part, true);
-   this._map.fire('setpart', {selectedPart: 
this._selectedPart});
+   if (!this.isHiddenPart(part)) {
this.refreshViewData(undefined, true /* 
sheetGeometryChanged */);
}
},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |   39 ++
 1 file changed, 34 insertions(+), 5 deletions(-)

New commits:
commit a77ca892813632d72c8013560c3cba99d00b208b
Author: Dennis Francis 
AuthorDate: Sat May 16 16:41:29 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 10:04:14 2020 +0200

Add ability to get first match in binarySearch

(more details in the comments)
This can help in a corner case (very improbable though) when we query
for the exact end-position of a span with trailing empty span.  Lets do
the right thing, even if that does happen only extremely rarely.

Change-Id: Ib1370811c257e6ef3d52d29caf2963641bad8e40
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97951
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index ee8173adf..030152594 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -1300,7 +1300,9 @@ L.SpanList = L.Class.extend({
}
return (testValue < valueStart) ? -1 :
(valueEnd < testValue) ? 1 : 0;
-   });
+   }, true /* find the first match in case of duplicates 
*/);
+   // About the last argument: duplicates can happen, for instance 
if the
+   // custom field represents positions, and there are spans with 
zero sizes (hidden/filtered).
}
 
 });
@@ -1582,6 +1584,9 @@ L.DimensionOutlines = L.Class.extend({
 // Of course, this assumes that the array is sorted (w.r.t to the semantics of
 // the directionProvider when it is provided).
 // It returns the index of the match if successful else returns -1.
+// 'firstMatch' if true, some additional work is done to ensure that the index 
of
+// the first match (from the 0 index of the array) is returned in case there 
are
+// duplicates.
 //
 // directionProvider will be provided the following parameters :
 // (key, previousArrayElement, currentArrayElement, nextArrayElement)
@@ -1592,19 +1597,21 @@ L.DimensionOutlines = L.Class.extend({
 //   1: to try searching upper half,
 //  -1: to try searching lower half
 
-function binarySearch(array, key, directionProvider) {
+function binarySearch(array, key, directionProvider, firstMatch) {
 
if (!Array.isArray(array) || !array.length) {
return -1;
}
 
if (typeof directionProvider != 'function') {
-   directionProvider = function (key, testvalue) {
+   directionProvider = function (key, prevvalue, testvalue) {
return (key === testvalue) ? 0 :
(key < testvalue) ? -1 : 1;
};
}
 
+   firstMatch = (firstMatch === true);
+
var start = 0;
var end = array.length - 1;
 
@@ -1616,7 +1623,12 @@ function binarySearch(array, key, directionProvider) {
 
var endDir = directionProvider(key, array[end - 1], array[end]);
if (endDir >= 0) {
-   return endDir ? -1 : end;
+
+   if (endDir === 1) {
+   return -1;
+   }
+
+   return firstMatch ? _findFirstMatch(array, key, 
directionProvider, end) : end;
}
 
var mid = -1;
@@ -1637,5 +1649,22 @@ function binarySearch(array, key, directionProvider) {
}
}
 
-   return (start > end) ? -1 : mid;
+   return (start > end) ? -1 :
+   firstMatch ? _findFirstMatch(array, key, directionProvider, 
mid) : mid;
+}
+
+// Helper function for binarySearch().
+function _findFirstMatch(array, key, directionProvider, randomMatchingIndex) {
+
+   if (randomMatchingIndex === 0) {
+   return 0;
+   }
+
+   var index = randomMatchingIndex - 1;
+   while (index >= 0 && directionProvider(key,
+   array[index - 1], array[index], array[index + 1]) == 0) {
+   --index;
+   }
+
+   return index + 1;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |   27 +++
 1 file changed, 23 insertions(+), 4 deletions(-)

New commits:
commit 0d2dfafc89ed603458d8f3711f1130172ed944f9
Author: Dennis Francis 
AuthorDate: Sat May 16 15:09:51 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 10:03:00 2020 +0200

Make the newly added interfaces more robust

against wrong argument counts/types.

Change-Id: Ibfed2ba4f3e907ef8a038a3b13b3081cc6248c20
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97950
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index b7b122ae3..ee8173adf 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -1193,6 +1193,10 @@ L.SpanList = L.Class.extend({
 
addCustomDataForEachSpan: function (getCustomDataCallback) {
 
+   if (typeof getCustomDataCallback != 'function') {
+   return;
+   }
+
var prevIndex = -1;
this._spanlist.forEach(function (span) {
span.data = getCustomDataCallback(
@@ -1203,6 +1207,11 @@ L.SpanList = L.Class.extend({
},
 
getSpanDataByIndex: function (index) {
+
+   if (typeof index != 'number') {
+   return undefined;
+   }
+
var spanid = this._searchByIndex(index);
if (spanid == -1) {
return undefined;
@@ -1212,6 +1221,11 @@ L.SpanList = L.Class.extend({
},
 
getSpanDataByCustomDataField: function (value, fieldName) {
+
+   if (typeof value != 'number' || typeof fieldName != 'string' || 
!fieldName) {
+   return undefined;
+   }
+
var spanid = this._searchByCustomDataField(value, fieldName);
if (spanid == -1) {
return undefined;
@@ -1222,7 +1236,8 @@ L.SpanList = L.Class.extend({
 
forEachSpanInRange: function (start, end, callback) {
 
-   if (start > end) {
+   if (typeof start != 'number' || typeof end != 'number' ||
+   typeof callback != 'function' || start > end) {
return;
}
 
@@ -1279,6 +1294,10 @@ L.SpanList = L.Class.extend({
var valueStart = prevSpan ?
prevSpan.data[fieldName] + 1 : 0;
var valueEnd = curSpan.data[fieldName];
+   if (valueStart === undefined || valueEnd === 
undefined) {
+   // fieldName not present in the 'data' 
property.
+   return -1;
+   }
return (testValue < valueStart) ? -1 :
(valueEnd < testValue) ? 1 : 0;
});
@@ -1501,7 +1520,7 @@ L.DimensionOutlines = L.Class.extend({
// 'callback' is called with these parameters : (levelIdx, groupIdx, 
groupStart, groupEnd, groupHidden).
forEachGroupInRange: function (start, end, callback) {
 
-   if (start === undefined || end === undefined || callback === 
undefined) {
+   if (typeof start != 'number' || typeof end != 'number' || 
typeof callback != 'function') {
return;
}
 
@@ -1575,11 +1594,11 @@ L.DimensionOutlines = L.Class.extend({
 
 function binarySearch(array, key, directionProvider) {
 
-   if (array === undefined || !array.length) {
+   if (!Array.isArray(array) || !array.length) {
return -1;
}
 
-   if (directionProvider === undefined) {
+   if (typeof directionProvider != 'function') {
directionProvider = function (key, testvalue) {
return (key === testvalue) ? 0 :
(key < testvalue) ? -1 : 1;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |   68 +++---
 1 file changed, 18 insertions(+), 50 deletions(-)

New commits:
commit 36b7efc1ee79c54e7294fdb5f78f76adf20c4456
Author: Dennis Francis 
AuthorDate: Sat May 16 14:12:10 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 10:02:19 2020 +0200

Reuse binarySearch routine in L.SpanList search functions

Change-Id: I2f5411ef4da6b236978c08e3ea03ee05f9c8dabc
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97949
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 0b540acdf..b7b122ae3 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -1259,61 +1259,29 @@ L.SpanList = L.Class.extend({
 
_searchByIndex: function (index) {
 
-   if (index < 0 || index > this._spanlist[this._spanlist.length - 
1].index) {
-   return -1;
-   }
-
-   var start = 0;
-   var end = this._spanlist.length - 1;
-   var mid = -1;
-   while (start <= end) {
-   mid = Math.round((start + end) / 2);
-   var spanstart = mid ? this._spanlist[mid - 1].index + 1 
: 0;
-   var spanend = this._spanlist[mid].index;
-   if (spanstart <= index && index <= spanend) {
-   break;
-   }
-
-   if (index < spanstart) {
-   end = mid - 1;
-   }
-   else { // spanend < index
-   start = mid + 1;
-   }
-   }
-
-   return mid;
+   return binarySearch(this._spanlist, index,
+   function directionProvider(testIndex, prevSpan, 
curSpan) {
+   var spanStart = prevSpan ?
+   prevSpan.index + 1 : 0;
+   var spanEnd = curSpan.index;
+   return (testIndex < spanStart) ? -1 :
+   (spanEnd < testIndex) ? 1 : 0;
+   });
},
 
_searchByCustomDataField: function (value, fieldName) {
 
-   // All custom searchable data values are assumed to start from 
0 at the start of first span.
-   var maxValue = this._spanlist[this._spanlist.length - 
1].data[fieldName];
-   if (value < 0 || value > maxValue) {
-   return -1;
-   }
+   // All custom searchable data values are assumed to start
+   // from 0 at the start of first span and are in non-decreasing 
order.
 
-   var start = 0;
-   var end = this._spanlist.length - 1;
-   var mid = -1;
-   while (start <= end) {
-   mid = Math.round((start + end) / 2);
-   var valuestart = mid ? this._spanlist[mid - 
1].data[fieldName] + 1 : 0;
-   var valueend = this._spanlist[mid].data[fieldName];
-   if (valuestart <= value && value <= valueend) {
-   break;
-   }
-
-   if (value < valuestart) {
-   end = mid - 1;
-   }
-   else { // valueend < value
-   start = mid + 1;
-   }
-   }
-
-   // may fail for custom data ?
-   return (start <= end) ? mid : -1;
+   return binarySearch(this._spanlist, value,
+   function directionProvider(testValue, prevSpan, 
curSpan) {
+   var valueStart = prevSpan ?
+   prevSpan.data[fieldName] + 1 : 0;
+   var valueEnd = curSpan.data[fieldName];
+   return (testValue < valueStart) ? -1 :
+   (valueEnd < testValue) ? 1 : 0;
+   });
}
 
 });
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |4 
 1 file changed, 4 insertions(+)

New commits:
commit 21ded7f081494cbfb107ee1f4d6b6c3839664fd6
Author: Dennis Francis 
AuthorDate: Fri May 15 23:12:16 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 10:01:03 2020 +0200

enforce bound-checks on setViewArea()

Change-Id: Ic129181095c301ce27421bac5d3f1f94d1932248
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97947
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index b7ad0a7f5..0b540acdf 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -1040,6 +1040,10 @@ L.SheetDimension = L.Class.extend({
// computes element index from tile-twips position.
_getIndexFromTileTwipsPos: function (pos) {
var span = this._visibleSizes.getSpanDataByCustomDataField(pos, 
'postiletwips');
+   if (span === undefined) {
+   // enforce limits.
+   return (pos >= 0) ? this._maxIndex : 0;
+   }
var elementCount = span.end - span.start + 1;
var posStart = ((span.data.posdevpx - span.data.sizedev * 
elementCount) /
this._devPixelsPerCssPixel * this._twipsPerCSSPixel);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/control/Control.Scroll.js |   18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 7f3c250cdf3d6f9a865cded710c507c7a5490e4c
Author: Dennis Francis 
AuthorDate: Sat May 16 11:14:17 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 10:01:43 2020 +0200

Restore the scope of 'offset' tampering code

as it was before 317afcecb4

This 'adjustment' was just meant for refreshViewData() or whatever it
was called before, to indicate that both column/row headers/gridlines
should be updated, no matter what the actual offset is (probably only
meant for zoom changes?). The offset passed to refreshViewData is only
going to be used as a boolean flag.

This patch fixes the row/col headers getting a off-by-one pixel when
changing zooms with the new data-source (.uno:SheetGeometryData). If
using the older source (.uno:ViewRowColumnHeader), this bug is hidden
because of the delay for fetching the JSON everytime before painting the
headers.

TODO: Refactor all calls of refreshViewData to get rid of the 'offset'
and this adjustment code and only send the boolean flags to
refreshViewData().

Change-Id: I4c30e8f06a6a2d58b9a9a89e283d7a214d00b99c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97948
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/control/Control.Scroll.js 
b/loleaflet/src/control/Control.Scroll.js
index 36eed31fe..0cde2b4c9 100644
--- a/loleaflet/src/control/Control.Scroll.js
+++ b/loleaflet/src/control/Control.Scroll.js
@@ -259,15 +259,21 @@ L.Control.Scroll = L.Control.extend({
// used on window resize
// also when dragging
var offset = new L.Point(e.x - this._prevScrollX, e.y - 
this._prevScrollY);
-   if (offset.x === 0) {
-   offset.x = 1;
-   }
-   if (offset.y === 0) {
-   offset.y = 1;
-   }
 
this._map.fire('scrolloffset', offset);
if (e.updateHeaders && this._map._docLayer._docType === 
'spreadsheet') {
+   // This adjustment was just meant for refreshViewData()
+   // to indicate that both column/row headers/gridlines
+   // should be updated, no matter what the actual offset
+   // is (unsure why).
+   // TODO: Get rid of the 'offset' adjustment and
+   // only send boolean flags to refreshViewData().
+   if (offset.x === 0) {
+   offset.x = 1;
+   }
+   if (offset.y === 0) {
+   offset.y = 1;
+   }
this._map._docLayer.refreshViewData({x: e.x, y: e.y, 
offset: offset});
}
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/control/Control.Scroll.js |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit bb0036db81aeb9675dd349305f5d79d7f458f940
Author: Dennis Francis 
AuthorDate: Fri May 15 22:43:19 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 10:00:28 2020 +0200

call refreshViewData after 'scrolloffset' is fired

otherwise the header controls won't have the right position info
when refreshViewData causes an ~immediate header/gridline rendering
(.uno:SheetGeometryData source). This was not a problem in case of
.uno:ViewRowColumnHeader source, because of the roundtrip delay for
getting the msg from core.

Change-Id: I48298dbfb8d62acc64adbfd662a5304b856d702a
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97946
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/control/Control.Scroll.js 
b/loleaflet/src/control/Control.Scroll.js
index cb323e1c7..36eed31fe 100644
--- a/loleaflet/src/control/Control.Scroll.js
+++ b/loleaflet/src/control/Control.Scroll.js
@@ -114,11 +114,10 @@ L.Control.Scroll = L.Control.extend({
return;
}
 
-   this._map._docLayer.refreshViewData({ x: newLeft, y: newTop, 
offset: offset});
-
this._prevScrollY = newTop;
this._prevScrollX = newLeft;
this._map.fire('scrolloffset', offset);
+   this._map._docLayer.refreshViewData({ x: newLeft, y: newTop, 
offset: offset});
this._map.scroll(offset.x, offset.y);
},
 
@@ -266,10 +265,12 @@ L.Control.Scroll = L.Control.extend({
if (offset.y === 0) {
offset.y = 1;
}
+
+   this._map.fire('scrolloffset', offset);
if (e.updateHeaders && this._map._docLayer._docType === 
'spreadsheet') {
this._map._docLayer.refreshViewData({x: e.x, y: e.y, 
offset: offset});
}
-   this._map.fire('scrolloffset', offset);
+
this._ignoreScroll = null;
$('.scroll-container').mCustomScrollbar('stop');
this._prevScrollY = e.y;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit cdde0237f4f961a6c1575fda4b9151439a926c6a
Author: Dennis Francis 
AuthorDate: Fri May 15 22:05:44 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 09:58:30 2020 +0200

Don't ask core for sheet-geometry data for invalidateheader msgs

We may need to have a dedicated sheetgeometrychanged msg for geometry
changes like change of col/row sizes, hidden/filtered, groups/outline
states.

Change-Id: I45a8038546c66797aed4b58f11c6450cbe6e2965
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97945
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 2252f2116..b7ad0a7f5 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -269,15 +269,15 @@ L.CalcTileLayer = L.TileLayer.extend({
}
} else if (textMsg.startsWith('invalidateheader: column')) {
this.refreshViewData({x: 
this._map._getTopLeftPoint().x, y: 0,
-   offset: {x: undefined, y: 0}}, true /* 
sheetGeometryChanged */);
+   offset: {x: undefined, y: 0}});
this._map._socket.sendMessage('commandvalues 
command=.uno:ViewAnnotationsPosition');
} else if (textMsg.startsWith('invalidateheader: row')) {
this.refreshViewData({x: 0, y: 
this._map._getTopLeftPoint().y,
-   offset: {x: 0, y: undefined}}, true /* 
sheetGeometryChanged */);
+   offset: {x: 0, y: undefined}});
this._map._socket.sendMessage('commandvalues 
command=.uno:ViewAnnotationsPosition');
} else if (textMsg.startsWith('invalidateheader: all')) {
this.refreshViewData({x: 
this._map._getTopLeftPoint().x, y: this._map._getTopLeftPoint().y,
-   offset: {x: undefined, y: undefined}}, true /* 
sheetGeometryChanged */);
+   offset: {x: undefined, y: undefined}});
this._map._socket.sendMessage('commandvalues 
command=.uno:ViewAnnotationsPosition');
} else {
L.TileLayer.prototype._onMessage.call(this, textMsg, 
img);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/control/Control.ColumnHeader.js |   21 +++-
 loleaflet/src/control/Control.Header.js   |   30 ++
 loleaflet/src/control/Control.RowHeader.js|   21 +++-
 loleaflet/src/control/Control.Scroll.js   |4 
 loleaflet/src/layer/CalcGridLines.js  |   15 ++-
 loleaflet/src/layer/tile/CalcTileLayer.js |  112 --
 loleaflet/src/map/Map.js  |2 
 7 files changed, 160 insertions(+), 45 deletions(-)

New commits:
commit dc862d358522315c857044debf11eeceb1fc936b
Author: Dennis Francis 
AuthorDate: Fri May 15 08:12:03 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 09:57:59 2020 +0200

use SheetGeometry data to draw headers/gridlines if enabled

Change-Id: If146512a50c24f5fd81f6df7e0a3746f70bf21f9
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97944
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/control/Control.ColumnHeader.js 
b/loleaflet/src/control/Control.ColumnHeader.js
index a2846f78e..254a4df41 100644
--- a/loleaflet/src/control/Control.ColumnHeader.js
+++ b/loleaflet/src/control/Control.ColumnHeader.js
@@ -193,7 +193,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({
},
 
_updateColumnHeader: function () {
-   this._map._docLayer.requestViewRowColumnData({x: 
this._map._getTopLeftPoint().x, y: 0, offset: {x: undefined, y: 0}});
+   this._map._docLayer.refreshViewData({x: 
this._map._getTopLeftPoint().x, y: 0, offset: {x: undefined, y: 0}});
},
 
drawHeaderEntry: function (entry, isOver, isHighlighted, isCurrent) {
@@ -376,8 +376,10 @@ L.Control.ColumnHeader = L.Control.Header.extend({
},
 
viewRowColumnHeaders: function (e) {
-   if (e.data.columns && e.data.columns.length > 0) {
-   this.fillColumns(e.data.columns, e.data.columnGroups, 
e.converter, e.context);
+   var dataInEvent = (e.data && e.data.columns && 
e.data.columns.length > 0);
+   if (dataInEvent || e.updatecolumns) {
+   dataInEvent ? this.fillColumns(e.data.columns, 
e.data.columnGroups, e.converter, e.context) :
+   this.fillColumns(undefined, undefined, 
e.converter, e.context);
this._onUpdateCurrentColumn(e.cursor);
if (e.selection && e.selection.hasSelection) {
this._onUpdateSelection(e.selection);
@@ -389,7 +391,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({
},
 
fillColumns: function (columns, colGroups, converter, context) {
-   if (columns.length < 2)
+   if (columns && columns.length < 2)
return;
 
var canvas = this._canvas;
@@ -413,21 +415,28 @@ L.Control.ColumnHeader = L.Control.Header.extend({
this._lastMouseOverIndex = undefined;
}
 
+   var sheetGeometry = this._map._docLayer.sheetGeometry;
+   var columnsGeometry = sheetGeometry ? 
sheetGeometry.getColumnsGeometry() : undefined;
+
// create data structure for column widths
-   this._tickMap = new L.Control.Header.GapTickMap(this._map, 
columns);
+   this._tickMap = new L.Control.Header.GapTickMap(this._map, 
columns, columnsGeometry);
this._startOffset = this._tickMap.getStartOffset();
 
// setup conversion routine
this.converter = L.Util.bind(converter, context);
 
// create group array
-   this._groupLevels = parseInt(columns[0].groupLevels);
+   this._groupLevels = columns ? parseInt(columns[0].groupLevels):
+   sheetGeometry.getColumnGroupLevels();
this._groups = this._groupLevels ? new Array(this._groupLevels) 
: null;
 
// collect group controls data
if (colGroups !== undefined && this._groups) {
this._collectGroupsData(colGroups);
}
+   else if (sheetGeometry) {
+   
this._collectGroupsData(sheetGeometry.getColumnGroupsDataInView());
+   }
 
if (this._groups) {
this.resize(this._computeOutlineWidth() + 
this._borderWidth + this._headerHeight);
diff --git a/loleaflet/src/control/Control.Header.js 
b/loleaflet/src/control/Control.Header.js
index 5aeac06da..3ef4bb2e0 100644
--- a/loleaflet/src/control/Control.Header.js
+++ b/loleaflet/src/control/Control.Header.js
@@ -804,7 +804,35 @@ L.Control.Header.colHeaderHeight = undefined;
  */
 L.Control.Header.GapTickMap = L.Class.extend({
 
-   initialize: function (map, ticks) {
+   initialize: function (map, ticks, dimensionGeometry) {
+
+   if (dimensionGeometry) {
+   // Until 

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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 1744ae64156c08746c413f23d8c8a87163a6ae58
Author: Dennis Francis 
AuthorDate: Thu May 14 23:11:07 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 09:57:28 2020 +0200

Round down when computing row/col index from tile-twips position

And lets not unnecessarily extend the cellrange in the view as the
computation is accurate.

Change-Id: I62de80ce42430c62a399d4e39bafab7896217bf1
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97943
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 974c1daae..6ed8ae4b4 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -975,6 +975,7 @@ L.SheetDimension = L.Class.extend({
});
},
 
+   // computes element index from tile-twips position.
_getIndexFromTileTwipsPos: function (pos) {
var span = this._visibleSizes.getSpanDataByCustomDataField(pos, 
'postiletwips');
var elementCount = span.end - span.start + 1;
@@ -982,16 +983,17 @@ L.SheetDimension = L.Class.extend({
this._devPixelsPerCssPixel * this._twipsPerCSSPixel);
var posEnd = span.data.postiletwips;
var sizeOne = (posEnd - posStart) / elementCount;
-   var relativeIndex = Math.round((pos - posStart) / sizeOne);
+
+   // always round down as relativeIndex is zero-based.
+   var relativeIndex = Math.floor((pos - posStart) / sizeOne);
 
return span.start + relativeIndex;
},
 
setViewLimits: function (startPosTileTwips, endPosTileTwips) {
 
-   // Extend the range a bit, to compensate for rounding errors.
-   this._viewStartIndex = Math.max(0, 
this._getIndexFromTileTwipsPos(startPosTileTwips) - 2);
-   this._viewEndIndex = Math.min(this._maxIndex, 
this._getIndexFromTileTwipsPos(endPosTileTwips) + 2);
+   this._viewStartIndex = Math.max(0, 
this._getIndexFromTileTwipsPos(startPosTileTwips));
+   this._viewEndIndex = Math.min(this._maxIndex, 
this._getIndexFromTileTwipsPos(endPosTileTwips));
},
 
getViewElementRange: function () {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |  152 --
 1 file changed, 142 insertions(+), 10 deletions(-)

New commits:
commit 7c8b5ff12fb270c10e33c537a6d131007f6e87ec
Author: Dennis Francis 
AuthorDate: Thu May 14 22:49:30 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 09:56:54 2020 +0200

add table outline query interfaces

Change-Id: Ibd26592e321af1dca5ee7ff369e58b1f51dc480b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97942
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index b3b7c7037..974c1daae 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -841,7 +841,7 @@ L.SheetDimension = L.Class.extend({
this._sizes = new L.SpanList();
this._hidden = new L.BoolSpanList();
this._filtered = new L.BoolSpanList();
-   this._groups = new L.DimensionOutlines();
+   this._outlines = new L.DimensionOutlines();
 
// This is used to store the span-list of sizes
// with hidden/filtered elements set to zero size.
@@ -876,7 +876,7 @@ L.SheetDimension = L.Class.extend({
}
 
if (jsonObject.hasOwnProperty('groups')) {
-   thisLoadOK = this._groups.load(jsonObject.groups);
+   thisLoadOK = this._outlines.load(jsonObject.groups);
loadsOK = loadsOK && thisLoadOK;
}
 
@@ -939,25 +939,27 @@ L.SheetDimension = L.Class.extend({
});
},
 
-   getElementData: function (index) {
+   // returns the element pos/size in css pixels by default.
+   getElementData: function (index, useDevicePixels) {
var span = this._visibleSizes.getSpanDataByIndex(index);
if (span === undefined) {
return undefined;
}
 
-   return this._getElementDataFromSpanByIndex(index, span);
+   return this._getElementDataFromSpanByIndex(index, span, 
useDevicePixels);
},
 
-   _getElementDataFromSpanByIndex: function (index, span) {
+   // returns element pos/size in css pixels by default.
+   _getElementDataFromSpanByIndex: function (index, span, useDevicePixels) 
{
if (span === undefined || index < span.start || span.end < 
index) {
return undefined;
}
 
var numSizes = span.end - index + 1;
-   // all in css pixels.
+   var pixelScale = useDevicePixels ? this._devPixelsPerCssPixel : 
1;
return {
-   startpos: (span.data.posdevpx - span.data.sizedev * 
numSizes) / this._devPixelsPerCssPixel,
-   size: span.data.sizedev / this._devPixelsPerCssPixel
+   startpos: (span.data.posdevpx - span.data.sizedev * 
numSizes) / pixelScale,
+   size: span.data.sizedev / pixelScale
};
},
 
@@ -1432,16 +1434,19 @@ L.DimensionOutlines = L.Class.extend({
 
var olineEntry = {
start: parseInt(entrySplits[0]),
-   size: parseInt(entrySplits[1]),
+   end: parseInt(entrySplits[1]), // this 
is size.
hidden: parseInt(entrySplits[2]),
visible: parseInt(entrySplits[3])
};
 
-   if (isNaN(olineEntry.start) || 
isNaN(olineEntry.size) ||
+   if (isNaN(olineEntry.start) || 
isNaN(olineEntry.end) ||
isNaN(olineEntry.hidden) || 
isNaN(olineEntry.visible)) {
return false;
}
 
+   // correct the 'end' attribute.
+   olineEntry.end += (olineEntry.start - 1);
+
collections.push(olineEntry);
}
 
@@ -1450,5 +1455,132 @@ L.DimensionOutlines = L.Class.extend({
 
this._outlines = outlines;
return true;
+   },
+
+   getLevels: function () {
+   return this._outlines.length;
+   },
+
+   // Calls 'callback' for all groups in all levels that have an 
intersection with the inclusive element range [start, end].
+   // 'callback' is called with these parameters : (levelIdx, groupIdx, 
groupStart, groupEnd, groupHidden).
+   forEachGroupInRange: function (start, end, callback) {
+
+   if (start === undefined || end === undefined || callback === 
undefined) {
+   

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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |   44 ++
 1 file changed, 44 insertions(+)

New commits:
commit 13b6b8506f005f3e848c7d16c8047698b768d055
Author: Dennis Francis 
AuthorDate: Tue May 12 10:52:50 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 09:56:07 2020 +0200

introduce .uno:SheetGeometryData requester/handler

Change-Id: Iaeef462346f22996daddb583c459a5f67aa6c290
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97941
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index b0773251d..b3b7c7037 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -497,6 +497,42 @@ L.CalcTileLayer = L.TileLayer.extend({
this._map._socket.sendMessage(payload);
},
 
+   // sends the .uno:SheetGeometryData command optionally with arguments.
+   requestSheetGeomtryData: function (flags) {
+   var unoCmd = '.uno:SheetGeometryData';
+   var haveArgs = (typeof flags == 'object' && (flags.columns === 
true || flags.rows === true));
+   var payload = 'commandvalues command=' + unoCmd;
+
+   if (haveArgs) {
+   var argList = [];
+   if (flags.columns === true) {
+   argList.push('columns=1');
+   }
+   if (flags.rows === true) {
+   argList.push('rows=1');
+   }
+
+   var dataTypeFlagNames = ['sizes', 'hidden', 'filtered', 
'groups'];
+   var dataTypesPresent = false;
+   dataTypeFlagNames.forEach(function (name) {
+   if (flags[name] === true) {
+   argList.push(name + '=1');
+   dataTypesPresent = true;
+   }
+   });
+
+   if (!dataTypesPresent) {
+   dataTypeFlagNames.forEach(function (name) {
+   argList.push(name + '=1');
+   });
+   }
+
+   payload += '?' + argList.join('&');
+   }
+
+   this._map._socket.sendMessage(payload);
+   },
+
_handleViewRowColumnHeadersMsg: function (jsonMsgObj) {
this._map.fire('viewrowcolumnheaders', {
data: jsonMsgObj,
@@ -507,6 +543,11 @@ L.CalcTileLayer = L.TileLayer.extend({
});
},
 
+   _handleSheetGeometryDataMsg: function (jsonMsgObj) {
+   // TODO: use the L.SheetGeometry datastructure
+   this._map.sheetGeomData = jsonMsgObj;
+   },
+
_onCommandValuesMsg: function (textMsg) {
var jsonIdx = textMsg.indexOf('{');
if (jsonIdx === -1)
@@ -521,6 +562,9 @@ L.CalcTileLayer = L.TileLayer.extend({
if (values.commandName === '.uno:ViewRowColumnHeaders') {
this._handleViewRowColumnHeadersMsg(values);
 
+   } else if (values.commandName === '.uno:SheetGeometryData') {
+   this._handleSheetGeometryDataMsg(values);
+
} else if (values.comments) {
this.clearAnnotations();
for (var index in values.comments) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |  841 ++
 1 file changed, 841 insertions(+)

New commits:
commit b36e069549508e927c75e8000f0cff6024884a05
Author: Dennis Francis 
AuthorDate: Sat May 9 20:34:37 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 09:55:33 2020 +0200

add sheet-geometry datastructures

to parse, store the .uno:SheetGeometryData JSON efficiently although it
is optimized for fast querying. L.SheetGeometry is the external class
that exposes all necessary sheet query interfaces.

Change-Id: I24df8d85734a6cdf9c393fd2c3c5ed4de0ea29f3
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97940
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 06ffa2bef..b0773251d 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -567,3 +567,844 @@ L.CalcTileLayer = L.TileLayer.extend({
this._onUpdateCurrentHeader();
}
 });
+
+
+// TODO: Move these somewhere more appropriate.
+
+// Sheet geometry data
+L.SheetGeometry = L.Class.extend({
+
+   // sheetGeomJSON is expected to be the parsed JSON message from core
+   // in response to client command '.uno:SheetGeometryData' with
+   // all flags (ie 'columns', 'rows', 'sizes', 'hidden', 'filtered',
+   // 'groups') enabled.
+   initialize: function (sheetGeomJSON, tileWidthTwips, tileHeightTwips,
+   tileSizeCSSPixels, dpiScale) {
+
+   if (typeof sheetGeomJSON !== 'object' ||
+   typeof tileWidthTwips !== 'number' ||
+   typeof tileHeightTwips !== 'number' ||
+   typeof tileSizeCSSPixels !== 'number' ||
+   typeof dpiScale !== 'number') {
+   console.error('Incorrect constructor argument types or 
missing required arguments');
+   return;
+   }
+
+   this._columns = new L.SheetDimension();
+   this._rows = new L.SheetDimension();
+   this._unoCommand = '.uno:SheetGeometryData';
+
+   // Set various unit conversion info early on because on 
update() call below, these info are needed.
+   this.setTileGeometryData(tileWidthTwips, tileHeightTwips, 
tileSizeCSSPixels,
+   dpiScale, false /* update position info ?*/);
+
+   this.update(sheetGeomJSON, /* checkCompleteness */ true);
+   },
+
+   update: function (sheetGeomJSON, checkCompleteness) {
+
+   if (!this._testValidity(sheetGeomJSON, checkCompleteness)) {
+   return false;
+   }
+
+   var updateOK = true;
+   if (sheetGeomJSON.columns) {
+   if (!this._columns.update(sheetGeomJSON.columns)) {
+   console.error(this._unoCommand + ': columns 
update failed.');
+   updateOK = false;
+   }
+   }
+
+   if (sheetGeomJSON.rows) {
+   if (!this._rows.update(sheetGeomJSON.rows)) {
+   console.error(this._unoCommand + ': rows update 
failed.');
+   updateOK = false;
+   }
+   }
+
+   this._columns.setMaxIndex(+sheetGeomJSON.maxtiledcolumn);
+   this._rows.setMaxIndex(+sheetGeomJSON.maxtiledrow);
+
+   return updateOK;
+   },
+
+   setTileGeometryData: function (tileWidthTwips, tileHeightTwips, 
tileSizeCSSPixels,
+   dpiScale, updatePositions) {
+
+   this._columns.setTileGeometryData(tileWidthTwips, 
tileSizeCSSPixels, dpiScale, updatePositions);
+   this._rows.setTileGeometryData(tileHeightTwips, 
tileSizeCSSPixels, dpiScale, updatePositions);
+   },
+
+   setViewArea: function (topLeftTwipsPoint, sizeTwips) {
+
+   if (!(topLeftTwipsPoint instanceof L.Point) || !(sizeTwips 
instanceof L.Point)) {
+   console.error('invalid argument types');
+   return false;
+   }
+
+   var left   = topLeftTwipsPoint.x;
+   var top= topLeftTwipsPoint.y;
+   var right  = left + sizeTwips.x;
+   var bottom = top + sizeTwips.y;
+
+   this._columns.setViewLimits(left, right);
+   this._rows.setViewLimits(top, bottom);
+
+   return true;
+   },
+
+   // returns an object with keys 'start' and 'end' indicating the
+   // column range in the current view area.
+   getViewColumnRange: function () {
+   return this._columns.getViewElementRange();
+   },
+
+   // returns an object with keys 'start' and 'end' indicating the
+ 

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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/control/Control.ColumnHeader.js |2 
 loleaflet/src/control/Control.RowHeader.js|2 
 loleaflet/src/control/Control.Scroll.js   |   40 ---
 loleaflet/src/layer/tile/CalcTileLayer.js |   53 +++---
 loleaflet/src/map/Map.js  |4 +
 5 files changed, 55 insertions(+), 46 deletions(-)

New commits:
commit cc6250de46333bcb2ec22caf272c2e36ce7327f7
Author: Dennis Francis 
AuthorDate: Mon May 11 21:31:25 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 09:55:03 2020 +0200

move the 'updaterowcolumnheaders' event handling code

from L.Control.Scroll to a new method requestViewRowColumnData() under
L.CalcTileLayer which is arguably a more appropriate place for it and
change all the places that calls map.fire() to emit
'updaterowcolumnheaders' to call the new method directly.

This helps to improve the code readability a bit by being more explicit
and also avoid an unnecessary indirection while code grepping.

This also makes it much easier to introduce the change in data source
from .uno:ViewRowColumnHeaders to .uno:SheetGeometryData by avoiding
lots of abrupt changes in one go.

Change-Id: Ia42d7586f06e28a5715fac278967a445089308af
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97939
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/control/Control.ColumnHeader.js 
b/loleaflet/src/control/Control.ColumnHeader.js
index f9d3feedb..a2846f78e 100644
--- a/loleaflet/src/control/Control.ColumnHeader.js
+++ b/loleaflet/src/control/Control.ColumnHeader.js
@@ -193,7 +193,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({
},
 
_updateColumnHeader: function () {
-   this._map.fire('updaterowcolumnheaders', {x: 
this._map._getTopLeftPoint().x, y: 0, offset: {x: undefined, y: 0}});
+   this._map._docLayer.requestViewRowColumnData({x: 
this._map._getTopLeftPoint().x, y: 0, offset: {x: undefined, y: 0}});
},
 
drawHeaderEntry: function (entry, isOver, isHighlighted, isCurrent) {
diff --git a/loleaflet/src/control/Control.RowHeader.js 
b/loleaflet/src/control/Control.RowHeader.js
index 0bf1fcb38..afbba3c45 100644
--- a/loleaflet/src/control/Control.RowHeader.js
+++ b/loleaflet/src/control/Control.RowHeader.js
@@ -186,7 +186,7 @@ L.Control.RowHeader = L.Control.Header.extend({
},
 
_updateRowHeader: function () {
-   this._map.fire('updaterowcolumnheaders', {x: 0, y: 
this._map._getTopLeftPoint().y, offset: {x: 0, y: undefined}});
+   this._map._docLayer.requestViewRowColumnData({x: 0, y: 
this._map._getTopLeftPoint().y, offset: {x: 0, y: undefined}});
},
 
drawHeaderEntry: function (entry, isOver, isHighlighted, isCurrent) {
diff --git a/loleaflet/src/control/Control.Scroll.js 
b/loleaflet/src/control/Control.Scroll.js
index 650f69ce4..e3f9cf4dc 100644
--- a/loleaflet/src/control/Control.Scroll.js
+++ b/loleaflet/src/control/Control.Scroll.js
@@ -23,7 +23,6 @@ L.Control.Scroll = L.Control.extend({
map.on('handleautoscroll', this._onHandleAutoScroll, this);
map.on('docsize', this._onUpdateSize, this);
map.on('updatescrolloffset', this._onUpdateScrollOffset, this);
-   map.on('updaterowcolumnheaders', 
this._onUpdateRowColumnHeaders, this);
 
var control = this;
var autoHideTimeout = null;
@@ -115,7 +114,7 @@ L.Control.Scroll = L.Control.extend({
return;
}
 
-   this._onUpdateRowColumnHeaders({ x: newLeft, y: newTop, offset: 
offset});
+   this._map._docLayer.requestViewRowColumnData({ x: newLeft, y: 
newTop, offset: offset});
 
this._prevScrollY = newTop;
this._prevScrollX = newLeft;
@@ -268,7 +267,7 @@ L.Control.Scroll = L.Control.extend({
offset.y = 1;
}
if (e.updateHeaders && this._map._docLayer._docType === 
'spreadsheet') {
-   this._onUpdateRowColumnHeaders({x: e.x, y: e.y, offset: 
offset});
+   this._map._docLayer.requestViewRowColumnData({x: e.x, 
y: e.y, offset: offset});
}
this._map.fire('scrolloffset', offset);
this._ignoreScroll = null;
@@ -276,41 +275,6 @@ L.Control.Scroll = L.Control.extend({
this._prevScrollY = e.y;
this._prevScrollX = e.x;
$('.scroll-container').mCustomScrollbar('scrollTo', [e.y, e.x], 
{callbacks: false, timeout:0});
-   },
-
-   _onUpdateRowColumnHeaders: function(e) {
-   var offset = e.offset || {};
-
-   var topLeftPoint = new L.Point(e.x, e.y);
-   var sizePx = this._map.getSize();
-
-   if (topLeftPoint.x === undefined) {
- 

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

2020-07-05 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |   18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)

New commits:
commit c77f978fc85778a183b1dc84be9a324cbbe7bf83
Author: Dennis Francis 
AuthorDate: Mon May 11 15:17:49 2020 +0530
Commit: Dennis Francis 
CommitDate: Sun Jul 5 09:54:00 2020 +0200

Move the ViewRowColumnHeaders handling code into its own method

_handleViewRowColumnHeadersMsg()

Change-Id: Ib0b83941dcc9bc0bed42269fafbc61fcd7877bc6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97938
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 684d559c1..323fcc711 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -454,6 +454,16 @@ L.CalcTileLayer = L.TileLayer.extend({
}
},
 
+   _handleViewRowColumnHeadersMsg: function (jsonMsgObj) {
+   this._map.fire('viewrowcolumnheaders', {
+   data: jsonMsgObj,
+   cursor: this._getCursorPosSize(),
+   selection: this._getSelectionHeaderData(),
+   converter: this._twipsToPixels,
+   context: this
+   });
+   },
+
_onCommandValuesMsg: function (textMsg) {
var jsonIdx = textMsg.indexOf('{');
if (jsonIdx === -1)
@@ -466,13 +476,7 @@ L.CalcTileLayer = L.TileLayer.extend({
 
var comment;
if (values.commandName === '.uno:ViewRowColumnHeaders') {
-   this._map.fire('viewrowcolumnheaders', {
-   data: values,
-   cursor: this._getCursorPosSize(),
-   selection: this._getSelectionHeaderData(),
-   converter: this._twipsToPixels,
-   context: this
-   });
+   this._handleViewRowColumnHeadersMsg(values);
 
} else if (values.comments) {
this.clearAnnotations();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-04 Thread Dennis Francis (via logerrit)
 loleaflet/src/control/Control.ColumnHeader.js |7 ++
 loleaflet/src/control/Control.RowHeader.js|7 ++
 loleaflet/src/layer/tile/CalcTileLayer.js |   30 +++---
 3 files changed, 36 insertions(+), 8 deletions(-)

New commits:
commit 3f97c85218705f29206a0c22eea6419c5698066a
Author: Dennis Francis 
AuthorDate: Sun May 10 01:57:01 2020 +0530
Commit: Dennis Francis 
CommitDate: Sat Jul 4 18:06:03 2020 +0200

Do not rely on js ordering of multi event execution

On getting a .uno:ViewRowColumnHeaders message, the order of header
painting should be the headers elements first, then the cursor
indication on the header, then the selection area indication on the
header if any. More importantly none of these painting will be correct
if the data in the tickMap member of both headers is stale.

As of now all three of these are executed by three different events.
Lets avoid depending on the implicit ordering of execution of these and
do these synchronously as part of the main event
('viewrowcolumnheaders')  handler.

Change-Id: I4da29ba893c408af45159073e4389481b2eaecc7
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97937
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/control/Control.ColumnHeader.js 
b/loleaflet/src/control/Control.ColumnHeader.js
index 8c049fd93..f9d3feedb 100644
--- a/loleaflet/src/control/Control.ColumnHeader.js
+++ b/loleaflet/src/control/Control.ColumnHeader.js
@@ -378,6 +378,13 @@ L.Control.ColumnHeader = L.Control.Header.extend({
viewRowColumnHeaders: function (e) {
if (e.data.columns && e.data.columns.length > 0) {
this.fillColumns(e.data.columns, e.data.columnGroups, 
e.converter, e.context);
+   this._onUpdateCurrentColumn(e.cursor);
+   if (e.selection && e.selection.hasSelection) {
+   this._onUpdateSelection(e.selection);
+   }
+   else {
+   this._onClearSelection();
+   }
}
},
 
diff --git a/loleaflet/src/control/Control.RowHeader.js 
b/loleaflet/src/control/Control.RowHeader.js
index d1f475723..0bf1fcb38 100644
--- a/loleaflet/src/control/Control.RowHeader.js
+++ b/loleaflet/src/control/Control.RowHeader.js
@@ -367,6 +367,13 @@ L.Control.RowHeader = L.Control.Header.extend({
viewRowColumnHeaders: function (e) {
if (e.data.rows && e.data.rows.length) {
this.fillRows(e.data.rows, e.data.rowGroups, 
e.converter, e.context);
+   this._onUpdateCurrentRow(e.cursor);
+   if (e.selection && e.selection.hasSelection) {
+   this._onUpdateSelection(e.selection);
+   }
+   else {
+   this._onClearSelection();
+   }
}
},
 
diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 1e82f2598..684d559c1 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -373,6 +373,10 @@ L.CalcTileLayer = L.TileLayer.extend({
},
 
_onUpdateCurrentHeader: function() {
+   this._map.fire('updatecurrentheader', this._getCursorPosSize());
+   },
+
+   _getCursorPosSize: function () {
var x = -1, y = -1;
if (this._cellCursorXY) {
x = this._cellCursorXY.x + 1;
@@ -382,20 +386,30 @@ L.CalcTileLayer = L.TileLayer.extend({
if (this._cellCursor && 
!this._isEmptyRectangle(this._cellCursor)) {
size = this._cellCursorTwips.getSize();
}
-   this._map.fire('updatecurrentheader', {curX: x, curY: y, width: 
size.x, height: size.y});
+
+   return { curX: x, curY: y, width: size.x, height: size.y };
},
 
_onUpdateSelectionHeader: function () {
+   var selectionHeaderData = this._getSelectionHeaderData();
+   if (selectionHeaderData.hasSelection) {
+   this._map.fire('updateselectionheader', 
selectionHeaderData);
+   return;
+   }
+
+   this._map.fire('clearselectionheader');
+   },
+
+   _getSelectionHeaderData: function() {
var layers = this._selections.getLayers();
var layer = layers.pop();
if (layers.length === 0 && layer && layer.getLatLngs().length 
=== 1) {
var start = 
this._latLngToTwips(layer.getBounds().getNorthWest()).add([1, 1]);
var end = 
this._latLngToTwips(layer.getBounds().getSouthEast()).subtract([1, 1]);
-   

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

2020-07-03 Thread Pranam Lashkari (via logerrit)
 loleaflet/src/control/Control.Menubar.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0e573489d3b2bbfd4e1c6c1d7d438cc4c6b03bf3
Author: Pranam Lashkari 
AuthorDate: Fri Jul 3 17:24:11 2020 +0530
Commit: Pranam Lashkari 
CommitDate: Fri Jul 3 19:57:01 2020 +0200

leaflet: allow download as odg in readonly mode(view mdoe)

Change-Id: I5bb1f9288280ffc18beaa893402752291c7d8507
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97845
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins
Reviewed-by: Pranam Lashkari 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 960629f5d..c391ea052 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -724,7 +724,7 @@ L.Control.Menubar = L.Control.extend({
allowedViewModeActions: [
'shareas', 'print', // file menu
'downloadas-pdf', 'downloadas-odt', 'downloadas-doc', 
'downloadas-docx', 'downloadas-rtf', 'downloadas-epub', // file menu
-   'downloadas-odp', 'downloadas-ppt', 'downloadas-pptx', 
'print', // file menu
+   'downloadas-odp', 'downloadas-ppt', 'downloadas-pptx', 
'downloadas-odg', 'print', // file menu
'downloadas-ods', 'downloadas-xls', 'downloadas-xlsx', 
'closedocument', // file menu
'fullscreen', 'zoomin', 'zoomout', 'zoomreset', 
'showresolved', // view menu
'about', 'keyboard-shortcuts', 'latest-updates', 
'online-help', 'report-an-issue' // help menu
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-03 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.UIManager.js |2 +-
 loleaflet/src/layer/tile/TileLayer.js  |2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 72c49927c677652d66028975f419ea1874f344c4
Author: Szymon Kłos 
AuthorDate: Fri Jul 3 12:25:50 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri Jul 3 14:47:28 2020 +0200

notebookbar: avoid showing on mobile

Change-Id: I3ad25cd65b41c7c94d866da86bfb9673a9bb2fc7
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97831
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.UIManager.js 
b/loleaflet/src/control/Control.UIManager.js
index bf08bfa87..4a6bb927b 100644
--- a/loleaflet/src/control/Control.UIManager.js
+++ b/loleaflet/src/control/Control.UIManager.js
@@ -211,7 +211,7 @@ L.Control.UIManager = L.Control.extend({
}
 
var enableNotebookbar = window.userInterfaceMode === 
'notebookbar';
-   if (enableNotebookbar) {
+   if (enableNotebookbar && !window.mode.isMobile()) {
if (e.perm === 'edit') {

this.makeSpaceForNotebookbar(this.map._docLayer._docType);
} else if (e.perm === 'readonly' && 
$('#mobile-edit-button').is(':hidden')) {
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index f666ce519..0fe28e7ea 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -999,6 +999,8 @@ L.TileLayer = L.GridLayer.extend({
_onJSDialogMsg: function (textMsg) {
if (window.mode.isMobile()) {
var msgData = 
JSON.parse(textMsg.substring('jsdialog:'.length + 1));
+   if (msgData.type == 'borderwindow')
+   return;
if (msgData.enabled) {
this._openMobileWizard(msgData);
} else {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-03 Thread Pranam Lashkari (via logerrit)
 loleaflet/src/control/Control.Menubar.js |   21 +++--
 1 file changed, 15 insertions(+), 6 deletions(-)

New commits:
commit 32185682de346c9a729a2ef2efb0d66713a6a84d
Author: Pranam Lashkari 
AuthorDate: Thu Jul 2 16:00:14 2020 +0530
Commit: Andras Timar 
CommitDate: Fri Jul 3 12:51:22 2020 +0200

leaflet: Removed impress download options from drawing doc

Change-Id: Iaddc3f8330733ec89af0cb0ec6ed14d1f51999ff
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97740
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 39a4e8146..be46644b9 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -257,9 +257,11 @@ L.Control.Menubar = L.Control.extend({
{name: _('See revision history'), id: 
'rev-history', type: 'action'},
{name: !window.ThisIsAMobileApp ? _('Download 
as') : _('Export as'), id: 'downloadas', type: 'menu', menu: [
{name: _('PDF Document (.pdf)'), id: 
'downloadas-pdf', type: 'action'},
-   {name: _('ODF presentation (.odp)'), 
id: 'downloadas-odp', type: 'action'},
-   {name: _('PowerPoint 2003 Presentation 
(.ppt)'), id: 'downloadas-ppt', type: 'action'},
-   {name: _('PowerPoint Presentation 
(.pptx)'), id: 'downloadas-pptx', type: 'action'}]},
+   {name: _('ODF presentation (.odp)'), 
id: 'downloadas-odp', type: 'action', drawing: false},
+   {name: _('PowerPoint 2003 Presentation 
(.ppt)'), id: 'downloadas-ppt', type: 'action', drawing: false},
+   {name: _('PowerPoint Presentation 
(.pptx)'), id: 'downloadas-pptx', type: 'action', drawing: false},
+   {name: _('ODF Drawing (.odg)'), id: 
'downloadas-odg', type: 'action'}
+   ]},
{type: 'separator'},
{name: _('Close document'), id: 
'closedocument', type: 'action'}
]},
@@ -538,9 +540,10 @@ L.Control.Menubar = L.Control.extend({
]},
{name: !window.ThisIsAMobileApp ? _('Download as') : 
_('Export as'), id:'downloadas', type: 'menu', menu: [
{name: _('PDF Document (.pdf)'), id: 
'downloadas-pdf', type: 'action'},
-   {name: _('ODF presentation (.odp)'), id: 
'downloadas-odp', type: 'action'},
-   {name: _('PowerPoint 2003 Presentation 
(.ppt)'), id: 'downloadas-ppt', type: 'action'},
-   {name: _('PowerPoint Presentation (.pptx)'), 
id: 'downloadas-pptx', type: 'action'},
+   {name: _('ODF presentation (.odp)'), id: 
'downloadas-odp', type: 'action', drawing: false},
+   {name: _('PowerPoint 2003 Presentation 
(.ppt)'), id: 'downloadas-ppt', type: 'action', drawing: false},
+   {name: _('PowerPoint Presentation (.pptx)'), 
id: 'downloadas-pptx', type: 'action', drawing: false},
+   {name: _('ODF Drawing (.odg)'), id: 
'downloadas-odg', type: 'action'}
]},
{name: _UNO('.uno:EditMenu', 'presentation'), id: 
'editmenu', type: 'menu', menu: [
{uno: '.uno:Undo'},
@@ -1383,6 +1386,12 @@ L.Control.Menubar = L.Control.extend({
if (menuItem.id === 'changesmenu' && 
this._map['wopi'].HideChangeTrackingControls)
return false;
 
+   if (menuItem.drawing === false && this._map.getDocType() === 
'drawing')
+   return false;
+
+   if (menuItem.id === 'downloadas-odg' && 
!this._map['wopi'].BaseFileName.endsWith('.odg'))
+   return false;
+
// Keep track of all 'downloadas-' options and register them as
// export formats with docLayer which can then be publicly 
accessed unlike
// this Menubar control for which there doesn't seem to be any 
easy way
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-03 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.NotebookbarBuilder.js |6 
 loleaflet/typescript_js/admin/src/ModalDialogCreator.js |  118 
 2 files changed, 121 insertions(+), 3 deletions(-)

New commits:
commit e8f5fa6fd6ef9a8358d35acd14c4a7d6d9af8126
Author: Szymon Kłos 
AuthorDate: Fri Jul 3 10:20:05 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri Jul 3 12:27:18 2020 +0200

notebookbar: fix font size combobox

Change-Id: I492ff580d7674ada3de8e2bcf188d46486be
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97818
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index dc00ace4b..27857a375 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -143,6 +143,7 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
$('#fontnamecombobox').val(state).trigger('change');
} else if (commandName === '.uno:FontHeight') {
$('#fontsize').val(parseFloat(state)).trigger('change');
+   
$('#fontsizecombobox').val(parseFloat(state)).trigger('change');
} else if (commandName === '.uno:StyleApply') {
$('#applystyle').val(state).trigger('change');
}
@@ -161,7 +162,7 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
var state = items.getItemValue('.uno:CharFontName');
$(combobox).val(state).trigger('change');
}
-   else if (id === 'fontsize') {
+   else if (id === 'fontsize' || id === 'fontsizecombobox') {
$(combobox).on('select2:select', function (e) {

builder.map.applyFontSize(parseFloat(e.params.data.text));
builder.map.focus();
@@ -209,13 +210,12 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
data.entries.forEach(function (value, index) {
var selected = parseInt(data.selectedEntries[0]) == 
index;
var id = index;
-   if (data.id === 'fontsize')
+   if (data.id === 'fontsize' || data.id === 
'fontsizecombobox')
id = parseFloat(value);
if (data.id === 'fontnamecombobox')
id = value;
processedData.push({id: id, text: value, selected: 
selected});
});
-   console.log(processedData);
 
$(select).select2({
data: processedData,
diff --git a/loleaflet/typescript_js/admin/src/ModalDialogCreator.js 
b/loleaflet/typescript_js/admin/src/ModalDialogCreator.js
new file mode 100644
index 0..ca76adcea
--- /dev/null
+++ b/loleaflet/typescript_js/admin/src/ModalDialogCreator.js
@@ -0,0 +1,118 @@
+/* eslint-disable */
+/// Available types: info, warning, danger, link, success, primary. Works with 
bulma.css.
+// Every "set" function returns the instance. So you can do this:
+// (new DlgYesNo).Title('some title').Text('some 
text').YesButtonText('yes').NoButtonText('no').YesFunction(function () {/* 
*/}).NoFunction(function() {/** */});
+// "Yes" and "No" buttons call callback function, close the modal and destroy 
the modal.
+var DlgYesNo = /** @class */ (function () {
+function DlgYesNo() {
+this._instance = this;
+DlgYesNo._instanceCount++;
+this._modalID = DlgYesNo._instanceCount;
+this.initialize();
+}
+DlgYesNo.prototype.initialize = function () {
+var html = this.getModalHTML();
+var element = document.createElement('div');
+element.innerHTML = html;
+document.getElementsByTagName('body')[0].appendChild(element);
+this.initializeBackgroundClick();
+this.initializeCrossButton();
+this.initializeYesButton();
+this.initializeNoButton();
+};
+DlgYesNo.prototype.initializeCrossButton = function () {
+var element = document.getElementById('modal-' + 
String(this._modalID));
+document.getElementById('modal-cross-button-' + 
String(this._modalID)).onclick = function () {
+element.classList.remove('is-active');
+element.parentNode.removeChild(element);
+};
+};
+DlgYesNo.prototype.initializeBackgroundClick = function () {
+var element = document.getElementById('modal-' + 
String(this._modalID));
+document.getElementById('modal-background-' + 
String(this._modalID)).onclick = function () {
+element.classList.remove('is-active');
+element.parentNode.removeChild(element);
+};
+};
+

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

2020-07-02 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 8b3cb9a176ec1550415cd51f0b04f9e147f195e2
Author: Szymon Kłos 
AuthorDate: Thu Jul 2 08:58:53 2020 +0200
Commit: Szymon Kłos 
CommitDate: Thu Jul 2 14:51:03 2020 +0200

jsdialog: use listbox for font size selector

with newer core version it changed a name

Change-Id: I3804f9f6e1acfc96123e4376aeb3b040deeebe4c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97707
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index ba6ee8fce..41ad87376 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1414,6 +1414,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
if (data.id === 'applystyle' ||
data.id === 'fontnamecombobox' ||
data.id === 'fontsizecombobox' ||
+   data.id === 'fontsize' ||
data.id === 'FontBox') {
builder._listboxControl(parentContainer, data, builder);
} else if (data.id === 'searchterm' ||
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-01 Thread Ashod Nakashian (via logerrit)
 loleaflet/src/control/Control.DocumentNameInput.js |2 +-
 loleaflet/src/control/Control.Toolbar.js   |7 ---
 loleaflet/src/map/Map.js   |4 ++--
 3 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 0b80c4b3270f004278521e06afcf3dec6ff99cd9
Author: Ashod Nakashian 
AuthorDate: Thu Jun 25 21:53:26 2020 -0400
Commit: Ashod Nakashian 
CommitDate: Thu Jul 2 02:44:29 2020 +0200

leaflet: set renameFilename before saving

There is a race between the time we set the
renameFilename value and the uno:Save response
arrives. If renameFilename is not set by then
we miss the opportunity to rename and instead
simply end up saving the file.

Change-Id: I8d7acbc95cef264de4385d506bfa34458ba80283
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97189
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian 

diff --git a/loleaflet/src/control/Control.DocumentNameInput.js 
b/loleaflet/src/control/Control.DocumentNameInput.js
index cfc4e5998..3ad053094 100644
--- a/loleaflet/src/control/Control.DocumentNameInput.js
+++ b/loleaflet/src/control/Control.DocumentNameInput.js
@@ -27,8 +27,8 @@ L.Control.DocumentNameInput = L.Control.extend({
// same extension, just rename 
the file
// file name must be without 
the extension for rename
value = value.substr(0, 
value.lastIndexOf('.'));
+   this.map._renameFilename = 
value;

this.map.sendUnoCommand('.uno:Save');
-   this.map._RenameFile = value;
}
}
} else {
diff --git a/loleaflet/src/control/Control.Toolbar.js 
b/loleaflet/src/control/Control.Toolbar.js
index 1eccdce82..e8dce9bc3 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -924,9 +924,10 @@ function onCommandResult(e) {
map._everModified = true;
 
// document is saved for rename
-   if (map._RenameFile) {
-   map.renameFile(map._RenameFile);
-   map._RenameFile = '';
+   if (map._renameFilename) {
+   var renameFilename = map._renameFilename;
+   map._renameFilename = '';
+   map.renameFile(renameFilename);
}
}
var postMessageObj = {
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 5f9882a53..285e4954d 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -259,8 +259,8 @@ L.Map = L.Evented.extend({
// This becomes true if document was ever modified by the user
this._everModified = false;
 
-   // This becomes new file name if document is renamed which used 
later on uno:Save result
-   this._RenameFile = '';
+   // This is the new file name, if the document is renamed, which 
is used on uno:Save's result.
+   this._renameFilename = '';
 
// Document is completely loaded or not
this._docLoaded = false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-01 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.NotebookbarBuilder.js |   14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit fcc6f1cd17ce4b2ab12b7b7161da2598696caaa6
Author: Szymon Kłos 
AuthorDate: Wed Jul 1 11:04:20 2020 +0200
Commit: Szymon Kłos 
CommitDate: Wed Jul 1 12:33:47 2020 +0200

notebookbar: fix comboboxes

Change-Id: I5f7c2fbf31d8b0babca3b96424138aa0a38e3676
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97599
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index 3c01a12aa..dc00ace4b 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -142,7 +142,7 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
if (commandName === '.uno:CharFontName') {
$('#fontnamecombobox').val(state).trigger('change');
} else if (commandName === '.uno:FontHeight') {
-   $('#fontsize').val(state).trigger('change');
+   $('#fontsize').val(parseFloat(state)).trigger('change');
} else if (commandName === '.uno:StyleApply') {
$('#applystyle').val(state).trigger('change');
}
@@ -153,7 +153,7 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
 
if (id === 'fontnamecombobox') {
$(combobox).on('select2:select', function (e) {
-   var font = e.target.value;
+   var font = e.params.data.text;
builder.map.applyFont(font);
builder.map.focus();
});
@@ -163,7 +163,7 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
}
else if (id === 'fontsize') {
$(combobox).on('select2:select', function (e) {
-   builder.map.applyFontSize(e.target.value);
+   
builder.map.applyFontSize(parseFloat(e.params.data.text));
builder.map.focus();
});
 
@@ -208,8 +208,14 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
 
data.entries.forEach(function (value, index) {
var selected = parseInt(data.selectedEntries[0]) == 
index;
-   processedData.push({id: index, text: value, selected: 
selected});
+   var id = index;
+   if (data.id === 'fontsize')
+   id = parseFloat(value);
+   if (data.id === 'fontnamecombobox')
+   id = value;
+   processedData.push({id: id, text: value, selected: 
selected});
});
+   console.log(processedData);
 
$(select).select2({
data: processedData,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-30 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.Notebookbar.js|8 
 loleaflet/src/control/Control.NotebookbarCalc.js|8 
 loleaflet/src/control/Control.NotebookbarImpress.js |   18 +-
 loleaflet/src/control/Control.NotebookbarWriter.js  |   14 +++---
 4 files changed, 24 insertions(+), 24 deletions(-)

New commits:
commit 2d7bd942a385146cb8d9547aa7236063c6013b36
Author: Szymon Kłos 
AuthorDate: Tue Jun 30 13:39:49 2020 +0200
Commit: Szymon Kłos 
CommitDate: Tue Jun 30 15:12:17 2020 +0200

notebookbar: translate tab names

Change-Id: I54a4b2a4f2d9137a70db5632208cd5ac2d189fdb
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97514
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.Notebookbar.js 
b/loleaflet/src/control/Control.Notebookbar.js
index aeebbe693..765f6790d 100644
--- a/loleaflet/src/control/Control.Notebookbar.js
+++ b/loleaflet/src/control/Control.Notebookbar.js
@@ -3,7 +3,7 @@
  * L.Control.Notebookbar
  */
 
-/* global $ */
+/* global $ _ */
 L.Control.Notebookbar = L.Control.extend({
 
_currentScrollPosition: 0,
@@ -94,17 +94,17 @@ L.Control.Notebookbar = L.Control.extend({
'children': [
{
'type': 'toolitem',
-   'text': 'Save',
+   'text': _('Save'),
'command': '.uno:Save'
},
{
'type': 'toolitem',
-   'text': 'Undo',
+   'text': _('Undo'),
'command': '.uno:Undo'
},
{
'type': 'toolitem',
-   'text': 'Redo',
+   'text': _('Redo'),
'command': '.uno:Redo'
}
]
diff --git a/loleaflet/src/control/Control.NotebookbarCalc.js 
b/loleaflet/src/control/Control.NotebookbarCalc.js
index 49f22a3ff..b8709c2c2 100644
--- a/loleaflet/src/control/Control.NotebookbarCalc.js
+++ b/loleaflet/src/control/Control.NotebookbarCalc.js
@@ -3,24 +3,24 @@
  * L.Control.NotebookbarCalc
  */
 
-/* global */
+/* global _ */
 L.Control.NotebookbarCalc = L.Control.NotebookbarWriter.extend({

getTabs: function() {
return [
{
-   'text': '~Home',
+   'text': _('~Home'),
'id': '2',
'name': 'HomeLabel',
'context': 'default|Cell'
},
{
-   'text': '~Insert',
+   'text': _('~Insert'),
'id': '3',
'name': 'InsertLabel'
},
{
-   'text': '~Review',
+   'text': _('~Review'),
'id': '6',
'name': 'ReviewLabel'
}
diff --git a/loleaflet/src/control/Control.NotebookbarImpress.js 
b/loleaflet/src/control/Control.NotebookbarImpress.js
index 600d9ad13..077baf28e 100644
--- a/loleaflet/src/control/Control.NotebookbarImpress.js
+++ b/loleaflet/src/control/Control.NotebookbarImpress.js
@@ -3,7 +3,7 @@
  * L.Control.NotebookbarImpress
  */
 
-/* global */
+/* global _ */
 L.Control.NotebookbarImpress = L.Control.NotebookbarWriter.extend({
 
getShortcutsBarData: function() {
@@ -14,22 +14,22 @@ L.Control.NotebookbarImpress = 
L.Control.NotebookbarWriter.extend({
'children': [
{
'type': 'toolitem',
-   'text': 'Save',
+   'text': _('Save'),
'command': '.uno:Save'
},
{
'type': 'toolitem',
-   'text': 'Start Presentation',
+   'text': _('Start Presentation'),
'command': 

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

2020-06-29 Thread Muhammet Kara (via logerrit)
 loleaflet/src/control/Toolbar.js |   53 ---
 1 file changed, 22 insertions(+), 31 deletions(-)

New commits:
commit 3dcb6b042fbd96e58d2809add3b131c1db5b9a82
Author: Muhammet Kara 
AuthorDate: Mon Jun 29 14:24:32 2020 +0300
Commit: Muhammet Kara 
CommitDate: Mon Jun 29 21:42:08 2020 +0200

Welcome: Use localStorage instead of cookies

Change-Id: I0ab431f065dbe8d76d1e7ff18023be744c590dc8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97400
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
Reviewed-by: Muhammet Kara 

diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 7f24d3a55..354175074 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -415,13 +415,7 @@ L.Map.include({
},
beforeClose: function () {
if (!calledFromMenu) {
-   var WSDVerCookie = 'WSDWelcomeVersion=' 
+ map._socket.WSDServer.Version;
-   // Cookie will not expire for a year, 
and it will not be sent to other domains
-   var cookiePath = '/loleaflet';
-   if (window.socketProxy)
-   cookiePath = window.host + 
window.serviceRoot + cookiePath;
-   WSDVerCookie += '; max-age=31536000; 
SameSite=Lax; path=' + cookiePath;
-   document.cookie = WSDVerCookie;
+   
localStorage.setItem('WSDWelcomeVersion', map._socket.WSDServer.Version);
}
map.focus();
map.enable(true);
@@ -449,41 +443,38 @@ L.Map.include({
map._showWelcomeDialogVex(data, calledFromMenu);
})
.fail(function() {
-   // Welcome dialog disabled in loolwsd.xml or 
nonexistant for some other reason
-   // Let's check back in a day (60 x 60 x 24 = 
86400 seconds)
-   var cookiePath = '/loleaflet';
-   if (window.socketProxy)
-   cookiePath = window.host + 
window.serviceRoot + cookiePath;
-   var welcomeDisabledCookie = 
'WSDWelcomeDisabled=true; max-age=86400; SameSite=Lax; path=' + cookiePath;
-   document.cookie = welcomeDisabledCookie;
+   var currentDate = new Date();
+   localStorage.setItem('WSDWelcomeDisabled', 
'true');
+   localStorage.setItem('WSDWelcomeDisabledDate', 
currentDate.toDateString());
 
if (calledFromMenu)
map._showWelcomeDialogVex(_('We are 
sorry, the information about the latest updates is not available.'));
});
},
 
-   getCookie: function(name) {
-   var cookies = document.cookie.split(';');
-   for (var i = 0; i < cookies.length; i++) {
-   var cookie = cookies[i].trim();
-   if (cookie.indexOf(name) === 0) {
-   return cookie;
-   }
-   }
-
-   return '';
-   },
-
shouldWelcome: function() {
if (!window.enableWelcomeMessage || L.Browser.cypressTest)
return false;
 
-   var currentVerCookie = this.getCookie('WSDWelcomeVersion');
-   var newVerCookie = 'WSDWelcomeVersion=' + 
this._socket.WSDServer.Version;
-   var welcomeDisabledCookie = 
this.getCookie('WSDWelcomeDisabled');
-   var isWelcomeDisabled = welcomeDisabledCookie === 
'WSDWelcomeDisabled=true';
+   var storedVersion = localStorage.getItem('WSDWelcomeVersion');
+   var currentVersion = this._socket.WSDServer.Version;
+   var welcomeDisabledCookie = 
localStorage.getItem('WSDWelcomeDisabled');
+   var welcomeDisabledDate = 
localStorage.getItem('WSDWelcomeDisabledDate');
+   var isWelcomeDisabled = false;
+
+   if (welcomeDisabledCookie && welcomeDisabledDate) {
+   // Check if we are stil in the same day
+   var currentDate = new Date();
+   if (welcomeDisabledDate === currentDate.toDateString())
+   isWelcomeDisabled = true;
+   else {
+   //Values expired. Clear the local values
+   

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

2020-06-29 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.NotebookbarCalc.js|   24 --
 loleaflet/src/control/Control.NotebookbarImpress.js |   32 -
 loleaflet/src/control/Control.NotebookbarWriter.js  |   48 
 3 files changed, 104 deletions(-)

New commits:
commit 8ea84768fd9875216adb0387a9ffd6a4f0aff66d
Author: Szymon Kłos 
AuthorDate: Wed Jun 17 09:18:33 2020 +0200
Commit: Szymon Kłos 
CommitDate: Mon Jun 29 08:42:23 2020 +0200

notebookbar: remove local tabs loading

Change-Id: I5241d1360852cd1f450f211420c0782ca4a2a587
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97230
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.NotebookbarCalc.js 
b/loleaflet/src/control/Control.NotebookbarCalc.js
index a6b95f3ef..0a5df17cc 100644
--- a/loleaflet/src/control/Control.NotebookbarCalc.js
+++ b/loleaflet/src/control/Control.NotebookbarCalc.js
@@ -5,22 +5,6 @@
 
 /* global */
 L.Control.NotebookbarCalc = L.Control.NotebookbarWriter.extend({
-
-   selectedTab: function(tabText) {
-   switch (tabText) {
-   case 'HomeLabel':
-   this.loadTab(this.getHomeTab());
-   break;
-
-   case 'InsertLabel':
-   this.loadTab(this.getInsertTab());
-   break;
-
-   case 'ReviewLabel':
-   this.loadTab(this.getReviewTab());
-   break;
-   }
-   },

getTabs: function() {
return [
@@ -1555,14 +1539,6 @@ L.Control.NotebookbarCalc = 
L.Control.NotebookbarWriter.extend({
}
]
};
-   },
-
-   getInsertTab: function() {
-   return {};
-   },
-
-   getReviewTab: function() {
-   return {};
}
 });
 
diff --git a/loleaflet/src/control/Control.NotebookbarImpress.js 
b/loleaflet/src/control/Control.NotebookbarImpress.js
index 0427a7ec0..600d9ad13 100644
--- a/loleaflet/src/control/Control.NotebookbarImpress.js
+++ b/loleaflet/src/control/Control.NotebookbarImpress.js
@@ -36,26 +36,6 @@ L.Control.NotebookbarImpress = 
L.Control.NotebookbarWriter.extend({
}
];
},
-
-   selectedTab: function(tabText) {
-   switch (tabText) {
-   case 'HomeLabel':
-   this.loadTab(this.getHomeTab());
-   break;
-
-   case 'InsertLabel':
-   this.loadTab(this.getInsertTab());
-   break;
-
-   case 'ReviewLabel':
-   this.loadTab(this.getReviewTab());
-   break;
-
-   case 'TableLabel':
-   this.loadTab(this.getTableTab());
-   break;
-   }
-   },

getTabs: function() {
return [
@@ -1464,18 +1444,6 @@ L.Control.NotebookbarImpress = 
L.Control.NotebookbarWriter.extend({
}
]
};
-   },
-
-   getInsertTab: function() {
-   return {};
-   },
-
-   getReviewTab: function() {
-   return {};
-   },
-
-   getTableTab: function() {
-   return {};
}
 });
 
diff --git a/loleaflet/src/control/Control.NotebookbarWriter.js 
b/loleaflet/src/control/Control.NotebookbarWriter.js
index 98a030c25..fb8e2b5a9 100644
--- a/loleaflet/src/control/Control.NotebookbarWriter.js
+++ b/loleaflet/src/control/Control.NotebookbarWriter.js
@@ -6,34 +6,6 @@
 /* global */
 L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
 
-   selectedTab: function(tabText) {
-   switch (tabText) {
-   case 'HomeLabel':
-   this.loadTab(this.getHomeTab());
-   break;
-
-   case 'InsertLabel':
-   this.loadTab(this.getInsertTab());
-   break;
-
-   case 'LayoutLabel':
-   this.loadTab(this.getLayoutTab());
-   break;
-
-   case 'ReferencesLabel':
-   this.loadTab(this.getReferencesTab());
-   break;
-
-   case 'TableLabel':
-   this.loadTab(this.getTableTab());
-   break;
-
-   case 'ReviewLabel':
-   this.loadTab(this.getReviewTab());
-   break;
-   }
-   },
-
getTabs: function() {
return [
{
@@ -1447,26 +1419,6 @@ L.Control.NotebookbarWriter = 
L.Control.Notebookbar.extend({
}
]
};
-   },
-
-   getInsertTab: function() {
-   

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

2020-06-27 Thread Tomaž Vajngerl (via logerrit)
 loleaflet/src/control/Permission.js |9 +
 loleaflet/src/core/Socket.js|2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 21b6e15c03b4c7fd33d58e6523b90e06f35fd820
Author: Tomaž Vajngerl 
AuthorDate: Wed Jun 24 16:00:58 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Sun Jun 28 00:37:08 2020 +0200

Wrong "perm" value when setting permission, works by accident

When "perm:" message is sent, in case of PDF we send the payload
"perm: readonly", which is then parsed as " readonly" (with extra
space). If a proper "readonly" value would be parsed, JS would
get stuck, because the code assumes that "doclayer" is available,
which is not the case. So this fixes that the command is correctly
parsed and that it doesn't get stuck by not running the code that
assumes doclayer is available.

Change-Id: I35b6cc25209b4ed259f33f7fb77bc0be7a69033e
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97331
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/loleaflet/src/control/Permission.js 
b/loleaflet/src/control/Permission.js
index e8fe959ca..3c1f5e172 100644
--- a/loleaflet/src/control/Permission.js
+++ b/loleaflet/src/control/Permission.js
@@ -62,10 +62,11 @@ L.Map.include({
 
this.dragging.enable();
// disable all user interaction, will need to add keyboard too
-   this._docLayer._onUpdateCursor();
-   this._docLayer._clearSelections();
-   this._docLayer._onUpdateTextSelection();
-
+   if (this._docLayer) {
+   this._docLayer._onUpdateCursor();
+   this._docLayer._clearSelections();
+   this._docLayer._onUpdateTextSelection();
+   }
this.fire('updatepermission', {perm : perm});
},
 
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 80decbee2..5a5568424 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -322,7 +322,7 @@ L.Socket = L.Class.extend({
this._map._clip.setKey(key);
}
else if (textMsg.startsWith('perm:')) {
-   var perm = textMsg.substring('perm:'.length);
+   var perm = textMsg.substring('perm:'.length).trim();
 
// This message is often received very early before 
doclayer is initialized
// Change options.permission so that when docLayer is 
initialized, it
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-26 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.NotebookbarCalc.js| 1512 +++-
 loleaflet/src/control/Control.NotebookbarImpress.js | 1380 ++
 loleaflet/src/control/Control.NotebookbarWriter.js  | 1376 ++
 3 files changed, 4265 insertions(+), 3 deletions(-)

New commits:
commit ef4799e31240ddcb3825c26dbfa548e0445e39fb
Author: Szymon Kłos 
AuthorDate: Tue Jun 16 15:53:47 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri Jun 26 15:25:47 2020 +0200

notebookbar: cached home tab

Change-Id: Ibb97c5bbf63b673715444c7753c164babb1a7960
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97208
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.NotebookbarCalc.js 
b/loleaflet/src/control/Control.NotebookbarCalc.js
index 779d27f31..a6b95f3ef 100644
--- a/loleaflet/src/control/Control.NotebookbarCalc.js
+++ b/loleaflet/src/control/Control.NotebookbarCalc.js
@@ -44,7 +44,1517 @@ L.Control.NotebookbarCalc = 
L.Control.NotebookbarWriter.extend({
},
 
getHomeTab: function() {
-   return {};
+   return {
+   'id': '',
+   'type': 'control',
+   'text': '',
+   'enabled': 'true',
+   'children': [
+   {
+   'id': '',
+   'type': 'container',
+   'text': '',
+   'enabled': 'true',
+   'children': [
+   {
+   'id': 'NotebookBar',
+   'type': 'grid',
+   'text': '',
+   'enabled': 'true',
+   'children': [
+   {
+   'id': 
'box1',
+   'type': 
'container',
+   'text': 
'',
+   
'enabled': 'true',
+   
'children': [
+   
{
+   
'id': 'ContextContainer',
+   
'type': 'tabcontrol',
+   
'text': '',
+   
'enabled': 'true',
+   
'children': [
+   
{
+   
'id': '',
+   
'type': 'pushbutton',
+   
'text': '',
+   
'enabled': 'true'
+   
},
+   
{
+   
'id': '',
+   
'type': 'toolbox',
+   
'text': '',
+   
'enabled': 'true',
+   
'children': [
+   
{
+   
'type': 'toolitem',
+   

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

2020-06-26 Thread Mike Kaganski (via logerrit)
 loleaflet/src/map/Map.js |5 +
 wsd/DocumentBroker.cpp   |4 
 2 files changed, 9 insertions(+)

New commits:
commit ec1bc5807090dea9f28ef25c6211785c7fa1a00f
Author: Mike Kaganski 
AuthorDate: Fri Jun 26 14:47:37 2020 +0300
Commit: Andras Timar 
CommitDate: Fri Jun 26 14:42:34 2020 +0200

Don't show last modification indicator when data is unavailable

E.g., SharePoint 2013 and 2016 don't support LastModifiedTime field
in CheckFileInfo [1].

[1] 
https://docs.microsoft.com/en-us/openspecs/office_protocols/ms-wopi/e2e91eab-4c6d-4f00-9c3f-3a1962135626#Appendix_A_30

Change-Id: Icdcf9f82758b4bd34be25f553e9d756ab76b8bfa
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97221
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 67bac9bfd..5f9882a53 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -386,6 +386,11 @@ L.Map = L.Evented.extend({
if (lastModButton !== null && lastModButton !== undefined
&& lastModButton.firstChild.innerHTML !== null
&& lastModButton.firstChild.childElementCount == 0) {
+   if (this._lastmodtime == null) {
+   // No modification time -> hide the indicator
+   lastModButton.innerHTML = '';
+   return;
+   }
var mainSpan = document.createElement('span');
var label = document.createTextNode(_('Last 
modification'));
var separator = document.createTextNode(': ');
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index fe99ed26a..f062e0145 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -74,6 +74,10 @@ void sendLastModificationTime(const 
std::shared_ptr& session,
 if (!session)
 return;
 
+if (documentLastModifiedTime == std::chrono::system_clock::time_point())
+// No time from the storage (e.g., SharePoint 2013 and 2016) -> don't 
send
+return;
+
 std::stringstream stream;
 stream << "lastmodtime: " << documentLastModifiedTime;
 const std::string message = stream.str();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-26 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |3 ++-
 loleaflet/src/control/Control.Notebookbar.js |5 +
 loleaflet/src/layer/tile/TileLayer.js|6 ++
 3 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 3170684c48b8eec51953feefa068943211787547
Author: Szymon Kłos 
AuthorDate: Tue Jun 16 11:53:42 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri Jun 26 14:09:36 2020 +0200

notebookbar: show when message arrives

Change-Id: Ib826c0ae2be1590233c4a16c24b548424d501eca
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97207
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index c18986d67..2542e707b 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -231,7 +231,8 @@ L.Control.JSDialogBuilder = L.Control.extend({
} else if (object) {
data = typeof data === 'string' ? data.replace('"', 
'\\"') : data;
var windowId = window.mobileDialogId !== undefined ? 
window.mobileDialogId :
-   
(window.sidebarId !== undefined ? window.sidebarId : -1);
+   
(window.notebookbarId !== undefined ? window.notebookbarId :
+   
(window.sidebarId !== undefined ? window.sidebarId : -1));
var message = 'dialogevent ' + windowId
+ ' {\"id\":\"' + object.id
+ '\", \"cmd\": \"' + eventType
diff --git a/loleaflet/src/control/Control.Notebookbar.js 
b/loleaflet/src/control/Control.Notebookbar.js
index b18dcf611..71b801fca 100644
--- a/loleaflet/src/control/Control.Notebookbar.js
+++ b/loleaflet/src/control/Control.Notebookbar.js
@@ -18,6 +18,11 @@ L.Control.Notebookbar = L.Control.extend({
this.setupResizeHandler();
 
this.map.on('contextchange', this.onContextChange, this);
+   this.map.on('notebookbar', this.onNotebookbar, this);
+   },
+
+   onNotebookbar: function(data) {
+   this.loadTab(data);
},
 
clearNotebookbar: function() {
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index eb0a7b14a..f666ce519 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1004,6 +1004,12 @@ L.TileLayer = L.GridLayer.extend({
} else {
this._closeMobileWizard();
}
+   } else {
+   msgData = 
JSON.parse(textMsg.substring('jsdialog:'.length + 1));
+   if (msgData.type == 'borderwindow') {
+   window.notebookbarId = msgData.id;
+   this._map.fire('notebookbar', 
msgData.children[2]);
+   }
}
},
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-25 Thread mert (via logerrit)
 loleaflet/src/control/Toolbar.js |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 94402959af480b2026c3f785e48f236e44bb0830
Author: mert 
AuthorDate: Thu Jun 25 18:53:39 2020 +0300
Commit: Andras Timar 
CommitDate: Thu Jun 25 22:37:01 2020 +0200

Fix images are not shown in online help page on proxy

Relative urls must be replaced for proxy

Change-Id: Ia1d888941c33736c4eb19070aec73c5bdd6fa197
Signed-off-by: mert 
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97166
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 89c191294..7f24d3a55 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -254,6 +254,15 @@ L.Map.include({
}
} else /* id === 'online-help' */ {

document.getElementById('keyboard-shortcuts').style.display='none';
+   if (window.socketProxy) {
+   var helpdiv = 
document.getElementById('online-help');
+   var imgList = 
helpdiv.querySelectorAll('img');
+   for (var p = 0; p < 
imgList.length; p++) {
+   var imgSrc = 
imgList[p].src;
+   imgSrc = 
imgSrc.substring(imgSrc.indexOf('/images'));
+   imgList[p].src 
= window.host + window.serviceRoot + '/loleaflet/dist'+ imgSrc;
+   }
+   }
// Display help according to 
document opened
if (map.getDocType() === 
'text') {
var x = 
document.getElementsByClassName('text');
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-25 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.NotebookbarBuilder.js |   13 +
 1 file changed, 13 insertions(+)

New commits:
commit 5e4f9b45541acf44d02dab4945b574feb53d381a
Author: Szymon Kłos 
AuthorDate: Tue Jun 16 14:10:51 2020 +0200
Commit: Szymon Kłos 
CommitDate: Thu Jun 25 12:51:56 2020 +0200

notebookbar: styles preview next/prev buttons

Change-Id: I827e84bc36dad3c29178b17c42b2623b69d9786f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97105
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index e344e693f..66c66adf7 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -45,6 +45,9 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
this._toolitemHandlers['.uno:Presentation'] = 
this._startPresentationControl;
this._toolitemHandlers['.uno:Save'] = this._saveControl;
 
+   this._toolitemHandlers['up'] = this._toolbarItemControl;
+   this._toolitemHandlers['down'] = this._toolbarItemControl;
+
this._toolitemHandlers['.uno:SelectWidth'] = function() {};
this._toolitemHandlers['.uno:SetOutline'] = function() {};
this._toolitemHandlers['.uno:DesignerDialog'] = function() {};
@@ -374,6 +377,16 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
}
},
 
+   _toolbarItemControl: function(parentContainer, data, builder) {
+   builder.options.useInLineLabelsForUnoButtons = false;
+   var control = builder._unoToolButton(parentContainer, data, 
builder);
+
+   $(control.container).unbind('click');
+   $(control.container).click(function () {
+   builder.callback('toolbox', 'click', {id: 
data.parent.id}, data.command, builder);
+   });
+   },
+
_lineSpacingControl: function(parentContainer, data, builder) {
var control = builder._unoToolButton(parentContainer, data, 
builder);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-25 Thread Andras Timar (via logerrit)
 loleaflet/src/control/Control.Menubar.js  |2 +-
 loleaflet/src/map/handler/Map.Keyboard.js |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a5be1c089b0418cb833c93944b92f9c3336c6e92
Author: Andras Timar 
AuthorDate: Thu Jun 25 12:18:36 2020 +0200
Commit: Andras Timar 
CommitDate: Thu Jun 25 12:38:01 2020 +0200

Fix: when help was invoked with F1 %productName was not replaced

Change-Id: I2f0255e0aedbe70116b2fb7423b0d077c14fa7b4
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97104
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 240dd9c50..39a4e8146 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -1295,7 +1295,7 @@ L.Control.Menubar = L.Control.extend({
 
// handle help - F1
if (e.type === 'keydown' && !e.shiftKey && !e.ctrlKey && 
!e.altKey && e.keyCode == 112) {
-   self._map.showHelp();
+   self._map.showHelp('online-help');
}
},
 
diff --git a/loleaflet/src/map/handler/Map.Keyboard.js 
b/loleaflet/src/map/handler/Map.Keyboard.js
index 6ba2dc165..6ea10c40e 100644
--- a/loleaflet/src/map/handler/Map.Keyboard.js
+++ b/loleaflet/src/map/handler/Map.Keyboard.js
@@ -308,7 +308,7 @@ L.Map.Keyboard = L.Handler.extend({
 
// handle help - F1
if (ev.type === 'keydown' && !shift && !ctrl && !alt && !cmd && 
keyCode === 112) {
-   this._map.showHelp();
+   this._map.showHelp('online-help');
ev.preventDefault();
return;
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-22 Thread Gary Kim (via logerrit)
 loleaflet/src/core/Socket.js |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 6d7128e79301c73557f65968b2f46740977e6364
Author: Gary Kim 
AuthorDate: Mon May 18 23:14:07 2020 +0800
Commit: Jan Holesovsky 
CommitDate: Mon Jun 22 18:22:03 2020 +0200

fix: remove target="_blank" on javascript open links

Using target="_blank" on these links cause them
to not work in browsers.

This commit removes the attribute to fix the issue.

Change-Id: I157f15589b17722aa5c0ef5eada02084fe5b2a5e
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94435
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 

diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 9f48d3145..80decbee2 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -283,7 +283,7 @@ L.Socket = L.Class.extend({
this.WSDServer = 
JSON.parse(textMsg.substring(textMsg.indexOf('{')));
var h = this.WSDServer.Hash;
if (parseInt(h,16).toString(16) === 
h.toLowerCase().replace(/^0+/, '')) {
-   h = 'https://hub.libreoffice.org/git-online/' + h + 
'\');">' + h + '';
+   h = 'https://hub.libreoffice.org/git-online/' + h + 
'\');">' + h + '';

$('#loolwsd-version').html(this.WSDServer.Version + ' (git hash: ' + h + ')');
}
else {
@@ -306,7 +306,7 @@ L.Socket = L.Class.extend({
var lokitVersionObj = 
JSON.parse(textMsg.substring(textMsg.indexOf('{')));
h = lokitVersionObj.BuildId.substring(0, 7);
if (parseInt(h,16).toString(16) === 
h.toLowerCase().replace(/^0+/, '')) {
-   h = 'https://hub.libreoffice.org/git-core/' + h + 
'\');">' + h + '';
+   h = 'https://hub.libreoffice.org/git-core/' + h + 
'\');">' + h + '';
}
$('#lokit-version').html(lokitVersionObj.ProductName + 
' ' +
 lokitVersionObj.ProductVersion 
+ lokitVersionObj.ProductExtension.replace('.10.','-') +
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-22 Thread Tamás Zolnai (via logerrit)
 loleaflet/src/control/Control.Menubar.js |1 -
 loleaflet/src/control/Control.Toolbar.js |1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ee53ffa18b73731b602ae1cc90629d5d263e66c3
Author: Tamás Zolnai 
AuthorDate: Mon Jun 22 11:11:18 2020 +0200
Commit: Tamás Zolnai 
CommitDate: Mon Jun 22 13:26:08 2020 +0200

Set doctype class earlier so we have it after the document is opened.

Without this change this class was added only after
the app stepped into editing mode.
This class makes easy to identify document type in a
cypress test.

Change-Id: I83ea144830e20610b60a6ff571c11a45daa1fc4c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96840
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tamás Zolnai 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index c8d12a868..240dd9c50 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -1310,7 +1310,6 @@ L.Control.Menubar = L.Control.extend({
iconClass += ' impress-icon-img';
}
$('.main-nav').addClass(docType + '-color-indicator');
-   $('#document-container').addClass(docType + '-doctype');
 
var liItem = L.DomUtil.create('li', '');
liItem.id = 'document-header';
diff --git a/loleaflet/src/control/Control.Toolbar.js 
b/loleaflet/src/control/Control.Toolbar.js
index 4a797ffb0..1eccdce82 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -870,6 +870,7 @@ function onCommandStateChanged(e) {
 }
 
 function onUpdateParts(e) {
+   $('#document-container').addClass(e.docType + '-doctype');
if (e.docType === 'text') {
var current = e.currentPage;
var count = e.pages;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-19 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.NotebookbarBuilder.js |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 2a538bbb84d64301fd029f42e907b9a55c872beb
Author: Szymon Kłos 
AuthorDate: Fri Jun 19 13:01:05 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri Jun 19 14:48:15 2020 +0200

notebookbar: removed not working button

Change-Id: I22e68b3237a555ef35a8f66ad343a3e2eb17c81b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96716
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index be08a9948..e344e693f 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -127,6 +127,7 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
this._toolitemHandlers['.uno:ImportFromFile'] = function() {};
this._toolitemHandlers['.uno:PhotoAlbumDialog'] = function() {};
this._toolitemHandlers['.uno:AutoFormat'] = function() {};
+   this._toolitemHandlers['.uno:Spacing'] = function() {};
 
this._toolitemHandlers['vnd.sun.star.findbar:FocusToFindbar'] = 
function() {};
},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-19 Thread Andras Timar (via logerrit)
 loleaflet/src/layer/marker/ProgressOverlay.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a0d547ab0e84e9c21667d57893d4535eb8bbce7d
Author: Andras Timar 
AuthorDate: Fri Jun 19 12:45:20 2020 +0200
Commit: Andras Timar 
CommitDate: Fri Jun 19 12:45:20 2020 +0200

default brandProductName should be LibreOffice Online

Change-Id: Iaf95f6963f19be6065c77dfc2d8693178ee527d6

diff --git a/loleaflet/src/layer/marker/ProgressOverlay.js 
b/loleaflet/src/layer/marker/ProgressOverlay.js
index 090f8b078..aeebfe495 100644
--- a/loleaflet/src/layer/marker/ProgressOverlay.js
+++ b/loleaflet/src/layer/marker/ProgressOverlay.js
@@ -53,7 +53,7 @@ L.ProgressOverlay = L.Layer.extend({
this._spinner = L.DomUtil.create('div', 
'leaflet-progress-spinner', this._container);
this._spinnerCanvas = L.DomUtil.create('canvas', 
'leaflet-progress-spinner-canvas', this._spinner);
 
-   var productName = (typeof brandProductName !== 'undefined') ? 
brandProductName : 'LibreOffice Online (Unsupported)';
+   var productName = (typeof brandProductName !== 'undefined') ? 
brandProductName : 'LibreOffice Online';
this._brandLabel = L.DomUtil.create('div', 
'leaflet-progress-label', this._container);
this._brandLabel.innerHTML = productName;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-19 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 80354885fd393a70be410d1c9be24ff72b12e514
Author: Szymon Kłos 
AuthorDate: Wed Jun 17 09:19:10 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri Jun 19 12:41:06 2020 +0200

jsdialog: send real tab id not displayed order

Change-Id: I44770160f1e25cc8d75ff19fadb423f9e93a1ff1
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96689
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index b3bd9cfcd..09cb585d8 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -648,12 +648,13 @@ L.Control.JSDialogBuilder = L.Control.extend({
_createTabClick: function(builder, t, tabs, contentDivs, tabIds)
{
return function() {
-   $(tabs[t]).addClass('selected');
for (var i = 0; i < tabs.length; i++) {
-   if (i !== t)
+   if (tabs[i].number != t)
{
$(tabs[i]).removeClass('selected');
$(contentDivs[i]).hide();
+   } else {
+   $(tabs[i]).addClass('selected');
}
}
$(contentDivs[t]).show();
@@ -677,6 +678,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 
var tab = L.DomUtil.create('div', 'ui-tab ' + 
builder.options.cssClass, tabsContainer);
tab.id = data.tabs[tabIdx].name;
+   tab.number = data.tabs[tabIdx].id - 1;
if (data.selected == data.tabs[tabIdx].id)
$(tab).addClass('selected');
tabs[tabIdx] = tab;
@@ -703,7 +705,7 @@ L.Control.JSDialogBuilder = L.Control.extend({

builder.callback('tabcontrol', 'selecttab', tabsContainer, id, builder);
};
};
-   $(tabs[t]).click(fn(t));
+   $(tabs[t]).click(fn(data.tabs[t].id - 
1));
}
} else {
console.debug('Builder used outside of mobile 
wizard: please implement the click handler');
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-19 Thread Pranam Lashkari (via logerrit)
 loleaflet/src/layer/marker/ProgressOverlay.js |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit e8204c9213dd221ae432babd6fa717cf621a4b48
Author: Pranam Lashkari 
AuthorDate: Thu Jun 18 17:56:29 2020 +0530
Commit: Andras Timar 
CommitDate: Fri Jun 19 11:55:11 2020 +0200

leaflet: show brand name on splashscreen

Change-Id: Ie7d93a134e869e14b5e4c1f8599feb8a9e130c07
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96602
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/layer/marker/ProgressOverlay.js 
b/loleaflet/src/layer/marker/ProgressOverlay.js
index 7100243d8..090f8b078 100644
--- a/loleaflet/src/layer/marker/ProgressOverlay.js
+++ b/loleaflet/src/layer/marker/ProgressOverlay.js
@@ -3,6 +3,7 @@
  * L.ProgressOverlay is used to overlay progress images over the map.
  */
 
+ /* global brandProductName */
 L.ProgressOverlay = L.Layer.extend({
 
options: {
@@ -51,6 +52,12 @@ L.ProgressOverlay = L.Layer.extend({
this._container = L.DomUtil.create('div', 
'leaflet-progress-layer');
this._spinner = L.DomUtil.create('div', 
'leaflet-progress-spinner', this._container);
this._spinnerCanvas = L.DomUtil.create('canvas', 
'leaflet-progress-spinner-canvas', this._spinner);
+
+   var productName = (typeof brandProductName !== 'undefined') ? 
brandProductName : 'LibreOffice Online (Unsupported)';
+   this._brandLabel = L.DomUtil.create('div', 
'leaflet-progress-label', this._container);
+   this._brandLabel.innerHTML = productName;
+
+
this._label = L.DomUtil.create('div', 'leaflet-progress-label', 
this._container);
this._progress = L.DomUtil.create('div', 'leaflet-progress', 
this._container);
this._bar = L.DomUtil.create('span', '', this._progress);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-19 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.NotebookbarBuilder.js |   22 
 1 file changed, 22 insertions(+)

New commits:
commit 8bff7cca1a84d6026acc2e75c28f2dca651ffbea
Author: Szymon Kłos 
AuthorDate: Wed Jun 17 09:27:10 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri Jun 19 11:41:40 2020 +0200

notebookbar: remove unsupported items

Change-Id: If070d929ba7b4294135e27ac1ab7984b59c86b4e
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96687
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index 864b14e8d..861b61ca5 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -19,6 +19,8 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
 
this._controlHandlers['pushbutton'] = function() { return 
false; };
this._controlHandlers['spinfield'] = function() { return false; 
};
+   this._controlHandlers['formattedfield'] = function() { return 
false; };
+   this._controlHandlers['metricfield'] = function() { return 
false; };
 
this._toolitemHandlers['.uno:XLineColor'] = this._colorControl;
this._toolitemHandlers['.uno:FontColor'] = this._colorControl;
@@ -106,6 +108,26 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
this._toolitemHandlers['.uno:AnimationEffects'] = function() {};
this._toolitemHandlers['.uno:OptimizeTable'] = function() {};
this._toolitemHandlers['.uno:TableDesign'] = function() {};
+   this._toolitemHandlers['.uno:ContourDialog'] = function() {};
+   this._toolitemHandlers['.uno:TextWrap'] = function() {};
+   this._toolitemHandlers['.uno:AcceptTrackedChangeToNext'] = 
function() {};
+   this._toolitemHandlers['.uno:RejectTrackedChangeToNext'] = 
function() {};
+   this._toolitemHandlers['.uno:RedactDoc'] = function() {};
+   this._toolitemHandlers['.uno:TableCellBackgroundColor'] = 
function() {};
+   this._toolitemHandlers['.uno:FrameLineColor'] = function() {};
+   this._toolitemHandlers['.uno:ProtectTraceChangeMode'] = 
function() {};
+   this._toolitemHandlers['.uno:RowOperations'] = function() {};
+   this._toolitemHandlers['.uno:ColumnOperations'] = function() {};
+   this._toolitemHandlers['.uno:Insert'] = function() {};
+   this._toolitemHandlers['.uno:InsertCell'] = function() {};
+   this._toolitemHandlers['.uno:AddName'] = function() {};
+   this._toolitemHandlers['.uno:DefineName'] = function() {};
+   this._toolitemHandlers['.uno:ToolProtectionDocument'] = 
function() {};
+   this._toolitemHandlers['.uno:Protect'] = function() {};
+   this._toolitemHandlers['.uno:ImportFromFile'] = function() {};
+   this._toolitemHandlers['.uno:PhotoAlbumDialog'] = function() {};
+   this._toolitemHandlers['.uno:AutoFormat'] = function() {};
+
this._toolitemHandlers['vnd.sun.star.findbar:FocusToFindbar'] = 
function() {};
},
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-19 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |4 
 1 file changed, 4 insertions(+)

New commits:
commit 82fe00831adef79df1bae3fefc234180078878dc
Author: Szymon Kłos 
AuthorDate: Tue Jun 16 11:52:19 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri Jun 19 11:17:26 2020 +0200

jsdialog: send click event for drawing area

Change-Id: I7f162a103fc3dc67166f66d4a57390d3ef3ecdd9
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96681
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 101e3d3bb..0c91dedc2 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1549,6 +1549,10 @@ L.Control.JSDialogBuilder = L.Control.extend({
var image = L.DomUtil.create('img', 
builder.options.cssClass + ' ui-drawing-area', parentContainer);
image.src = data.image.replace('\\', '');
image.id = data.id;
+
+   $(image).click(function () {
+   builder.callback('drawingarea', 'click', image, 
null, builder);
+   });
}
return false;
},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-18 Thread Pranam Lashkari (via logerrit)
 loleaflet/src/control/Control.MobileWizard.js |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 801386effc84dd6e2d7c706c36a1c8bd6131d496
Author: Pranam Lashkari 
AuthorDate: Wed Jun 17 21:29:45 2020 +0530
Commit: Pedro Silva 
CommitDate: Thu Jun 18 17:20:49 2020 +0200

leaflet: hamburger menu: submenu entries are shown

once entered submenu and then going back will still show submenu options

Change-Id: Ifa0c86e4b6a5a316543b90c1f694d1cbad4cf34b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96528
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Tested-by: Pedro Silva 
Reviewed-by: Pedro Silva 

diff --git a/loleaflet/src/control/Control.MobileWizard.js 
b/loleaflet/src/control/Control.MobileWizard.js
index 406ba8716..c0cd3b985 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -221,8 +221,10 @@ L.Control.MobileWizard = L.Control.extend({
else
this._setTitle(this._mainTitle);
 
-   $('.ui-content.level-' + this._currentDepth + 
'.mobile-wizard').siblings().show('slide', { direction: 'left' }, 'fast');
+   var content = $('.ui-content.level-' + 
this._currentDepth + '.mobile-wizard');
+
$('.ui-content.level-' + this._currentDepth + 
'.mobile-wizard').hide();
+   content.siblings().not(content).show('slide', { 
direction: 'left', queue: false }, 'fast');
$('#mobile-wizard.funcwizard 
div#mobile-wizard-content').removeClass('showHelpBG');
$('#mobile-wizard.funcwizard 
div#mobile-wizard-content').addClass('hideHelpBG');
$('.ui-header.level-' + this._currentDepth + 
'.mobile-wizard').show('slide', { direction: 'left' }, 'fast');
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-17 Thread Aron Budea (via logerrit)
 loleaflet/src/control/Control.UIManager.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0613c93272bff6df16f7bf3727c7180f5bc0844f
Author: Aron Budea 
AuthorDate: Wed Jun 17 09:12:16 2020 +0200
Commit: Aron Budea 
CommitDate: Wed Jun 17 19:41:16 2020 +0200

loleaflet: Show presentation controls on tablets

regression from an unknown commit

Change-Id: Iad36563c9a6c7588f12610ccd2fe18eef38628bb
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96514
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/loleaflet/src/control/Control.UIManager.js 
b/loleaflet/src/control/Control.UIManager.js
index 9c1b3e7f6..5cb657a25 100644
--- a/loleaflet/src/control/Control.UIManager.js
+++ b/loleaflet/src/control/Control.UIManager.js
@@ -90,7 +90,7 @@ L.Control.UIManager = L.Control.extend({
this.map.addControl(L.control.formulaBar());
}
 
-   if (isDesktop && docType === 'presentation') {
+   if (docType === 'presentation' && (isDesktop || 
window.mode.isTablet())) {
this.map.addControl(L.control.presentationBar());
}
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-15 Thread Muhammet Kara (via logerrit)
 loleaflet/src/control/Toolbar.js |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2a20ea216a60d1ed970dd538925f84997fc6c7f0
Author: Muhammet Kara 
AuthorDate: Thu Jun 11 01:35:15 2020 +0300
Commit: Muhammet Kara 
CommitDate: Mon Jun 15 15:25:33 2020 +0200

Relax the cookie for the Welcome message

Change-Id: Ia58b6a0125ece8eb4c3a6ea14c03c7c33dfc655a
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96351
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Muhammet Kara 

diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 2f6f28ad6..89c191294 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -411,7 +411,7 @@ L.Map.include({
var cookiePath = '/loleaflet';
if (window.socketProxy)
cookiePath = window.host + 
window.serviceRoot + cookiePath;
-   WSDVerCookie += '; max-age=31536000; 
SameSite=Strict; path=' + cookiePath;
+   WSDVerCookie += '; max-age=31536000; 
SameSite=Lax; path=' + cookiePath;
document.cookie = WSDVerCookie;
}
map.focus();
@@ -445,7 +445,7 @@ L.Map.include({
var cookiePath = '/loleaflet';
if (window.socketProxy)
cookiePath = window.host + 
window.serviceRoot + cookiePath;
-   var welcomeDisabledCookie = 
'WSDWelcomeDisabled=true; max-age=86400; SameSite=Strict; path=' + cookiePath;
+   var welcomeDisabledCookie = 
'WSDWelcomeDisabled=true; max-age=86400; SameSite=Lax; path=' + cookiePath;
document.cookie = welcomeDisabledCookie;
 
if (calledFromMenu)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-14 Thread Tor Lillqvist (via logerrit)
 loleaflet/src/control/Ruler.js |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 1ae28bd73818483eea1e84cb4dcb0d94f9751a3d
Author: Tor Lillqvist 
AuthorDate: Mon Jun 15 06:46:45 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Mon Jun 15 06:33:10 2020 +0200

Guard against uncaught exception when tileContainer.style is undefined

Happened at least for me in the iOS app.

Change-Id: Ie6f2e30c757ed5dec92dc94da52f9a055731666b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96308
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96309
Tested-by: Tor Lillqvist 

diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js
index cca4e46ed..011b16488 100644
--- a/loleaflet/src/control/Ruler.js
+++ b/loleaflet/src/control/Ruler.js
@@ -409,7 +409,9 @@ L.Control.Ruler = L.Control.extend({
break;
}
}
-   var tileContainerXTranslate = 
parseInt(tileContainer.style.transform.match(/\(([-0-9]*)/)[1]);
+   var tileContainerXTranslate = 0;
+   if (tileContainer.style !== undefined)
+   tileContainerXTranslate = 
parseInt(tileContainer.style.transform.match(/\(([-0-9]*)/)[1]);
var mapPaneXTranslate = 
parseInt(mapPane.style.transform.match(/\(([-0-9]*)/)[1]);
 
var rulerOffset = mapPaneXTranslate + firstTileXTranslate + 
tileContainerXTranslate + (this.options.tileMargin * scale);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src wsd/DocumentBroker.cpp wsd/Storage.cpp wsd/Storage.hpp

2020-06-11 Thread Michael Meeks (via logerrit)
 loleaflet/src/control/Control.DocumentNameInput.js |7 +++
 loleaflet/src/map/handler/Map.WOPI.js  |4 
 wsd/DocumentBroker.cpp |2 ++
 wsd/Storage.cpp|1 +
 wsd/Storage.hpp|4 
 5 files changed, 14 insertions(+), 4 deletions(-)

New commits:
commit d34854f6884940b683d4cff4b8a7496de63cae35
Author: Michael Meeks 
AuthorDate: Tue Jun 9 17:43:58 2020 +0100
Commit: Michael Meeks 
CommitDate: Thu Jun 11 19:44:01 2020 +0200

Add support for BreadcrumbDocName.

Change-Id: I06c56e92dd3acf9269140ecefb0c8bc731191260
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95960
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/src/control/Control.DocumentNameInput.js 
b/loleaflet/src/control/Control.DocumentNameInput.js
index 28db57f41..cfc4e5998 100644
--- a/loleaflet/src/control/Control.DocumentNameInput.js
+++ b/loleaflet/src/control/Control.DocumentNameInput.js
@@ -40,7 +40,7 @@ L.Control.DocumentNameInput = L.Control.extend({
},
 
documentNameCancel: function() {
-   $('#document-name-input').val(this.map['wopi'].BaseFileName);
+   
$('#document-name-input').val(this.map['wopi'].BreadcrumbDocName);
this.map._onGotFocus();
},
 
@@ -97,10 +97,9 @@ L.Control.DocumentNameInput = L.Control.extend({
},
 
onWopiProps: function(e) {
-   if (e.BaseFileName !== null) {
+   if (e.BaseFileName !== null)
// set the document name into the name field
-   $('#document-name-input').val(e.BaseFileName);
-   }
+   $('#document-name-input').val(e.BreadcrumbDocName !== 
undefined ? e.BreadcrumbDocName : e.BaseFileName);
 
if (e.UserCanNotWriteRelative === false) {
// Save As allowed
diff --git a/loleaflet/src/map/handler/Map.WOPI.js 
b/loleaflet/src/map/handler/Map.WOPI.js
index da79219e8..3e41b7fae 100644
--- a/loleaflet/src/map/handler/Map.WOPI.js
+++ b/loleaflet/src/map/handler/Map.WOPI.js
@@ -10,6 +10,7 @@ L.Map.WOPI = L.Handler.extend({
// wouldn't be possible otherwise.
PostMessageOrigin: '*',
BaseFileName: '',
+   BreadcrumbDocName: '',
DocumentLoadedTime: false,
HidePrintOption: false,
HideSaveOption: false,
@@ -76,6 +77,9 @@ L.Map.WOPI = L.Handler.extend({
}
 
this.BaseFileName = wopiInfo['BaseFileName'];
+   this.BreadcrumbDocName = wopiInfo['BreadcrumbDocName'];
+   if (this.BreadcrumbDocName === undefined)
+   this.BreadcrumbDocName = this.BaseFileName;
this.HidePrintOption = !!wopiInfo['HidePrintOption'];
this.HideSaveOption = !!wopiInfo['HideSaveOption'];
this.HideExportOption = !!wopiInfo['HideExportOption'];
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 55e921295..f62241808 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -659,6 +659,8 @@ bool DocumentBroker::load(const 
std::shared_ptr& session, const s
 wopifileinfo->setHideExportOption(true);
 
 wopiInfo->set("BaseFileName", 
wopiStorage->getFileInfo().getFilename());
+if (wopifileinfo->getBreadcrumbDocName().size())
+wopiInfo->set("BreadcrumbDocName", 
wopifileinfo->getBreadcrumbDocName());
 
 if (!wopifileinfo->getTemplateSaveAs().empty())
 wopiInfo->set("TemplateSaveAs", wopifileinfo->getTemplateSaveAs());
diff --git a/wsd/Storage.cpp b/wsd/Storage.cpp
index 3960544c2..1da4eaf74 100644
--- a/wsd/Storage.cpp
+++ b/wsd/Storage.cpp
@@ -737,6 +737,7 @@ WopiStorage::WOPIFileInfo::WOPIFileInfo(const FileInfo 
,
 JsonUtil::findJSONValue(object, "SupportsLocks", _supportsLocks);
 JsonUtil::findJSONValue(object, "SupportsRename", _supportsRename);
 JsonUtil::findJSONValue(object, "UserCanRename", _userCanRename);
+JsonUtil::findJSONValue(object, "BreadcrumbDocName", _breadcrumbDocName);
 bool booleanFlag = false;
 if (JsonUtil::findJSONValue(object, "DisableChangeTrackingRecord", 
booleanFlag))
 _disableChangeTrackingRecord = (booleanFlag ? 
WOPIFileInfo::TriState::True : WOPIFileInfo::TriState::False);
diff --git a/wsd/Storage.hpp b/wsd/Storage.hpp
index 5adb2da0c..b426d44bd 100644
--- a/wsd/Storage.hpp
+++ b/wsd/Storage.hpp
@@ -386,6 +386,8 @@ public:
 const std::string& getWatermarkText() const { return _watermarkText; }
 const std::string& getTemplateSaveAs() const { return _templateSaveAs; 
}
 const std::string& getTemplateSource() const { return _templateSource; 
}
+const std::string& getBreadcrumbDocName() const { return 
_breadcrumbDocName; }
+
 bool getUserCanWrite() const { 

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

2020-06-10 Thread Tamás Zolnai (via logerrit)
 loleaflet/src/control/Control.MobileWizard.js |   12 
 1 file changed, 12 insertions(+)

New commits:
commit 35710df7df2780b49b31b74b1884b823bd00de2f
Author: Tamás Zolnai 
AuthorDate: Wed Jun 10 18:20:03 2020 +0200
Commit: Tamás Zolnai 
CommitDate: Wed Jun 10 18:52:09 2020 +0200

Restore sidebar content deduplication.

It's still useful to avoid flickering.

This reverts commit b761ab848dcad6f38c38c28ff6619743b0502a9f.

Change-Id: If7986ddcc53c4086e05e888ad93c4831bc781796
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96061
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tamás Zolnai 

diff --git a/loleaflet/src/control/Control.MobileWizard.js 
b/loleaflet/src/control/Control.MobileWizard.js
index 6e819d359..406ba8716 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -17,6 +17,7 @@ L.Control.MobileWizard = L.Control.extend({
_currentPath: [],
_tabs: [],
_currentScrollPosition: 0,
+   _lastSidebarData: '',
 
initialize: function (options) {
L.setOptions(this, options);
@@ -329,6 +330,17 @@ L.Control.MobileWizard = L.Control.extend({
window.mobileDialogId = data.id;
}
 
+   // Sometimes it happens that we get the same sidebar
+   // structure twice. This makes hard to test mobile 
wizard.
+   if (isSidebar && L.Browser.cypressTest) {
+   var dataString = JSON.stringify(data.children);
+   if (this._isActive && this.map.showSidebar &&
+   dataString === this._lastSidebarData) {
+   return;
+   }
+   this._lastSidebarData = dataString;
+   }
+
if (this.map.getDocType() === 'presentation')
$('#mobile-wizard-header').show();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-10 Thread Pranam Lashkari (via logerrit)
 loleaflet/src/layer/tile/TileLayer.js |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 3b7c5624a74ac8962f7332c60675ed10f05a0edf
Author: Pranam Lashkari 
AuthorDate: Thu Jun 4 10:26:28 2020 +0530
Commit: Andras Timar 
CommitDate: Wed Jun 10 12:34:55 2020 +0200

leaflet: Calc: Sheet rename dialog loses focus when waiting a bit

Change-Id: Ic1504868565323b135d88c966d2fbde7207c1cb5
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95477
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index fc54013c1..7df2df248 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -6,7 +6,7 @@
 // Implement String::startsWith which is non-portable (Firefox only, it seems)
 // See 
http://stackoverflow.com/questions/646628/how-to-check-if-a-string-startswith-another-string#4579228
 
-/* global vex $ L _ */
+/* global vex $ L _ isAnyVexDialogActive */
 /*eslint no-extend-native:0*/
 if (typeof String.prototype.startsWith !== 'function') {
String.prototype.startsWith = function (str) {
@@ -316,7 +316,8 @@ L.TileLayer = L.GridLayer.extend({
map.on('statusindicator',
function (e) {
if (e.statusType === 'alltilesloaded' && 
this._docType === 'spreadsheet') {
-   this._onCellCursorShift(true);
+   if (!isAnyVexDialogActive())
+   this._onCellCursorShift(true);
}
if (e.statusType === 'alltilesloaded' && 
this._map.shouldWelcome()) {
this._map.showWelcomeDialog();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-09 Thread Michael Meeks (via logerrit)
 loleaflet/src/control/Control.DocumentNameInput.js |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit a009c83fa270d4b0c480b4b06f7d8efc82b64515
Author: Michael Meeks 
AuthorDate: Tue Jun 9 15:50:59 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Jun 9 18:08:44 2020 +0200

Pre-select base filename on rename click / focus.

Change-Id: I62fb629dc6021ab8cd60b46f73e8d9e39c2da4e0
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95953
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/src/control/Control.DocumentNameInput.js 
b/loleaflet/src/control/Control.DocumentNameInput.js
index 13f83c4d2..090cc25f9 100644
--- a/loleaflet/src/control/Control.DocumentNameInput.js
+++ b/loleaflet/src/control/Control.DocumentNameInput.js
@@ -56,6 +56,12 @@ L.Control.DocumentNameInput = L.Control.extend({
onDocumentNameFocus: function() {
// hide the caret in the main document
this.map._onLostFocus();
+   var name = this.map['wopi'].BaseFileName;
+   var extn = name.lastIndexOf('.');
+   if (extn < 0)
+   extn = name.length;
+   $('#document-name-input').val(name);
+   $('#document-name-input')[0].setSelectionRange(0, extn);
},
 
onDocLayerInit: function() {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-08 Thread Michael Meeks (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8b58ff8b248a73a1d00469d70c5cdc9a3ae08228
Author: Michael Meeks 
AuthorDate: Mon Jun 8 16:27:50 2020 +0100
Commit: Michael Meeks 
CommitDate: Mon Jun 8 18:02:50 2020 +0200

Proxy: remove double images/ in path.

Change-Id: I0db7953501acf397e361a0483a999735bfce7557
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95842
Tested-by: Michael Meeks 
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index debd6739a..8c8426c9e 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -567,7 +567,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
if (commandName && commandName.length && 
L.LOUtil.existsIconForCommand(commandName, builder.map.getDocType())) {
var iconName = 
builder._generateMenuIconName(commandName);
var iconSpan = L.DomUtil.create('span', 
'menu-entry-icon ' + iconName, sectionTitle);
-   var iconURL = L.LOUtil.getImageURL('images/lc_' + 
iconName + '.svg');
+   var iconURL = L.LOUtil.getImageURL('lc_' + iconName + 
'.svg');
icon = L.DomUtil.create('img', '', iconSpan);
icon.src = iconURL;
icon.alt = '';
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-08 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Toolbar.js |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit aadb4422e36f8b45197bce46fabb1bf42be09393
Author: Szymon Kłos 
AuthorDate: Mon Jun 8 08:00:31 2020 +0200
Commit: Szymon Kłos 
CommitDate: Mon Jun 8 08:39:29 2020 +0200

Allow to open word count in readonly mode

Change-Id: I1277dc815c2cee7e133a2c283e1e7bab9bb4a174
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95786
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 11f07f8f6..fdeec58af 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -157,7 +157,8 @@ L.Map.include({
},
 
sendUnoCommand: function (command, json) {
-   if (this._permission === 'edit') {
+   var isAllowedInReadOnly = command == '.uno:WordCountDialog';
+   if (this._permission === 'edit' || isAllowedInReadOnly) {
this._socket.sendMessage('uno ' + command + (json ? ' ' 
+ JSON.stringify(json) : ''));
}
},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-04 Thread Marco Cecchetti (via logerrit)
 loleaflet/src/control/Ruler.js|7 ++-
 loleaflet/src/layer/tile/GridLayer.js |7 +--
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 2d13b81e47f953854e4f4121988caa97ad31ddaa
Author: Marco Cecchetti 
AuthorDate: Sun May 24 19:03:47 2020 +0200
Commit: Michael Meeks 
CommitDate: Thu Jun 4 14:29:41 2020 +0200

loleaflet: writer zoom flickers

Change-Id: I9186bbae55269870fc693b65c3e90b149375eba9
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95496
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins
Tested-by: Michael Meeks 
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js
index 3c64f0280..cca4e46ed 100644
--- a/loleaflet/src/control/Ruler.js
+++ b/loleaflet/src/control/Ruler.js
@@ -403,7 +403,12 @@ L.Control.Ruler = L.Control.extend({
var firstTileXTranslate = parseInt(firstTile.style.left) - 
this._map._docLayer._tileWidthPx * columnNumber;
 
var tileContainer = 
mapPane.getElementsByClassName('leaflet-tile-container');
-   tileContainer = tileContainer[tileContainer.length - 1];
+   for (var i = 0; i < tileContainer.length; ++i) {
+   if (parseInt(tileContainer[i].style.zIndex) === 
this._map.getMaxZoom()) {
+   tileContainer = tileContainer[i];
+   break;
+   }
+   }
var tileContainerXTranslate = 
parseInt(tileContainer.style.transform.match(/\(([-0-9]*)/)[1]);
var mapPaneXTranslate = 
parseInt(mapPane.style.transform.match(/\(([-0-9]*)/)[1]);
 
diff --git a/loleaflet/src/layer/tile/GridLayer.js 
b/loleaflet/src/layer/tile/GridLayer.js
index 850981777..91dd404e8 100644
--- a/loleaflet/src/layer/tile/GridLayer.js
+++ b/loleaflet/src/layer/tile/GridLayer.js
@@ -211,12 +211,7 @@ L.GridLayer = L.Layer.extend({
maxZoom = this.options.maxZoom;
 
for (var z in this._levels) {
-   if (this._levels[z].el.children.length || z === zoom) {
-   this._levels[z].el.style.zIndex = maxZoom - 
Math.abs(zoom - z);
-   } else {
-   L.DomUtil.remove(this._levels[z].el);
-   delete this._levels[z];
-   }
+   this._levels[z].el.style.zIndex = maxZoom - 
Math.abs(zoom - z);
}
 
var level = this._levels[zoom],
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-04 Thread Tomaž Vajngerl (via logerrit)
 loleaflet/src/control/Ruler.js |   97 +
 1 file changed, 51 insertions(+), 46 deletions(-)

New commits:
commit e49b995f53291d49febab879d52153d9e6636bb6
Author: Tomaž Vajngerl 
AuthorDate: Thu Jun 4 12:13:17 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 4 12:18:17 2020 +0200

ruler: delete tabstop on long-press when over a specific tabstop

When a long-press event occurs over a tabstop, it will now delete
it. If no specific tabstop is at the long-press position, then
insert a new tabstop.

Change-Id: I3af2847db3367c1f76d28696f4fa3d0a8017011c

diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js
index b3cb520b9..3c64f0280 100644
--- a/loleaflet/src/control/Ruler.js
+++ b/loleaflet/src/control/Ruler.js
@@ -300,9 +300,7 @@ L.Control.Ruler = L.Control.extend({
// least in the US. (The ruler unit to use doesn't seem to be 
stored in the document
// at least for .odt?)
for (var num = 0; num <= (this.options.pageWidth / 1000) + 1; 
num++) {
-
var marker = L.DomUtil.create('div', 
'loleaflet-ruler-maj', this._rBPContainer);
-
// The - 1 is to compensate for the left and right .5px 
borders of
// loleaflet-ruler-maj in leaflet.css.
marker.style.width = 
this.options.DraggableConvertRatio*1000 - 1 + 'px';
@@ -355,12 +353,9 @@ L.Control.Ruler = L.Control.extend({
}
 
if (!this.options.marginSet) {
-
this.options.marginSet = true;
-
this._lMarginMarker = L.DomUtil.create('div', 
'loleaflet-ruler-margin loleaflet-ruler-left', this._rFace);
this._rMarginMarker =  L.DomUtil.create('div', 
'loleaflet-ruler-margin loleaflet-ruler-right', this._rFace);
-
this._lMarginDrag = L.DomUtil.create('div', 
'loleaflet-ruler-drag loleaflet-ruler-left', this._rMarginWrapper);
this._lToolTip = L.DomUtil.create('div', 
'loleaflet-ruler-ltooltip', this._lMarginDrag);
this._rMarginDrag = L.DomUtil.create('div', 
'loleaflet-ruler-drag loleaflet-ruler-right', this._rMarginWrapper);
@@ -372,7 +367,6 @@ L.Control.Ruler = L.Control.extend({
this.options.interactive = true;
L.DomEvent.on(this._rMarginDrag, 'touchstart', 
this._initiateDrag, this);
L.DomEvent.on(this._lMarginDrag, 'touchstart', 
this._initiateDrag, this);
-
}
}
 
@@ -625,12 +619,36 @@ L.Control.Ruler = L.Control.extend({
}
return tabstop;
},
+
+   _showTabstopContextMenu: function(position, tabstopNumber) {
+   var self = this;
+   this.currentPositionInTwips = position;
+   this.currentTabStopIndex = tabstopNumber;
+   $.contextMenu({
+   selector: '.loleaflet-ruler-tabstopcontainer',
+   className: 'loleaflet-font',
+   items: {
+   inserttabstop: {
+   name: _('Insert tabstop'),
+   callback: 
(this._insertTabstop).bind(this),
+   visible: function() {
+   return 
self.currentPositionInTwips != null;
+   }
+   },
+   removetabstop: {
+   name: _('Delete tabstop'),
+   callback: 
(this._deleteTabstop).bind(this),
+   visible: function() {
+   return self.currentTabStopIndex 
!= null;
+   }
+   }
+   }
+   });
+   },
+
_initiateTabstopDrag: function(event) {
// console.log('===> _initiateTabstopDrag ' + event.type);
 
-   this.currentPositionInTwips = null;
-   this.currentTabStopIndex = null;
-
var tabstopContainer = null;
var pointX = null;
 
@@ -652,32 +670,12 @@ L.Control.Ruler = L.Control.extend({
// right-click inside tabstop container
if (event.button === 2) {
if (tabstop == null) {
-   this.currentPositionInTwips = 
this._map._docLayer._pixelsToTwips({x: pointX, y:0}).x;
+   var position = 
this._map._docLayer._pixelsToTwips({x: pointX, y:0}).x;
+   this._showTabstopContextMenu(position, 

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

2020-06-03 Thread gokaysatir (via logerrit)
 loleaflet/src/control/Ruler.js |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 0b82134d9067abea83959f44728cd3623f14dc7d
Author: gokaysatir 
AuthorDate: Sat May 30 11:50:34 2020 +0300
Commit: Andras Timar 
CommitDate: Wed Jun 3 21:10:02 2020 +0200

tdf#111535 fix mispositioning bug when the page is resized.

Change-Id: I67444baa78f99558906de4e8e6c45a8b6f11bce6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95178
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js
index f5c3dda4d..b3cb520b9 100644
--- a/loleaflet/src/control/Ruler.js
+++ b/loleaflet/src/control/Ruler.js
@@ -418,6 +418,7 @@ L.Control.Ruler = L.Control.extend({
this._rFace.style.marginLeft = rulerOffset + 'px';
 
this.rulerOffset = rulerOffset; // Needed on different parts 
too..
+   this._updateParagraphIndentations();
},
 
_moveIndentation: function(e) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-03 Thread Pranam Lashkari (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |   10 ++
 1 file changed, 10 insertions(+)

New commits:
commit f1b8b3d15b873fc1b89fe5c24a3bd8d9e4c3e12e
Author: Pranam Lashkari 
AuthorDate: Wed Jun 3 16:45:24 2020 +0530
Commit: Andras Timar 
CommitDate: Wed Jun 3 21:04:07 2020 +0200

leaflet: Can't apply text color or highlight color on text shape (impress, 
mobile)

selecting a shape and trying to change the char color or hightlight won't 
work

Change-Id: Ie48cdb6e276df7260c945d519d51244a32e59c28
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95409
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 5498d04dd..265261177 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1729,6 +1729,16 @@ L.Control.JSDialogBuilder = L.Control.extend({
gradientItem.endcolor = color;

builder.map.sendUnoCommand('.uno:FillPageGradient?FillPageGradientJSON:string=' 
+ JSON.stringify(gradientItem));
return;
+   } else if (data.id === 'Color' || data.id === 'CharBackColor') {
+   var params = {};
+   params[data.id] = {
+   type : 'long',
+   value : parseInt('0x' + color)
+   };
+
+   
builder.map['stateChangeHandler'].setItemValue(data.command, 
params[data.id].value);
+   builder.map.sendUnoCommand(data.command, params);
+   return;
}
 
var command = data.command + '?Color:string=' + color;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-02 Thread Tomaž Vajngerl (via logerrit)
 loleaflet/src/control/Ruler.js |   91 -
 1 file changed, 72 insertions(+), 19 deletions(-)

New commits:
commit f240d58f3e0a7895f6ea88110c4e0f80fe6a573a
Author: Tomaž Vajngerl 
AuthorDate: Mon Jun 1 23:15:11 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 2 10:33:13 2020 +0200

Add "delete tabstop" function to Ruler

Change-Id: I34d381f6d3e12b0444b9c7778ef6b8c87794cbd6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95341
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 

diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js
index a5537055e..f5c3dda4d 100644
--- a/loleaflet/src/control/Ruler.js
+++ b/loleaflet/src/control/Ruler.js
@@ -606,9 +606,30 @@ L.Control.Ruler = L.Control.extend({
this._map._socket.sendMessage('uno .uno:RulerChangeState ' + 
JSON.stringify(unoObj));
},
 
+   _getTabStopHit: function(tabstopContainer, pointX) {
+   var tabstop = null;
+   var margin = 10;
+   var tabstopDiffFromCenter = 1; // just a big initial 
condition
+
+   for (var i = 0; i < tabstopContainer.tabStops.length; i++) {
+   var current = tabstopContainer.tabStops[i];
+   var location = current.tabStopLocation;
+   if (pointX >= location.left - margin && pointX <= 
location.right + margin) {
+   var diff = Math.abs(pointX - location.center);
+   if (diff < tabstopDiffFromCenter) {
+   tabstop = current;
+   tabstopDiffFromCenter = diff;
+   }
+   }
+   }
+   return tabstop;
+   },
_initiateTabstopDrag: function(event) {
// console.log('===> _initiateTabstopDrag ' + event.type);
 
+   this.currentPositionInTwips = null;
+   this.currentTabStopIndex = null;
+
var tabstopContainer = null;
var pointX = null;
 
@@ -622,18 +643,37 @@ L.Control.Ruler = L.Control.extend({
}
tabstopContainer.tabStopMarkerBeingDragged = null;
 
+   // check if we hit any tabstop
+   var tabstop = this._getTabStopHit(tabstopContainer, pointX);
+
// Check what to do when a mouse buttons is clicked, ignore 
touch
if (event.type !== 'panstart') {
// right-click inside tabstop container
if (event.button === 2) {
-   this.currentPositionInTwips = 
this._map._docLayer._pixelsToTwips({x: pointX, y:0}).x;
+   if (tabstop == null) {
+   this.currentPositionInTwips = 
this._map._docLayer._pixelsToTwips({x: pointX, y:0}).x;
+   }
+   else {
+   this.currentTabStopIndex = 
tabstop.tabStopNumber;
+   }
+   var self = this;
$.contextMenu({
selector: 
'.loleaflet-ruler-tabstopcontainer',
className: 'loleaflet-font',
items: {
inserttabstop: {
name: _('Insert 
tabstop'),
-   callback: 
(this._insertTabstop).bind(this)
+   callback: 
(this._insertTabstop).bind(this),
+   visible: function() {
+   return 
self.currentPositionInTwips != null;
+   }
+   },
+   removetabstop: {
+   name: _('Delete 
tabstop'),
+   callback: 
(this._deleteTabstop).bind(this),
+   visible: function() {
+   return 
self.currentTabStopIndex != null;
+   }
}
}
});
@@ -646,23 +686,6 @@ L.Control.Ruler = L.Control.extend({
}
}
 
-   // check if we hit any tabstop
-   var tabstop = null;
-   var margin = 10;
-   var 

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

2020-06-01 Thread mert (via logerrit)
 loleaflet/src/control/Toolbar.js |   20 
 1 file changed, 16 insertions(+), 4 deletions(-)

New commits:
commit 642c7598a7e5c937c08d03323c299b83e84e1b5e
Author: mert 
AuthorDate: Fri May 29 17:00:25 2020 +0300
Commit: Andras Timar 
CommitDate: Mon Jun 1 21:38:07 2020 +0200

Fix proxy related welcome msg and help dialog problems

Fixed cookie problem with proxy too for welcome message

Change-Id: I8e3e6ccb7673bddd5c26e3d2aadd2da4ed03a2e4
Signed-off-by: mert 
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95152
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 0409c9d1c..11f07f8f6 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -215,7 +215,11 @@ L.Map.include({
w = iw / 5 + 590;
}
var map = this;
-   $.get('loleaflet-help.html', function(data) {
+   var helpLocation = 'loleaflet-help.html';
+   if (window.socketProxy)
+   helpLocation = window.host + window.serviceRoot + 
'/loleaflet/dist/' + helpLocation;
+
+   $.get(helpLocation, function(data) {
var productName;
if (window.ThisIsAMobileApp) {
productName = window.MobileAppName;
@@ -403,7 +407,10 @@ L.Map.include({
if (!calledFromMenu) {
var WSDVerCookie = 'WSDWelcomeVersion=' 
+ map._socket.WSDServer.Version;
// Cookie will not expire for a year, 
and it will not be sent to other domains
-   WSDVerCookie += '; max-age=31536000; 
SameSite=Strict; path=/loleaflet';
+   var cookiePath = '/loleaflet';
+   if (window.socketProxy)
+   cookiePath = window.host + 
window.serviceRoot + cookiePath;
+   WSDVerCookie += '; max-age=31536000; 
SameSite=Strict; path=' + cookiePath;
document.cookie = WSDVerCookie;
}
map.focus();
@@ -414,7 +421,9 @@ L.Map.include({
 
showWelcomeDialog: function(calledFromMenu) {
console.log('showWelcomeDialog, calledFromMenu: ' + 
calledFromMenu);
-   var welcomeLocation = window.location.origin + 
window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/')) + 
'/welcome/welcome-' + String.locale + '.html';
+   var welcomeLocation = 'welcome/welcome-' + String.locale + 
'.html';
+   if (window.socketProxy)
+   welcomeLocation = window.host + window.serviceRoot + 
'/loleaflet/dist/' + welcomeLocation;
 
var map = this;
 
@@ -432,7 +441,10 @@ L.Map.include({
.fail(function() {
// Welcome dialog disabled in loolwsd.xml or 
nonexistant for some other reason
// Let's check back in a day (60 x 60 x 24 = 
86400 seconds)
-   var welcomeDisabledCookie = 
'WSDWelcomeDisabled=true; max-age=86400; SameSite=Strict; path=/loleaflet';
+   var cookiePath = '/loleaflet';
+   if (window.socketProxy)
+   cookiePath = window.host + 
window.serviceRoot + cookiePath;
+   var welcomeDisabledCookie = 
'WSDWelcomeDisabled=true; max-age=86400; SameSite=Strict; path=' + cookiePath;
document.cookie = welcomeDisabledCookie;
 
if (calledFromMenu)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-31 Thread Marco Cecchetti (via logerrit)
 loleaflet/src/control/Control.LokDialog.js |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 5a4c741e85f79f012843bd3d3e04ee3aafd5f53b
Author: Marco Cecchetti 
AuthorDate: Thu May 7 13:14:05 2020 +0200
Commit: Marco Cecchetti 
CommitDate: Sun May 31 18:32:38 2020 +0200

leaflet: formula bar: missing text selection handles

mobile: double tap a word
double tap the next word
the new word is selected but there is no selection handles

Change-Id: I283dc1b177910605826102daaa28714c65190f4f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95225
Tested-by: Jenkins
Reviewed-by: Marco Cecchetti 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index a96ae309f..dfddbdfc2 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -503,6 +503,9 @@ L.Control.LokDialog = L.Control.extend({
handles.end = null;
}
 
+   if (!handles.start && !handles.end)
+   handles.draggingStopped = true;
+
if (!rectangles || rectangles.length < 1) {
return;
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-28 Thread mert (via logerrit)
 loleaflet/src/control/Toolbar.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit dd6ce865faf57cf02244710b27c5f18dc27427b4
Author: mert 
AuthorDate: Thu May 28 14:54:14 2020 +0300
Commit: Andras Timar 
CommitDate: Thu May 28 14:29:36 2020 +0200

Fix welcomedialog does not show-up

Change-Id: I38c2af5489b5557ef0cd8b944ba3b9cde316d693
Signed-off-by: mert 
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95029
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 6798c620a..0409c9d1c 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -414,7 +414,7 @@ L.Map.include({
 
showWelcomeDialog: function(calledFromMenu) {
console.log('showWelcomeDialog, calledFromMenu: ' + 
calledFromMenu);
-   var welcomeLocation = window.host + window.serviceRoot + 
'/welcome/welcome-' + String.locale + '.html';
+   var welcomeLocation = window.location.origin + 
window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/')) + 
'/welcome/welcome-' + String.locale + '.html';
 
var map = this;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-25 Thread Pedro Pinto Silva (via logerrit)
 loleaflet/src/control/Control.MobileWizard.js |1 +
 1 file changed, 1 insertion(+)

New commits:
commit bd9e91df023564df4350716c41906029bd1226a1
Author: Pedro Pinto Silva 
AuthorDate: Mon May 25 14:36:48 2020 +0200
Commit: Pedro Pinto da Silva 
CommitDate: Mon May 25 15:04:54 2020 +0200

Mobile: Calc: Make sure funcwizard class is removed as part of reset 
function

- which was leading to elements from funcwizard being shown in the 
hamburger menu

Change-Id: I7030b81d93ed28c5f42445a7770354177fb9398a
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94789
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins
Tested-by: Pedro Pinto da Silva 
Reviewed-by: Pedro Pinto da Silva 

diff --git a/loleaflet/src/control/Control.MobileWizard.js 
b/loleaflet/src/control/Control.MobileWizard.js
index 1199c4566..406ba8716 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -49,6 +49,7 @@ L.Control.MobileWizard = L.Control.extend({
$('#mobile-wizard-titlebar').show();
$('#mobile-wizard-titlebar').css('top', '0px');
$('#mobile-wizard').removeClass('menuwizard');
+   $('#mobile-wizard').removeClass('funcwizard');
this._isTabMode = false;
this._currentPath = [];
this._tabs = [];
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-25 Thread Tamás Zolnai (via logerrit)
 loleaflet/src/control/Control.MobileWizard.js |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit 88e2de28d23cf6f7929eaa5413bfb6e321dca747
Author: Tamás Zolnai 
AuthorDate: Mon May 25 11:22:15 2020 +0200
Commit: Tamás Zolnai 
CommitDate: Mon May 25 11:42:51 2020 +0200

cypress: this is not needed anymore.

The problem was with the retriabiltiy of
cy.get().contains() chain.

Change-Id: I086b6667eb68c86254ca38a9033a75cd5e340a93
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94777
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tamás Zolnai 

diff --git a/loleaflet/src/control/Control.MobileWizard.js 
b/loleaflet/src/control/Control.MobileWizard.js
index b9623eab5..1199c4566 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -164,9 +164,6 @@ L.Control.MobileWizard = L.Control.extend({
 
goLevelDown: function(contentToShow, options) {
var animate = (options && options.animate != undefined) ? 
options.animate : true;
-   // Animation fools cypress tests.
-   if (L.Browser.cypressTest)
-   animate = false;
 
if (!this._isTabMode || this._currentDepth > 0)
this.backButton.removeClass('close-button');
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-25 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |   11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 41071ee46c17ba79c56629b1a8e15bcdc1787ba4
Author: Szymon Kłos 
AuthorDate: Fri May 22 20:25:54 2020 +0200
Commit: Szymon Kłos 
CommitDate: Mon May 25 09:36:33 2020 +0200

mobilewizard: properly set line width

Change-Id: I0d1d61eb31905f241ca40801c38d5eed844d47a4
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94706
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 6124fc584..5498d04dd 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1938,8 +1938,15 @@ L.Control.JSDialogBuilder = L.Control.extend({
return newValue;
});
}
-   var command = '.uno:LineWidth?Width:double=' + 
newValue.toFixed(1);
-   builder.map.sendUnoCommand(command);
+
+   var command = '.uno:LineWidth';
+   var params = {
+   LineWidth: {
+   type : 'long',
+   value : (newValue * 100).toFixed(0)
+   }
+   };
+   builder.map.sendUnoCommand(command, params);
};
 
builder._spinfieldControl(parentContainer, lineData, builder, 
callbackFunction);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-22 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.Menubar.js |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 323eb7f5b4fa5227b92ce9321e504fca881411aa
Author: Szymon Kłos 
AuthorDate: Wed May 6 10:13:40 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 22 14:45:01 2020 +0200

Add word count dialog in menu

Change-Id: I1417ac3b261bbd9ce7411c5f4bb37e3093ee88bf
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94626
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 9fd947eec..c8d12a868 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -507,6 +507,7 @@ L.Control.Menubar = L.Control.extend({
{uno: '.uno:SelectAll'}
]},
{name: _('Search'), id: 'searchdialog', type: 'action'},
+   {uno: '.uno:WordCountDialog'},
{name: _UNO('.uno:ChangesMenu', 'text'), id: 
'changesmenu', type: 'menu', menu: [
{uno: '.uno:TrackChanges'},
{uno: '.uno:ShowTrackedChanges'},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-22 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.Menubar.js |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 97a0a765abe5a1a8cc92eeb5f54bee1982f448ab
Author: Szymon Kłos 
AuthorDate: Fri May 22 10:07:10 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 22 10:21:26 2020 +0200

Move insert table entry in menubar

Change-Id: I80b8164685cf45a01e26c7a2b58b800262fe080b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94659
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 62b54ef35..9fd947eec 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -77,7 +77,6 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:InsertGraphic', 'text'), id: 
'insertgraphicremote', type: 'action'},
{name: _UNO('.uno:InsertAnnotation', 'text'), 
id: 'insertcomment', type: 'action'},
{uno: '.uno:InsertObjectChart'},
-   {uno: '.uno:InsertTable'},
{type: 'separator'},
{uno: '.uno:InsertSection', id: 
'insertsection'},
{name: _UNO('.uno:InsertField', 'text'), type: 
'menu', menu: [
@@ -202,6 +201,7 @@ L.Control.Menubar = L.Control.extend({
{uno: '.uno:ResetAttributes'}
]},
{name: _UNO('.uno:TableMenu', 'text'), type: 'menu', 
menu: [
+   {uno: '.uno:InsertTable'},
{name: _UNO('.uno:TableInsertMenu', 'text'), 
type: 'menu', menu: [
{uno: '.uno:InsertRowsBefore'},
{uno: '.uno:InsertRowsAfter'},
@@ -297,7 +297,6 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:SelectBackground', 
'presentation'), id: 'selectbackground', type: 'action'},
{name: _UNO('.uno:InsertAnnotation', 
'presentation'), id: 'insertcomment', type: 'action'},
{uno: '.uno:InsertObjectChart'},
-   {uno: '.uno:InsertTable'},
{type: 'separator'},
{name: _UNO('.uno:HyperlinkDialog'), id: 
'inserthyperlink', type: 'action'},
{type: 'separator'},
@@ -328,6 +327,7 @@ L.Control.Menubar = L.Control.extend({
{uno: '.uno:OutlineBullet'}]
},
{name: _UNO('.uno:TableMenu', 'text'/*HACK should be 
'presentation', but not in xcu*/), type: 'menu', menu: [
+   {name: _UNO('.uno:InsertTable', 'text'), uno: 
'.uno:InsertTable'},
{name: _UNO('.uno:TableInsertMenu', 
'text'/*HACK should be 'presentation', but not in xcu*/), type: 'menu', menu: [
{uno: '.uno:InsertRowsBefore'},
{uno: '.uno:InsertRowsAfter'},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-21 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 6a295dd1adcb8fb9524d31b0a8b4414ffcaeb872
Author: Szymon Kłos 
AuthorDate: Wed May 6 10:49:47 2020 +0200
Commit: Szymon Kłos 
CommitDate: Thu May 21 15:58:17 2020 +0200

jsdialog: use edit instead of combobox in find & replace

Change-Id: I1d365ef8ac3860ffa581f830c1b989842532723a
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94627
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 492bbe3dd..6124fc584 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1393,8 +1393,17 @@ L.Control.JSDialogBuilder = L.Control.extend({
if (data.id === 'applystyle' ||
data.id === 'fontnamecombobox' ||
data.id === 'fontsizecombobox' ||
-   data.id === 'FontBox')
+   data.id === 'FontBox') {
builder._listboxControl(parentContainer, data, builder);
+   } else if (data.id === 'searchterm' ||
+   data.id === 'replaceterm') {
+   // Replace combobox with edit in mobile find & replace 
dialog
+   var callback = function(value) {
+   builder.callback('combobox', 'change', data, 
value, builder);
+   };
+
+   builder._editControl(parentContainer, data, builder, 
callback);
+   }
else
builder._explorableEditControl(parentContainer, data, 
builder);
},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-21 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.Menubar.js |2 ++
 loleaflet/src/unocommands.js |1 +
 2 files changed, 3 insertions(+)

New commits:
commit cdeaebee8853829e5103d948aaebfe5466d4280e
Author: Szymon Kłos 
AuthorDate: Wed May 20 14:23:58 2020 +0200
Commit: Szymon Kłos 
CommitDate: Thu May 21 12:19:50 2020 +0200

Add Insert Table in menubar

Change-Id: I13da175b4f15affc3341cbbaf94e39a689820c86
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94570
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index d2ef6b36d..62b54ef35 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -77,6 +77,7 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:InsertGraphic', 'text'), id: 
'insertgraphicremote', type: 'action'},
{name: _UNO('.uno:InsertAnnotation', 'text'), 
id: 'insertcomment', type: 'action'},
{uno: '.uno:InsertObjectChart'},
+   {uno: '.uno:InsertTable'},
{type: 'separator'},
{uno: '.uno:InsertSection', id: 
'insertsection'},
{name: _UNO('.uno:InsertField', 'text'), type: 
'menu', menu: [
@@ -296,6 +297,7 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:SelectBackground', 
'presentation'), id: 'selectbackground', type: 'action'},
{name: _UNO('.uno:InsertAnnotation', 
'presentation'), id: 'insertcomment', type: 'action'},
{uno: '.uno:InsertObjectChart'},
+   {uno: '.uno:InsertTable'},
{type: 'separator'},
{name: _UNO('.uno:HyperlinkDialog'), id: 
'inserthyperlink', type: 'action'},
{type: 'separator'},
diff --git a/loleaflet/src/unocommands.js b/loleaflet/src/unocommands.js
index 608dfd997..449880c74 100644
--- a/loleaflet/src/unocommands.js
+++ b/loleaflet/src/unocommands.js
@@ -184,6 +184,7 @@ var unoCommandsArray = {
InsertSlidesField:{presentation:{menu:_('Slide ~Count'),},},
InsertSoftHyphen:{global:{menu:_('S~oft hyphen'),},},
InsertSymbol:{global:{context:_('Insert Special 
Character'),menu:_('S~pecial Character...'),},},
+   InsertTable:{presentation:{menu:_('~Table...'),},text:{menu:_('Insert 
~Table...'),},},
InsertTimeField:{global:{menu:_('Time 
Field'),},text:{menu:_('~Time'),},},
InsertTimeFieldFix:{presentation:{menu:_('~Time (fixed)'),},},
InsertTimeFieldVar:{presentation:{menu:_('T~ime (variable)'),},},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-20 Thread Andras Timar (via logerrit)
 loleaflet/src/control/Toolbar.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9ca444ed9ffcd32b9d39a5b3c86c284a84264ff6
Author: Andras Timar 
AuthorDate: Wed May 20 20:50:59 2020 +0200
Commit: Andras Timar 
CommitDate: Wed May 20 20:51:28 2020 +0200

add missing '/' to welcome dialog URL

Change-Id: I5a715daf31fdb7036859e04423a337d0d1dd6616

diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index e01cef418..6798c620a 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -414,7 +414,7 @@ L.Map.include({
 
showWelcomeDialog: function(calledFromMenu) {
console.log('showWelcomeDialog, calledFromMenu: ' + 
calledFromMenu);
-   var welcomeLocation = window.host + window.serviceRoot + 
'welcome/welcome-' + String.locale + '.html';
+   var welcomeLocation = window.host + window.serviceRoot + 
'/welcome/welcome-' + String.locale + '.html';
 
var map = this;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-19 Thread Aron Budea (via logerrit)
 loleaflet/src/control/Control.Toolbar.js |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 11d9c28478e1a6f274536567db3090a66ac85b3c
Author: Aron Budea 
AuthorDate: Tue May 19 18:35:41 2020 +0200
Commit: Aron Budea 
CommitDate: Tue May 19 19:36:22 2020 +0200

tdf#133078: Make selection from Borders dropdown work again

If color was undefined, parseInt() of 0 (already int) failed.

Regression from 877e4fd5873f5344f6367fbbbfbc60c3f9dde465

Change-Id: Ie7c1e4666a5560c39fd395419185933be395d54c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94543
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/loleaflet/src/control/Control.Toolbar.js 
b/loleaflet/src/control/Control.Toolbar.js
index 6e0b5950f..500ca36b5 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -188,8 +188,7 @@ function closePopup() {
 function setBorderStyle(num, color) {
if (color === undefined)
color = 0; // black
-
-   if (color.startsWith('#'))
+   else if (color.startsWith('#'))
color = parseInt('0x' + color.substring(1, color.length));
 
switch (num) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-19 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.MobileWizard.js |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 3e3a5e01b1005bc0ea653147f75898bdfe1b36bf
Author: Szymon Kłos 
AuthorDate: Wed Mar 11 13:17:07 2020 +0100
Commit: Szymon Kłos 
CommitDate: Tue May 19 13:34:44 2020 +0200

jsdialog: fix inifinite regenetate JSON loop

Change-Id: I52667e115a0cf70f09f570dc6ea1ec0bcac49460
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93463
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.MobileWizard.js 
b/loleaflet/src/control/Control.MobileWizard.js
index 958eeb985..b9623eab5 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -273,7 +273,8 @@ L.Control.MobileWizard = L.Control.extend({
},
 
_goToPath: function(path) {
-   if (this._tabs && path && path.length)
+   // when dialog has tabs, tab selection triggers the callback, 
causes infinite regenetate loop
+   if (this._tabs && path && path.length && 
!this.map.dialog.hasDialogInMobilePanelOpened())
this._selectTab(path[0]);
 
var _path = [];
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-19 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 2b5dac78f65508dbf849231c7bd7ac34b0e8b9f8
Author: Szymon Kłos 
AuthorDate: Thu Mar 5 14:40:54 2020 +0100
Commit: Szymon Kłos 
CommitDate: Tue May 19 13:33:58 2020 +0200

jsdialog: send control type with event

Change-Id: I6cd6f1d26b5c78715f9e0adc992a1869e0f19a97
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93029
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index ab0996c22..492bbe3dd 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -230,8 +230,11 @@ L.Control.JSDialogBuilder = L.Control.extend({
data = typeof data === 'string' ? data.replace('"', 
'\\"') : data;
var windowId = window.mobileDialogId !== undefined ? 
window.mobileDialogId :

(window.sidebarId !== undefined ? window.sidebarId : -1);
-   var message = 'dialogevent ' + windowId +
-   ' {\"id\":\"' + object.id + '\", \"cmd\": \"' + 
eventType + '\", \"data\":\"' + data + '\"}';
+   var message = 'dialogevent ' + windowId
+   + ' {\"id\":\"' + object.id
+   + '\", \"cmd\": \"' + eventType
+   + '\", \"data\": \"' + data
+   + '\", \"type\": \"' + objectType + '\"}';
builder.map._socket.sendMessage(message);
}
},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-19 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |4 +++-
 loleaflet/src/control/Control.LokDialog.js   |   21 +++--
 loleaflet/src/control/Control.MobileWizard.js|   11 +++
 3 files changed, 33 insertions(+), 3 deletions(-)

New commits:
commit e55892b997337c0a122b0fe4809983742c753036
Author: Szymon Kłos 
AuthorDate: Fri Feb 21 09:54:33 2020 +0100
Commit: Szymon Kłos 
CommitDate: Tue May 19 12:56:27 2020 +0200

jsdialog: handle events for dialogs in mobilewizard

- remember window id
- close mobile wizard on dialog close
- close dialog on mobile wizard close
- don't show dialogs on mobile devices

Change-Id: I585c5b92192655684eedd62d88817a92fc1fc0a8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93005
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 4ecbc0ad9..ab0996c22 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -228,7 +228,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
builder.map.sendUnoCommand(encodedCommand);
} else if (object) {
data = typeof data === 'string' ? data.replace('"', 
'\\"') : data;
-   var message = 'dialogevent ' + (window.sidebarId !== 
undefined ? window.sidebarId : -1) +
+   var windowId = window.mobileDialogId !== undefined ? 
window.mobileDialogId :
+   
(window.sidebarId !== undefined ? window.sidebarId : -1);
+   var message = 'dialogevent ' + windowId +
' {\"id\":\"' + object.id + '\", \"cmd\": \"' + 
eventType + '\", \"data\":\"' + data + '\"}';
builder.map._socket.sendMessage(message);
}
diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 43a8ee7f4..a96ae309f 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -59,6 +59,10 @@ L.Control.LokDialog = L.Control.extend({
 
dialogIdPrefix: 'lokdialog-',
 
+   hasDialogInMobilePanelOpened: function() {
+   return window.mobileDialogId !== undefined;
+   },
+
onPan: function (ev) {
if (!draggedObject)
return;
@@ -289,7 +293,7 @@ L.Control.LokDialog = L.Control.extend({
}
 
if (e.action === 'created') {
-   if (e.winType === 'dialog') {
+   if (e.winType === 'dialog' && !window.mode.isMobile()) {
// When left/top are invalid, the dialog shows 
in the center.
this._launchDialog(e.id, left, top, width, 
height, e.title);
} else if (e.winType === 'calc-input-win') {
@@ -335,7 +339,17 @@ L.Control.LokDialog = L.Control.extend({
}
 
// All other callbacks doen't make sense without an active 
dialog.
-   if (!(this._isOpen(e.id) || this._getParentId(e.id)))
+   if (!(this._isOpen(e.id) || this._getParentId(e.id))) {
+   if (e.action == 'close' && window.mobileDialogId == 
e.id) {
+   window.mobileDialogId = undefined;
+   this._map.fire('closemobilewizard');
+   }
+
+   return;
+   }
+
+   // We don't want dialogs and sidebar on smartphones, only calc 
input window is allowed
+   if (window.mode.isMobile() && e.winType !== 'calc-input-win' && 
!this.isCalcInputBar(e.id))
return;
 
if (e.action === 'invalidate') {
@@ -1401,6 +1415,9 @@ L.Control.LokDialog = L.Control.extend({
this._onDialogClose(dialogId, true);
}
}
+   if (this.hasDialogInMobilePanelOpened()) {
+   this._onDialogClose(window.mobileDialogId, true);
+   }
},
 
onCloseCurrentPopUp: function() {
diff --git a/loleaflet/src/control/Control.MobileWizard.js 
b/loleaflet/src/control/Control.MobileWizard.js
index 926f9f707..958eeb985 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -93,6 +93,12 @@ L.Control.MobileWizard = L.Control.extend({
},
 
_hideWizard: function() {
+   // dialog
+   if (this.map.dialog.hasDialogInMobilePanelOpened()) {
+   this.map.dialog._onDialogClose(window.mobileDialogId, 
true);
+   window.mobileDialogId = undefined;
+   }
+
  

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

2020-05-18 Thread Tamás Zolnai (via logerrit)
 loleaflet/src/layer/FormFieldButtonLayer.js |   13 +
 1 file changed, 13 insertions(+)

New commits:
commit 13f1f0182edd159034489caed910b5e1608d07f3
Author: Tamás Zolnai 
AuthorDate: Mon May 18 11:27:54 2020 +0200
Commit: Tamás Zolnai 
CommitDate: Mon May 18 12:41:48 2020 +0200

MSForms: rerender form field button on zoom.

Hide the button on zoom start and display it again with
the new size on zoom end.

Change-Id: If507009923e85225c8594252bd76033c8b84783b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94407
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tamás Zolnai 

diff --git a/loleaflet/src/layer/FormFieldButtonLayer.js 
b/loleaflet/src/layer/FormFieldButtonLayer.js
index fcd826c28..a8c268872 100644
--- a/loleaflet/src/layer/FormFieldButtonLayer.js
+++ b/loleaflet/src/layer/FormFieldButtonLayer.js
@@ -41,6 +41,9 @@ L.FormFieldButton = L.Layer.extend({
 
// Build list of items opened by clicking on the drop down 
button
this._buildDropDownList(framePos, frameWidth, frameHeight);
+
+   map.on('zoomstart', this._onZoomStart, this);
+   map.on('zoomend', this._onZoomEnd, this);
},
 
_calculateButtonArea: function(map) {
@@ -161,6 +164,16 @@ L.FormFieldButton = L.Layer.extend({
this.map._socket.sendMessage(message);
},
 
+   _onZoomStart: function() {
+   $('.drop-down-field-list').hide();
+   this._clearButton();
+   },
+
+   _onZoomEnd: function() {
+   // rebuild button on zoom
+   this.onAdd(this.map);
+   },
+
_clearButton: function() {
this.getPane('formfieldPane').innerHTML = '';
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-15 Thread Aron Budea (via logerrit)
 loleaflet/src/control/Control.MobileTopBar.js |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit df205d63609aeaa381549166a26a6d64dcefc5e0
Author: Aron Budea 
AuthorDate: Fri May 15 23:07:43 2020 +0200
Commit: Aron Budea 
CommitDate: Sat May 16 00:30:55 2020 +0200

loleaflet: Empty user list flashes up at start on mobile

Regression from 610e2dbd583da4537e8cdef7f10318dc43e8c269

Change-Id: I35809de56d9533381f0c0d2bdfcd5587e065ce9f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94336
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/loleaflet/src/control/Control.MobileTopBar.js 
b/loleaflet/src/control/Control.MobileTopBar.js
index ba727279f..acfa82c7d 100644
--- a/loleaflet/src/control/Control.MobileTopBar.js
+++ b/loleaflet/src/control/Control.MobileTopBar.js
@@ -33,7 +33,7 @@ L.Control.MobileTopBar = L.Control.extend({
{type: 'button',  id: 
'insertion_mobile_wizard', img: 'insertion_mobile_wizard', disabled: true},
{type: 'button',  id: 'insertcomment', img: 
'insertcomment', disabled: true},
{type: 'button',  id: 'fullscreen', img: 
'fullscreen', hint: _UNO('.uno:FullScreen', 'text')},
-   {type: 'drop', id: 'userlist', img: 'users', 
html: L.control.createUserListWidget()},
+   {type: 'drop', id: 'userlist', img: 'users', 
hidden: true, html: L.control.createUserListWidget()},
];
} else if (docType == 'spreadsheet') {
return [
@@ -47,7 +47,7 @@ L.Control.MobileTopBar = L.Control.extend({
{type: 'button',  id: 
'insertion_mobile_wizard', img: 'insertion_mobile_wizard', disabled: true},
 // {type: 'button',  id: 'insertcomment', img: 
'insertcomment', disabled: true},
{type: 'button',  id: 'fullscreen', img: 
'fullscreen', hint: _UNO('.uno:FullScreen', 'text')},
-   {type: 'drop', id: 'userlist', img: 'users', 
html: L.control.createUserListWidget()},
+   {type: 'drop', id: 'userlist', img: 'users', 
hidden: true, html: L.control.createUserListWidget()},
];
} else if (docType == 'presentation') {
return [
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-14 Thread Michael Meeks (via logerrit)
 loleaflet/src/control/Toolbar.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3bb8754ef1b8208f7594aaa35364980662ee3dce
Author: Michael Meeks 
AuthorDate: Thu May 14 14:33:46 2020 +0100
Commit: Michael Meeks 
CommitDate: Thu May 14 18:12:22 2020 +0200

Welcome: include the host + service-root.

Also fixes proxy usage.

Change-Id: I118101077b6294c3720af47f0188326ace9bbc09
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94212
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index a1bc47d8d..8736ed0af 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -414,7 +414,7 @@ L.Map.include({
 
showWelcomeDialog: function(calledFromMenu) {
console.log('showWelcomeDialog, calledFromMenu: ' + 
calledFromMenu);
-   var welcomeLocation = 'welcome/welcome-' + String.locale + 
'.html';
+   var welcomeLocation = window.host + window.serviceRoot + 
'welcome/welcome-' + String.locale + '.html';
 
var map = this;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-14 Thread Michael Meeks (via logerrit)
 loleaflet/src/map/handler/Map.FileInserter.js |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 6063cfc2266c512067abf2c9aec2e89dc35f70d1
Author: Michael Meeks 
AuthorDate: Thu May 14 14:50:29 2020 +0100
Commit: Michael Meeks 
CommitDate: Thu May 14 16:51:11 2020 +0200

Mend error substitution, jsstring.replace() doesn't replace in-place.

Change-Id: I9286779c6f25499aeb390f1c8346fc15574b8c8c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94217
Tested-by: Michael Meeks 
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/src/map/handler/Map.FileInserter.js 
b/loleaflet/src/map/handler/Map.FileInserter.js
index 94e28e2aa..be1f4e922 100644
--- a/loleaflet/src/map/handler/Map.FileInserter.js
+++ b/loleaflet/src/map/handler/Map.FileInserter.js
@@ -96,7 +96,7 @@ L.Map.FileInserter = L.Handler.extend({
var errMsg =  _('The file of type: %0 cannot be 
uploaded to server since the file has no name');
if (file.size === 0)
errMsg = _('The file of type: %0 cannot be 
uploaded to server since the file is empty');
-   errMsg.replace('%0', file.type);
+   errMsg = errMsg.replace('%0', file.type);
map.fire('error', {msg: errMsg});
return;
}
@@ -141,7 +141,7 @@ L.Map.FileInserter = L.Handler.extend({
}
else {
var msg = _('Uploading file to 
server failed with status: %0');
-   msg.replace('%0', 
xmlHttp.status);
+   msg = msg.replace('%0', 
xmlHttp.status);
map.fire('error', {msg: msg});
}
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-14 Thread Michael Meeks (via logerrit)
 loleaflet/src/map/Map.js |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit f65c8ef71fdabd41add558c706154334cfd3ed00
Author: Michael Meeks 
AuthorDate: Thu May 14 12:50:17 2020 +0100
Commit: Michael Meeks 
CommitDate: Thu May 14 16:49:48 2020 +0200

Avoid exception during racy startup.

TypeError: Cannot read property '_updateCursorAndOverlay' of undefined

Change-Id: Id6d5ed3df44bb04f9ed456974ee800ed564f1b4a
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94195
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 3eb011500..670e625c7 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -1387,7 +1387,8 @@ L.Map = L.Evented.extend({
if (this.editorHasFocus()) {
// The document has the focus.
var doclayer = this._docLayer;
-   doclayer._updateCursorAndOverlay();
+   if (doclayer)
+   doclayer._updateCursorAndOverlay();
} else if (acceptInput !== undefined) {
// A dialog has the focus.
this.focus(acceptInput);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-14 Thread Michael Meeks (via logerrit)
 loleaflet/src/control/Toolbar.js |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 3ed7cceeb73248d2f610b24c3c454793b33e96b5
Author: Michael Meeks 
AuthorDate: Thu May 14 13:09:32 2020 +0100
Commit: Michael Meeks 
CommitDate: Thu May 14 15:31:14 2020 +0200

Show the welcome message at maximum once, unless requested.

Change-Id: I2a8a7b53876e402102d5fce2b56da78edd709ad9
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94196
Tested-by: Michael Meeks 
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index c30abc500..a1bc47d8d 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -416,8 +416,15 @@ L.Map.include({
console.log('showWelcomeDialog, calledFromMenu: ' + 
calledFromMenu);
var welcomeLocation = 'welcome/welcome-' + String.locale + 
'.html';
 
-   // try to load the welcome message
var map = this;
+
+   // if the user doesn't accept cookies, or we get several 
triggers,
+   // ensure we only ever do this once.
+   if (!calledFromMenu && map._alreadyShownWelcomeDialog)
+   return;
+   map._alreadyShownWelcomeDialog = true;
+
+   // try to load the welcome message
$.get(welcomeLocation)
.done(function(data) {
map._showWelcomeDialogVex(data, calledFromMenu);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-13 Thread Henry Castro (via logerrit)
 loleaflet/src/main.js|1 +
 loleaflet/src/map/Map.js |4 
 2 files changed, 5 insertions(+)

New commits:
commit d77cecee810542e743abd2efacb8df287c0729c5
Author: Henry Castro 
AuthorDate: Tue May 12 15:24:04 2020 -0400
Commit: Henry Castro 
CommitDate: Wed May 13 16:08:01 2020 +0200

loleaflet: assign a static singleton map object

So cypress can access the object and listen some events
when unit test fails

Change-Id: I8b05383a2655865b540306f83ebb5c5d42f1929c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94079
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 

diff --git a/loleaflet/src/main.js b/loleaflet/src/main.js
index 6b9390058..86826522b 100644
--- a/loleaflet/src/main.js
+++ b/loleaflet/src/main.js
@@ -87,5 +87,6 @@ window.addEventListener('beforeunload', function () {
 
 window.docPermission = permission;
 window.bundlejsLoaded = true;
+L.Map.THIS = map;
 
 }(window));
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 18b168a1e..3eb011500 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -14,6 +14,10 @@ function isAnyVexDialogActive() {
 /* global vex $ _ */
 L.Map = L.Evented.extend({
 
+   statics: {
+   THIS : undefined
+   },
+
options: {
crs: L.CRS.Simple,
center: [0, 0],
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-11 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.NotebookbarCalc.js| 1895 ---
 loleaflet/src/control/Control.NotebookbarImpress.js | 2149 
 loleaflet/src/control/Control.NotebookbarWriter.js  | 3378 
 3 files changed, 13 insertions(+), 7409 deletions(-)

New commits:
commit 06864e7011b8a8fe350ab3d56d844e2d19f23918
Author: Szymon Kłos 
AuthorDate: Mon May 11 14:25:52 2020 +0200
Commit: Szymon Kłos 
CommitDate: Mon May 11 15:11:33 2020 +0200

notebookbar: remove testing JSON

Change-Id: I59128eaa0e2faa9db5e15b01d0ad44bdf835c0db
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93963
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.NotebookbarCalc.js 
b/loleaflet/src/control/Control.NotebookbarCalc.js
index 9dc98d183..779d27f31 100644
--- a/loleaflet/src/control/Control.NotebookbarCalc.js
+++ b/loleaflet/src/control/Control.NotebookbarCalc.js
@@ -44,1904 +44,15 @@ L.Control.NotebookbarCalc = 
L.Control.NotebookbarWriter.extend({
},
 
getHomeTab: function() {
-   return {
-   'id': 'NotebookBar',
-   'type': 'notebookbar',
-   'children': [
-   {
-   'id': 'box1',
-   'type': 'container',
-   'children': [
-   {
-   'id': 
'ContextContainer',
-   'type': 'tabcontrol',
-   'children': [
-   {
-   'id': 
'',
-   'type': 
'tabpage',
-   
'children': [
-   
{
-   
'id': 'HomeBox',
-   
'type': 'container',
-   
'children': [
-   
{
-   
'id': 'Home-PasteBox',
-   
'type': 'container',
-   
'children': [
-   
{
-   
'id': 'FileSection7',
-   
'type': 'container',
-   
'children': [
-   
{
-   
'id': 'SectionBottom87',
-   
'type': 'toolbox',
-   
'children': [
-   
{
-   
'type': 
'toolitem',
-   
'text': 
'Paste',
-   

'command': '.uno:Paste'
-   
}
-   
   

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

2020-05-10 Thread Henry Castro (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |   58 ---
 1 file changed, 41 insertions(+), 17 deletions(-)

New commits:
commit 4617903be2666f437ff87a3ca07b713e39e685d1
Author: Henry Castro 
AuthorDate: Wed May 6 15:04:22 2020 -0400
Commit: Henry Castro 
CommitDate: Mon May 11 04:48:07 2020 +0200

jsdialog: add formatted field handler

In master branch by default the legacy control like the
metric control is not created, that force to create the
replacement which is formatted field control.

Change-Id: Ib5dcaa9516057a3aed304b748f13d44098dc525b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93588
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index a72fe2959..4ecbc0ad9 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -112,6 +112,25 @@ L.Control.JSDialogBuilder = L.Control.extend({
});
 
return controls;
+   },
+
+   listenNumericChanges: function (data, builder, controls, 
customCallback) {
+   // It listens server state changes using GetControlState
+   // to avoid unit conversion
+   builder.map.on('commandstatechanged', function(e) {
+   var value = e.state[data.id];
+   if (value) {
+   value = parseFloat(value);
+   $(controls.spinfield).attr('value', 
value);
+   }
+   }, this);
+
+   controls.spinfield.addEventListener('change', 
function() {
+   if (customCallback)
+   customCallback();
+   else
+   builder.callback('spinfield', 'value', 
controls.container, this.value, builder);
+   });
}
},
 
@@ -125,6 +144,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
this._controlHandlers['checkbox'] = this._checkboxControl;
this._controlHandlers['spinfield'] = this._spinfieldControl;
this._controlHandlers['metricfield'] = this._metricfieldControl;
+   this._controlHandlers['formattedfield'] = 
this._formattedfieldControl;
this._controlHandlers['edit'] = this._editControl;
this._controlHandlers['multilineedit'] = 
this._multiLineEditControl;
this._controlHandlers['pushbutton'] = this._pushbuttonControl;
@@ -1183,26 +1203,30 @@ L.Control.JSDialogBuilder = L.Control.extend({
return false;
},
 
+   _formattedfieldControl: function(parentContainer, data, builder, 
customCallback) {
+   var value, units, controls;
+
+   // formatted control does not contain unit property
+   units = data.text.split(' ');
+   if (units.length == 2) {
+   data.unit = units[1];
+   }
+
+   controls = 
L.Control.JSDialogBuilder.baseSpinField(parentContainer, data, builder, 
customCallback);
+
+   L.Control.JSDialogBuilder.listenNumericChanges(data, builder, 
controls, customCallback);
+
+   value = parseFloat(data.value);
+   $(controls.spinfield).attr('value', value);
+
+   return false;
+   },
+
+
_metricfieldControl: function(parentContainer, data, builder, 
customCallback) {
var value;
var controls = 
L.Control.JSDialogBuilder.baseSpinField(parentContainer, data, builder, 
customCallback);
-
-   // It listens server state changes using GetControlState
-   // to avoid unit conversion
-   builder.map.on('commandstatechanged', function(e) {
-   value = e.state[data.id];
-   if (value) {
-   value = parseFloat(value);
-   $(controls.spinfield).attr('value', value);
-   }
-   }, this);
-
-   controls.spinfield.addEventListener('change', function() {
-   if (customCallback)
-   customCallback();
-   else
-   builder.callback('spinfield', 'value', 
controls.container, this.value, builder);
-   });
+   L.Control.JSDialogBuilder.listenNumericChanges(data, builder, 
controls, customCallback);
 
value = parseFloat(data.value);
$(controls.spinfield).attr('value', value);
___

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

2020-05-10 Thread Aron Budea (via logerrit)
 loleaflet/src/control/Control.UIManager.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 26911310406aefa36c9c80f65f6833feaf2c5645
Author: Aron Budea 
AuthorDate: Sun May 10 06:58:57 2020 +0200
Commit: Andras Timar 
CommitDate: Sun May 10 21:42:41 2020 +0200

loleaflet: Show navigation controls on sheets bar on tablets

regression from 1d1651795c73a7f2b73bdb17b7e2926047ffcbee

Change-Id: Ifc7589a2bbabb99021ad98ed85216f1d22b5e641
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93902
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.UIManager.js 
b/loleaflet/src/control/Control.UIManager.js
index 189f4e823..9c1b3e7f6 100644
--- a/loleaflet/src/control/Control.UIManager.js
+++ b/loleaflet/src/control/Control.UIManager.js
@@ -86,7 +86,7 @@ L.Control.UIManager = L.Control.extend({
}
 
if (docType === 'spreadsheet') {
-   
this.map.addControl(L.control.sheetsBar({shownavigation: isDesktop}));
+   
this.map.addControl(L.control.sheetsBar({shownavigation: isDesktop || 
window.mode.isTablet()}));
this.map.addControl(L.control.formulaBar());
}
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-08 Thread Pranam Lashkari (via logerrit)
 loleaflet/src/control/Control.ContextMenu.js |2 +-
 loleaflet/src/control/Control.JSDialogBuilder.js |1 +
 loleaflet/src/unocommands.js |1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 4329826d91cfd1e4103e689352e429754a2067cd
Author: Pranam Lashkari 
AuthorDate: Fri May 8 14:12:41 2020 +0530
Commit: Andras Timar 
CommitDate: Fri May 8 20:04:02 2020 +0200

leaflet: clear formatting option enabled for impress mobile

Change-Id: I8be2baa555174d22bb9ff7836ad452a4fa8d24b9
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93704
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.ContextMenu.js 
b/loleaflet/src/control/Control.ContextMenu.js
index 3a429464d..82bd501c5 100644
--- a/loleaflet/src/control/Control.ContextMenu.js
+++ b/loleaflet/src/control/Control.ContextMenu.js
@@ -53,7 +53,7 @@ L.Control.ContextMenu = L.Control.extend({
spreadsheet: ['MergeCells', 'SplitCell', 
'RecalcPivotTable', 'FormatCellDialog',
  'ShowNote', 'DeleteNote', 
'SetAnchorToCell', 'SetAnchorToCellResize'],
 
-   presentation: [],
+   presentation: ['SetDefault'],
drawing: []
},
// UNOCOMMANDS_EXTRACT_END <- don't remove this line, it's used 
by unocommands.py
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 9c99e31f5..a72fe2959 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -172,6 +172,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
this._toolitemHandlers['.uno:Color'] = this._colorControl;
this._toolitemHandlers['.uno:FillColor'] = this._colorControl;
this._toolitemHandlers['.uno:ResetAttributes'] = 
this._clearFormattingControl;
+   this._toolitemHandlers['.uno:SetDefault'] = 
this._clearFormattingControl;
 
this._currentDepth = 0;
},
diff --git a/loleaflet/src/unocommands.js b/loleaflet/src/unocommands.js
index 2149e8d9c..608dfd997 100644
--- a/loleaflet/src/unocommands.js
+++ b/loleaflet/src/unocommands.js
@@ -266,6 +266,7 @@ var unoCommandsArray = {
SetAnchorToFrame:{text:{menu:_('To ~Frame'),},},
SetAnchorToPage:{spreadsheet:{menu:_('To P~age'),},text:{menu:_('To 
P~age'),},},
SetAnchorToPara:{text:{menu:_('To ~Paragraph'),},},
+   SetDefault:{global:{menu:_('Clear ~Direct Formatting'),},},
SetLanguageAllTextMenu:{global:{menu:_('For All Text'),},},
SetLanguageParagraphMenu:{global:{menu:_('For Paragraph'),},},
SetLanguageSelectionMenu:{global:{menu:_('For Selection'),},},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


<    1   2   3   4   5   6   7   8   9   10   >