[Libreoffice-commits] online.git: 37 commits - kit/Kit.cpp loleaflet/css loleaflet/html loleaflet/images loleaflet/js loleaflet/Makefile.am loleaflet/plugins loleaflet/src net/Socket.cpp test/data test/httpwstest.cpp wsd/DocumentBroker.cpp wsd/FileServer.cpp

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jan 22 13:56:29 UTC 2019


 kit/Kit.cpp                                       |   12 +++
 loleaflet/Makefile.am                             |    1 
 loleaflet/css/selectionMarkers.css                |    7 +
 loleaflet/html/loleaflet.html.m4                  |    4 -
 loleaflet/images/cursor-handler.png               |binary
 loleaflet/js/toolbar.js                           |   65 +++++++++--------
 loleaflet/js/w2ui-1.5.rc1.js                      |    2 
 loleaflet/plugins/path-transform/src/Path.Drag.js |    2 
 loleaflet/src/control/Control.ContextToolbar.js   |   70 ++++++++++++------
 loleaflet/src/control/Control.LokDialog.js        |   19 +++-
 loleaflet/src/control/Control.Menubar.js          |    6 +
 loleaflet/src/control/Control.MobileInput.js      |   30 +++++++
 loleaflet/src/control/Control.PartsPreview.js     |    6 +
 loleaflet/src/control/Control.js                  |    4 +
 loleaflet/src/control/Parts.js                    |    4 -
 loleaflet/src/core/Socket.js                      |    2 
 loleaflet/src/dom/Draggable.js                    |    4 -
 loleaflet/src/geometry/Bounds.js                  |    6 +
 loleaflet/src/layer/AnnotationManager.js          |   22 ++++-
 loleaflet/src/layer/marker/ClipboardContainer.js  |   12 +++
 loleaflet/src/layer/marker/Marker.Drag.js         |   10 ++
 loleaflet/src/layer/tile/GridLayer.js             |    2 
 loleaflet/src/layer/tile/ImpressTileLayer.js      |   22 +++++
 loleaflet/src/layer/tile/TileLayer.js             |   65 ++++++++++++++---
 loleaflet/src/layer/vector/SVGGroup.js            |   47 +++++++++++-
 loleaflet/src/map/Map.js                          |   27 ++++++-
 loleaflet/src/map/handler/Map.Tap.js              |   11 ++
 loleaflet/src/unocommands.js                      |   84 ++++++++++------------
 net/Socket.cpp                                    |   14 ++-
 test/data/non-shape-image.odt                     |binary
 test/data/non_shape_writer_image.svg              |   44 +++++++++++
 test/data/shape.odt                               |binary
 test/data/shape_writer.svg                        |   55 ++++++++++++++
 test/data/shapes_impress.svg                      |    2 
 test/httpwstest.cpp                               |   82 ++++++++++++++++++---
 wsd/DocumentBroker.cpp                            |    4 -
 wsd/FileServer.cpp                                |    6 -
 37 files changed, 602 insertions(+), 151 deletions(-)

New commits:
commit cc6cb0039c414d1e36162ca586deb4b4ed10a64c
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sun Jan 20 19:11:17 2019 -0500
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    leaflet: keep the focus only if we already had it
    
    Change-Id: Ic9f43453f321c5f67289aa9c3446963348926f6a

diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 9a337c981..7c23669ed 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1600,7 +1600,7 @@ L.TileLayer = L.GridLayer.extend({
 		}
 
 		this._map._clipboardContainer.showCursor();
-		if (!L.Browser.mobile) {
+		if (this._map._isFocused && !L.Browser.mobile) {
 			// On mobile, this is causing some key input to get lost.
 			this._map.focus();
 		}
commit 0b0c11d38c8f76f6af9816e01fdcf2c17c5a91da
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sun Jan 20 12:06:29 2019 -0500
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    leaflet: update all invdalidated preview tiles
    
    Previously only the current part preview was updated
    and the others were updated upon selecting them.
    
    Now we track invalidated parts such that they
    all get their previews updated together.
    
    Change-Id: I13ae9230381355fcfe138ac1db16233fdcd1406a

diff --git a/loleaflet/src/control/Parts.js b/loleaflet/src/control/Parts.js
index 395f9e092..1b309146c 100644
--- a/loleaflet/src/control/Parts.js
+++ b/loleaflet/src/control/Parts.js
@@ -60,7 +60,7 @@ L.Map.include({
 		}
 		var autoUpdate = options ? !!options.autoUpdate : false;
 		var forAllClients = options ? !!options.broadcast : false;
-		this._docPreviews[id] = {id: id, index: index, maxWidth: maxWidth, maxHeight: maxHeight, autoUpdate: autoUpdate};
+		this._docPreviews[id] = {id: id, index: index, maxWidth: maxWidth, maxHeight: maxHeight, autoUpdate: autoUpdate, invalid: false};
 
 		var docLayer = this._docLayer;
 		if (docLayer._docType === 'text') {
@@ -108,7 +108,7 @@ L.Map.include({
 		}
 		var autoUpdate = options ? options.autoUpdate : false;
 		this._docPreviews[id] = {id: id, part: part, width: width, height: height, tilePosX: tilePosX,
-			tilePosY: tilePosY, tileWidth: tileWidth, tileHeight: tileHeight, autoUpdate: autoUpdate};
+			tilePosY: tilePosY, tileWidth: tileWidth, tileHeight: tileHeight, autoUpdate: autoUpdate, invalid: false};
 
 		var dpiscale = L.getDpiScaleFactor();
 
diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js
index 1768a53bf..5240e3b89 100644
--- a/loleaflet/src/layer/tile/ImpressTileLayer.js
+++ b/loleaflet/src/layer/tile/ImpressTileLayer.js
@@ -444,6 +444,7 @@ L.ImpressTileLayer = L.TileLayer.extend({
 			this._map.fire('updatepart', {part: command.part, docType: this._docType});
 		}
 
+		this._map._docPreviews[command.part].invalid = true;
 		this._previewInvalidations.push(invalidBounds);
 		// 1s after the last invalidation, update the preview
 		clearTimeout(this._previewInvalidator);
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 4d0cc213d..9a337c981 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2456,14 +2456,14 @@ L.TileLayer = L.GridLayer.extend({
 					var preview = this._map._docPreviews[key];
 					if (preview.index >= 0 && this._docType === 'text') {
 						// we have a preview for a page
-						if (this._partPageRectanglesTwips.length > preview.index &&
-								invalidBounds.intersects(this._partPageRectanglesTwips[preview.index])) {
+						if (preview.invalid || (this._partPageRectanglesTwips.length > preview.index &&
+								invalidBounds.intersects(this._partPageRectanglesTwips[preview.index]))) {
 							toInvalidate[key] = true;
 						}
 					}
 					else if (preview.index >= 0) {
 						// we have a preview for a part
-						if (preview.index === this._selectedPart ||
+						if (preview.invalid || preview.index === this._selectedPart ||
 								(preview.index === this._prevSelectedPart && this._prevSelectedPartNeedsUpdate)) {
 							// if the current part needs its preview updated OR
 							// the part has been changed and we need to update the previous part preview
@@ -2478,7 +2478,7 @@ L.TileLayer = L.GridLayer.extend({
 						var bounds = new L.Bounds(
 								new L.Point(preview.tilePosX, preview.tilePosY),
 								new L.Point(preview.tilePosX + preview.tileWidth, preview.tilePosY + preview.tileHeight));
-						if ((preview.part === this._selectedPart ||
+						if (preview.invalid || (preview.part === this._selectedPart ||
 								(preview.part === this._prevSelectedPart && this._prevSelectedPartNeedsUpdate)) &&
 								invalidBounds.intersects(bounds)) {
 							// if the current part needs its preview updated OR
commit f937aef852395b4ae373d4c0ed9bc0fd5376fa08
Author:     Marco Cecchetti <mrcekets at gmail.com>
AuthorDate: Wed Jan 9 17:04:19 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    loleflet: comments from separate places appears together
    
    Change-Id: I981ff81c4e897fc2d2b296f03e4798efea5d7c02

diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js
index 339f3d269..80bdd01aa 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -317,8 +317,15 @@ L.AnnotationManager = L.Class.extend({
 		var docRight = this._map.project(this._map.options.docBounds.getNorthEast());
 		var posX = docRight.x + this.options.marginX;
 		posX = this._map.latLngToLayerPoint(this._map.unproject(L.point(posX, 0))).x;
-		layoutBounds.extend(layoutBounds.min.subtract([0, bounds.getSize().y]));
-		var posY = layoutBounds.min.y;
+		var posY;
+		if (layoutBounds.intersects(bounds)) {
+			layoutBounds.extend(layoutBounds.min.subtract([0, bounds.getSize().y]));
+			posY = layoutBounds.min.y;
+		}
+		else {
+			posY = bounds.min.y;
+			layoutBounds.extend(L.point(layoutBounds.min.x, bounds.min.y));
+		}
 		var pt = L.point(posX, posY);
 		layoutBounds.extend(layoutBounds.min.subtract([0, this.options.marginY]));
 
@@ -350,8 +357,15 @@ L.AnnotationManager = L.Class.extend({
 		var docRight = this._map.project(this._map.options.docBounds.getNorthEast());
 		var posX = docRight.x + this.options.marginX;
 		posX = this._map.latLngToLayerPoint(this._map.unproject(L.point(posX, 0))).x;
-		var posY = layoutBounds.getBottomLeft().y;
-		layoutBounds.extend(layoutBounds.max.add([0, bounds.getSize().y]));
+		var posY;
+		if (layoutBounds.intersects(bounds)) {
+			posY = layoutBounds.getBottomLeft().y;
+			layoutBounds.extend(layoutBounds.max.add([0, bounds.getSize().y]));
+		}
+		else {
+			posY = bounds.min.y;
+			layoutBounds.extend(L.point(layoutBounds.max.x, bounds.max.y));
+		}
 		var pt = L.point(posX, posY);
 		layoutBounds.extend(layoutBounds.max.add([0, this.options.marginY]));
 
commit bd015e5c6e239e5423a6029beeaf75f7cd431f28
Author:     Marco Cecchetti <mrcekets at gmail.com>
AuthorDate: Thu Jan 10 18:05:27 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    impress: no slide preview if session was started with hidden slides pane
    
    Change-Id: Ia21e191cac2513cf610d2632ec4b519a822d5c54

diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js
index f21d4811a..82aa8af45 100644
--- a/loleaflet/src/control/Control.PartsPreview.js
+++ b/loleaflet/src/control/Control.PartsPreview.js
@@ -31,6 +31,10 @@ L.Control.PartsPreview = L.Control.extend({
 		}
 
 		if (docType === 'presentation' || docType === 'drawing') {
+			var presentationControlWrapperElem = L.DomUtil.get('presentation-controls-wrapper');
+			var visible = L.DomUtil.getStyle(presentationControlWrapperElem, 'display');
+			if (visible === 'none')
+				return;
 			if (!this._previewInitialized)
 			{
 				// make room for the preview
@@ -202,6 +206,8 @@ L.Control.PartsPreview = L.Control.extend({
 
 	_updatePreview: function (e) {
 		if (this._map.getDocType() === 'presentation' || this._map.getDocType() === 'drawing') {
+			if (!this._previewInitialized)
+				return;
 			this._previewTiles[e.id].src = e.tile;
 		}
 	},
diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js
index 9fb9db193..1768a53bf 100644
--- a/loleaflet/src/layer/tile/ImpressTileLayer.js
+++ b/loleaflet/src/layer/tile/ImpressTileLayer.js
@@ -66,6 +66,20 @@ L.ImpressTileLayer = L.TileLayer.extend({
 		if (!L.Browser.mobile) {
 			this._map.setView(this._map.getCenter(), this._map.getZoom(), {reset: true});
 		}
+
+		var presentationControlWrapperElem = L.DomUtil.get('presentation-controls-wrapper');
+		var visible = L.DomUtil.getStyle(presentationControlWrapperElem, 'display');
+
+		if (!this._isSlidePaneVisible && visible !== 'none') {
+			this._map.fire('updateparts', {
+				selectedPart: this._selectedPart,
+				selectedParts: this._selectedParts,
+				parts: this._parts,
+				docType: this._docType,
+				partNames: this._partHashes
+			});
+		}
+		this._isSlidePaneVisible = !(visible === 'none');
 	},
 
 	onAdd: function (map) {
commit 3974a03f9962b46d07129d39831045f66e0ab509
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Tue Jan 15 08:59:26 2019 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    loleaflet: ensure the document layer is created before
    
    receiving focus
    
    Change-Id: I259c11511bfb767b03a30b5ebbd70d7627e619c4

diff --git a/loleaflet/src/control/Control.MobileInput.js b/loleaflet/src/control/Control.MobileInput.js
index 487b3573a..467f44dad 100644
--- a/loleaflet/src/control/Control.MobileInput.js
+++ b/loleaflet/src/control/Control.MobileInput.js
@@ -32,7 +32,7 @@ L.Control.MobileInput = L.Control.extend({
 	},
 
 	onGotFocus: function () {
-		if (this._map._docLayer._cursorMarker) {
+		if (this._map._docLayer && this._map._docLayer._cursorMarker) {
 			this._cursorHandler.setLatLng(this._map._docLayer._visibleCursor.getSouthWest());
 			this._map.addLayer(this._map._docLayer._cursorMarker);
 			if (this._map._docLayer._selections.getLayers().length === 0) {
@@ -44,7 +44,7 @@ L.Control.MobileInput = L.Control.extend({
 	},
 
 	onLostFocus: function () {
-		if (this._map._docLayer._cursorMarker) {
+		if (this._map._docLayer && this._map._docLayer._cursorMarker) {
 			this._textArea.value = '';
 			this._map.removeLayer(this._map._docLayer._cursorMarker);
 			this._map.removeLayer(this._cursorHandler);
commit 9811b0fc988d1562be76a5e9e26cd86e45c30b80
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sun Jan 6 10:44:40 2019 -0500
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    wsd: reduce warnings
    
    Don't stop the polling thread and attempt cleanup
    when the thread is no longer alive; just avoid
    logging warnings and other noise.
    
    Demote a couple warning logs to info since
    they are neither critical nor actionable.
    
    Change-Id: Ibe8e8491723f1beeaea03a6e935d606b01e275f0

diff --git a/net/Socket.cpp b/net/Socket.cpp
index 44f5d18a4..2d35f6b02 100644
--- a/net/Socket.cpp
+++ b/net/Socket.cpp
@@ -136,11 +136,15 @@ bool SocketPoll::startThread()
 
 void SocketPoll::joinThread()
 {
-    addCallback([this]()
-                {
-                    removeSockets();
-                });
-    stop();
+    if (isAlive())
+    {
+        addCallback([this]()
+                    {
+                        removeSockets();
+                    });
+        stop();
+    }
+
     if (_threadStarted && _thread.joinable())
     {
         if (_thread.get_id() == std::this_thread::get_id())
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index c21177af1..93ad6c04b 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -422,9 +422,7 @@ DocumentBroker::~DocumentBroker()
     _poll->joinThread();
 
     if (!_sessions.empty())
-    {
         LOG_WRN("DocumentBroker [" << _docKey << "] still has unremoved sessions.");
-    }
 
     // Need to first make sure the child exited, socket closed,
     // and thread finished before we are destroyed.
@@ -1648,7 +1646,7 @@ void DocumentBroker::handleTileCombinedResponse(const std::vector<char>& payload
         }
         else
         {
-            LOG_WRN("Dropping empty tilecombine response: " << firstLine);
+            LOG_INF("Dropping empty tilecombine response: " << firstLine);
             // They will get re-issued if we don't forget them.
         }
     }
diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp
index b1cd9af35..07ee9c4cd 100644
--- a/wsd/FileServer.cpp
+++ b/wsd/FileServer.cpp
@@ -592,9 +592,9 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, Poco::
     Poco::URI::encode(accessHeader, "'", escapedAccessHeader);
 
     unsigned long tokenTtl = 0;
-    if (accessToken != "")
+    if (!accessToken.empty())
     {
-        if (accessTokenTtl != "")
+        if (!accessTokenTtl.empty())
         {
             try
             {
@@ -607,7 +607,7 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, Poco::
         }
         else
         {
-            LOG_WRN("WOPI host did not pass optional access_token_ttl");
+            LOG_INF("WOPI host did not pass optional access_token_ttl");
         }
     }
 
commit 5c65ae5d297802d29ade0b639d8e8d2d318188ec
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Jan 7 18:22:19 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    Hide 'styles' listbox on loading mobile
    
    Change-Id: Ie1a4a6640712536a1dd4319e4a5799794ba80eac

diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 4646801ab..03f30803a 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -703,7 +703,7 @@ function createToolbar() {
 						e.item.html = undefined;
 					}});
 				}
-			}, desktop: true, mobile: false, tablet: false}, // FIXME would be better to start with 'hidden: false' and show it only where necessary, but that currently ends up with never showing 'styles'
+			}, hidden: true, desktop: true, mobile: false, tablet: false},
 		{type: 'html', id: 'fonts',
 			html: '<select class="fonts-select"><option>Liberation Sans</option></select>',
 			onRefresh: function (edata) {
@@ -1032,8 +1032,17 @@ function initNormalToolbar(toolItems) {
 				}
 			}
 
-			if (event.target === 'styles' || event.target === 'fonts' || event.target === 'fontsizes')
+			if (event.target === 'styles' || event.target === 'fonts' || event.target === 'fontsizes') {
+				var toolItem = $(this.box).find('#tb_'+ this.name +'_item_'+ w2utils.escapeId(event.item.id));
+				if ((_inDesktopMode() && event.item.desktop == false)
+					|| (_inTabletMode() && event.item.tablet == false)) {
+					toolItem.css('display', 'none');
+				} else {
+					toolItem.css('display', '');
+				}
+
 				updateCommandValues(event.target);
+			}
 
 			if (event.target === 'inserttable')
 				insertTable();
commit 58b0bbaa259a8c43a9ddb0c4cdc0935446a25dd1
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Jan 7 17:59:33 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    Remove white bar only on mobile
    
    Change-Id: Iea0c1e072292e2f0199606976a0971c5444d4949

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 781a8ea78..ca76a11da 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -114,9 +114,11 @@ L.Map = L.Evented.extend({
 		}
 
 		// Avoid white bar on the bottom - force resize-detector to get full size
-		$('#document-container').css('bottom', '0px');
-		this._clipboardContainer._textArea.blur();
-		this._clipboardContainer._textArea.focus();
+		if (window.mode.isMobile()) {
+			$('#document-container').css('bottom', '0px');
+			this._clipboardContainer._textArea.blur();
+			this._clipboardContainer._textArea.focus();
+		}
 
 		// When all these conditions are met, fire statusindicator:initializationcomplete
 		this.initConditions = {
commit 6df5d5d15f33acc8cc4c673becbffc591e5d605c
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Jan 7 17:10:10 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    Avoid white bar on loading (mobile)
    
    Change-Id: Ica20f716059d354df6f8c35d76f5a98f7f11b149

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index edd51e0dc..781a8ea78 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -113,6 +113,11 @@ L.Map = L.Evented.extend({
 			this.addLayer(this._clipboardContainer);
 		}
 
+		// Avoid white bar on the bottom - force resize-detector to get full size
+		$('#document-container').css('bottom', '0px');
+		this._clipboardContainer._textArea.blur();
+		this._clipboardContainer._textArea.focus();
+
 		// When all these conditions are met, fire statusindicator:initializationcomplete
 		this.initConditions = {
 			'doclayerinit': false,
commit 5cdbad3e074d34b47e80b1603b4dc1643cec822c
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Tue Jan 22 14:01:05 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    Add missing command names.
    
    This pulls some spelling fixes in too.
    
    Change-Id: I5f3e7e8c22a02c7faf83894e8447f6e5fe943c35

diff --git a/loleaflet/src/unocommands.js b/loleaflet/src/unocommands.js
index b8130c4c0..a9bccdba5 100644
--- a/loleaflet/src/unocommands.js
+++ b/loleaflet/src/unocommands.js
@@ -1,11 +1,10 @@
-/* -*- js-indent-level: 8 -*- */
 // Don't modify, generated using unocommands.py
 
 var unoCommandsArray = {
 	AcceptAllTrackedChanges:{text:{menu:_('Accept All'),},},
 	AcceptTrackedChanges:{text:{menu:_('~Manage...'),},},
 	AlignBlock:{spreadsheet:{menu:_('Justified'),},},
-	AlignHorizontalCenter:{spreadsheet:{menu:_('Center Horizontally'),},text:{menu:_('Center Horizontal'),},},
+	AlignHorizontalCenter:{spreadsheet:{menu:_('Align Center'),},text:{menu:_('Center Horizontal'),},},
 	AlignLeft:{spreadsheet:{menu:_('Align Left'),},text:{menu:_('Align Left'),},},
 	AlignRight:{spreadsheet:{menu:_('Align Right'),},text:{menu:_('Align Right'),},},
 	AnchorMenu:{global:{menu:_('Anc~hor'),},},
@@ -15,7 +14,7 @@ var unoCommandsArray = {
 	BackgroundColor:{global:{menu:_('Background Color'),},},
 	Bold:{global:{menu:_('Bold'),},},
 	BringToFront:{global:{menu:_('~Bring to Front'),},},
-	CenterPara:{global:{context:_('Center Horizontally'),menu:_('Center'),},},
+	CenterPara:{global:{context:_('Align Center'),menu:_('Center'),},},
 	ChangeCaseRotateCase:{global:{menu:_('Cycle Case'),},},
 	ChangeCaseToLower:{global:{menu:_('~lowercase'),},},
 	ChangeCaseToSentenceCase:{global:{menu:_('~Sentence case'),},},
@@ -31,8 +30,8 @@ var unoCommandsArray = {
 	CommonAlignRight:{global:{menu:_('Right'),},},
 	CommonAlignTop:{global:{menu:_('Top'),},},
 	CommonAlignVerticalCenter:{global:{menu:_('Center'),},},
-	ConditionalFormatMenu:{spreadsheet:{menu:_('C~onditional Formatting'),},},
 	ConditionalFormatManagerDialog:{spreadsheet:{menu:_('Manage...'),},},
+	ConditionalFormatMenu:{spreadsheet:{menu:_('C~onditional'),},},
 	ContinueNumbering:{text:{menu:_('Continue previous numbering'),},},
 	ControlCodes:{text:{menu:_('For~matting Marks'),},},
 	Copy:{global:{menu:_('Cop~y'),},},
@@ -43,7 +42,7 @@ var unoCommandsArray = {
 	DataFilterRemoveFilter:{spreadsheet:{menu:_('~Reset Filter'),},},
 	DataFilterSpecialFilter:{spreadsheet:{menu:_('~Advanced Filter...'),},},
 	DataFilterStandardFilter:{spreadsheet:{menu:_('~Standard Filter...'),},},
-	DataMenu:{spreadsheet:{menu:_('~Data'),},},
+	DataMenu:{global:{menu:_('~Data'),},},
 	DataSort:{spreadsheet:{menu:_('~Sort...'),},},
 	DecrementIndent:{global:{context:_('Decrease Indent'),menu:_('Decrease Indent'),},},
 	DecrementLevel:{text:{menu:_('Demote One Level'),},},
@@ -54,20 +53,20 @@ var unoCommandsArray = {
 	DeleteAllNotes:{global:{menu:_('Delete All Comments'),},spreadsheet:{menu:_('Delete All Comments'),},},
 	DeleteAuthor:{global:{menu:_('Delete All Comments by This Author'),},},
 	DeleteColumnbreak:{spreadsheet:{menu:_('~Column Break'),},},
-	DeleteColumns:{presentation:{context:_('Delete Column'),menu:_('~Columns'),},spreadsheet:{menu:_('Delete Columns'),},text:{menu:_('~Columns'),},},
+	DeleteColumns:{presentation:{menu:_('Delete Column'),},spreadsheet:{menu:_('Delete Columns'),},text:{menu:_('~Columns'),},},
 	DeleteComment:{global:{menu:_('Delete Comment'),},},
 	DeleteRowbreak:{spreadsheet:{menu:_('~Row Break'),},},
-	DeleteRows:{presentation:{context:_('Delete Row'),menu:_('~Rows'),},spreadsheet:{menu:_('Delete Rows'),},text:{menu:_('~Rows'),},},
+	DeleteRows:{presentation:{menu:_('Delete Row'),},spreadsheet:{menu:_('Delete Rows'),},text:{menu:_('~Rows'),},},
 	DeleteSlide:{presentation:{menu:_('~Delete Slide'),},},
 	DeleteTable:{text:{menu:_('~Table'),},},
 	DownSearch:{global:{menu:_('Find Next'),},},
 	DuplicateSlide:{presentation:{menu:_('Duplicate ~Slide'),},},
+	EditHeaderAndFooter:{spreadsheet:{menu:_('~Headers and Footers...'),},},
 	EditMenu:{global:{menu:_('~Edit'),},},
 	EditStyle:{global:{menu:_('~Edit Style...'),},presentation:{menu:_('E~dit Style...'),},},
-       EditHeaderAndFooter:{spreadsheet:{menu:_('~Headers and Footers...'),},},
 	EntireCell:{text:{menu:_('C~ell'),},},
-	EntireColumn:{presentation:{menu:_('~Columns'),},text:{menu:_('~Column'),},},
-	EntireRow:{presentation:{menu:_('~Rows'),},text:{menu:_('~Row'),},},
+	EntireColumn:{presentation:{menu:_('Select Column'),},text:{menu:_('~Column'),},},
+	EntireRow:{presentation:{menu:_('Select Row'),},text:{menu:_('~Row'),},},
 	FilterMenu:{spreadsheet:{menu:_('More ~Filters'),},},
 	FontColor:{global:{menu:_('Font Color'),},text:{menu:_('Font Color'),},},
 	FontDialog:{global:{menu:_('C~haracter...'),},},
@@ -77,67 +76,66 @@ var unoCommandsArray = {
 	FormatColumns:{text:{menu:_('Co~lumns...'),},},
 	FormatLine:{global:{menu:_('L~ine...'),},},
 	FormatMenu:{global:{menu:_('F~ormat'),},},
-	FormatObjectMenu:{global:{menu:_('~Object and Shape'),},text:{menu:_('Text Box and Shap~e'),},},
-	FormatPaintbrush:{global:{context:_('Clone Formatting (double click for multi-selection)'),menu:_('Clone'),},},
+	FormatPaintbrush:{global:{context:_('Clone Formatting (double click for multi-selection)'),menu:_('Clone'),},text:{context:_('Clone Formatting (double click and Ctrl or Cmd to alter behavior)'),menu:_('Clone'),},},
 	FormatSpacingMenu:{global:{menu:_('~Spacing'),},},
 	FormatTextMenu:{global:{menu:_('Te~xt'),},},
 	FormattingMarkMenu:{global:{menu:_('Formatting Mark'),},},
 	FullScreen:{global:{menu:_('F~ull Screen'),},},
+	GoalSeekDialog:{spreadsheet:{menu:_('~Goal Seek...'),},},
 	Group:{global:{menu:_('~Group...'),},},
 	GroupOutlineMenu:{spreadsheet:{menu:_('~Group and Outline'),},},
 	Grow:{global:{menu:_('Increase Size'),},},
-       GoalSeekDialog:{spreadsheet:{menu:_('Goal Seek...'),},},
 	HeaderAndFooter:{presentation:{menu:_('~Header and Footer...'),},},
 	HelpMenu:{global:{menu:_('~Help'),},},
 	Hide:{spreadsheet:{menu:_('~Hide Sheet'),},},
 	HideColumn:{spreadsheet:{context:_('H~ide Columns'),menu:_('~Hide'),},},
 	HideDetail:{global:{menu:_('~Hide Details'),},},
 	HideRow:{spreadsheet:{context:_('H~ide Rows'),menu:_('H~ide'),},},
-	HyperlinkDialog:{global:{menu:_('~Hyperlink...'),},},
-	IndexesMenu:{text:{menu:_('~Table of Contents and Index'),},},
+	HyperlinkDialog:{global:{context:_('Insert Hyperlink'),menu:_('~Hyperlink...'),},},
 	IncrementIndent:{global:{context:_('Increase Indent'),menu:_('Increase Indent'),},},
 	IncrementLevel:{text:{menu:_('Promote One Level'),},},
 	IncrementSubLevels:{text:{menu:_('Promote One Level With Subpoints'),},},
+	IndexesMenu:{text:{menu:_('Table of Contents and Inde~x'),},},
 	InsertAnnotation:{global:{context:_('Insert Comment'),menu:_('Comme~nt'),},presentation:{menu:_('Comme~nt'),},spreadsheet:{context:_('Insert Co~mment'),menu:_('Comm~ent'),},},
-	InsertAuthorField:{presentation:{menu:_('~Author'),},text:{menu:_('~Author'),},},
-       InsertAuthoritiesEntry:{text:{menu:_('~Biblography Entry...'),},},
+	InsertAuthorField:{presentation:{menu:_('~Author'),},text:{menu:_('First ~Author'),},},
+	InsertAuthoritiesEntry:{text:{menu:_('~Bibliography Entry...'),},},
 	InsertBreakMenu:{spreadsheet:{menu:_('Insert Page ~Break'),},},
 	InsertColumnBreak:{spreadsheet:{menu:_('~Column Break'),},text:{menu:_('Insert Column Break'),},},
-	InsertColumnsAfter:{presentation:{menu:_('Insert Column Right'),},spreadsheet:{context:_('Insert Columns ~Right'),menu:_('Columns ~Right'),},text:{menu:_('Columns R~ight'),},},
-	InsertColumnsBefore:{presentation:{menu:_('Insert Column Left'),},spreadsheet:{context:_('Insert Columns ~Left'),menu:_('Columns ~Left'),},text:{menu:_('Columns ~Left'),},},
+	InsertColumnsAfter:{presentation:{menu:_('Insert Column After'),},spreadsheet:{context:_('Insert Columns ~After'),menu:_('Columns ~After'),},text:{menu:_('Columns ~After'),},},
+	InsertColumnsBefore:{presentation:{menu:_('Insert Column Before'),},spreadsheet:{context:_('Insert Columns ~Before'),menu:_('Columns ~Before'),},text:{menu:_('Columns ~Before'),},},
 	InsertColumnsMenu:{spreadsheet:{menu:_('Insert Co~lumns'),},},
 	InsertDateField:{text:{menu:_('~Date'),},},
 	InsertEndnote:{text:{menu:_('~Endnote'),},},
 	InsertField:{text:{menu:_('~More Fields...'),},},
-	InsertFootnote:{text:{context:_('Insert Footnote'),menu:_('~Footnote'),},},
+	InsertFootnote:{text:{menu:_('~Footnote'),},},
 	InsertGraphic:{global:{context:_('Insert Image...'),menu:_('~Image...'),},},
-	InsertHardHyphen:{global:{menu:_('Non-br~eaking hyphen'),},},
+	InsertHardHyphen:{global:{menu:_('Non-br~eaking Hyphen'),},},
 	InsertHeaderFooterMenu:{text:{menu:_('He~ader and Footer'),},},
 	InsertIndexesEntry:{text:{menu:_('~Index Entry...'),},},
-	InsertLRM:{global:{menu:_('~Left-to-right mark'),},},
+	InsertLRM:{global:{menu:_('~Left-to-right Mark'),},},
 	InsertMenu:{global:{menu:_('~Insert'),},},
 	InsertNeutralParagraph:{text:{menu:_('Insert Unnumbered Entry'),},},
-	InsertNonBreakingSpace:{global:{menu:_('~Non-breaking space'),},},
+	InsertNonBreakingSpace:{global:{menu:_('~Non-breaking Space'),},},
 	InsertObjectChart:{global:{context:_('Insert Chart'),menu:_('~Chart...'),},},
 	InsertPageCountField:{text:{menu:_('Page ~Count'),},},
 	InsertPageFooter:{text:{menu:_('Foote~r'),},},
 	InsertPageHeader:{text:{menu:_('He~ader'),},},
 	InsertPageNumberField:{global:{menu:_('~Page Numbers...'),},text:{menu:_('~Page Number'),},},
 	InsertPagebreak:{text:{menu:_('~Page Break'),},},
-	InsertRLM:{global:{menu:_('~Right-to-left mark'),},},
+	InsertRLM:{global:{menu:_('~Right-to-left Mark'),},},
 	InsertRowBreak:{spreadsheet:{menu:_('~Row Break'),},},
 	InsertRowsAfter:{presentation:{menu:_('Insert Row Below'),},spreadsheet:{context:_('Insert Rows ~Below'),menu:_('Rows ~Below'),},text:{menu:_('Rows ~Below'),},},
 	InsertRowsBefore:{presentation:{menu:_('Insert Row Above'),},spreadsheet:{context:_('Insert Rows ~Above'),menu:_('Rows ~Above'),},text:{menu:_('Rows ~Above'),},},
 	InsertRowsMenu:{spreadsheet:{menu:_('Insert ~Rows'),},},
-	InsertSection:{text:{menu:_('~Section...'),},},
+	InsertSection:{text:{menu:_('Se~ction...'),},},
 	InsertSlide:{presentation:{menu:_('~New Slide'),},},
-	InsertSoftHyphen:{global:{menu:_('S~oft hyphen'),},},
+	InsertSoftHyphen:{global:{menu:_('S~oft Hyphen'),},},
 	InsertSymbol:{global:{context:_('Insert Special Character'),menu:_('S~pecial Character...'),},},
 	InsertTimeField:{global:{menu:_('Time Field'),},text:{menu:_('~Time'),},},
 	InsertTitleField:{text:{menu:_('T~itle'),},},
 	InsertTopicField:{text:{menu:_('~Subject'),},},
-	InsertZWNBSP:{global:{menu:_('No-width no ~break'),},},
-	InsertZWSP:{global:{menu:_('No-~width optional break'),},},
+	InsertZWNBSP:{global:{menu:_('No-width No ~Break'),},},
+	InsertZWSP:{global:{menu:_('No-~width Optional Break'),},},
 	Italic:{global:{menu:_('Italic'),},},
 	JumpDownThisLevel:{text:{menu:_('To Next Paragraph in Level'),},},
 	JumpUpThisLevel:{text:{menu:_('To Previous Paragraph in Level'),},},
@@ -152,9 +150,7 @@ var unoCommandsArray = {
 	MoveUpSubItems:{text:{menu:_('Move Up with Subpoints'),},},
 	NextTrackedChange:{text:{menu:_('Next'),},},
 	NumberFormatCurrency:{spreadsheet:{context:_('Format as Currency'),menu:_('Currency'),},text:{menu:_('Number Format: Currency'),},},
-	NumberFormatDate:{spreadsheet:{context:_('Format as Date'),menu:_('Date'),},text:{menu:_('Number Format: Date'),},},
 	NumberFormatDecDecimals:{spreadsheet:{menu:_('Delete Decimal Place'),},},
-	NumberFormatDecimal:{spreadsheet:{context:_('Format as Number'),menu:_('Number'),},text:{menu:_('Number Format: Decimal'),},},
 	NumberFormatIncDecimals:{spreadsheet:{menu:_('Add Decimal Place'),},},
 	NumberFormatPercent:{spreadsheet:{context:_('Format as Percent'),menu:_('Percent'),},text:{menu:_('Number Format: Percent'),},},
 	NumberingStart:{text:{menu:_('Restart Numbering'),},},
@@ -166,15 +162,15 @@ var unoCommandsArray = {
 	OutlineFont:{global:{menu:_('Outline'),},},
 	Overline:{global:{menu:_('Overline'),},},
 	PageDialog:{global:{menu:_('~Page...'),},text:{menu:_('~Page...'),},},
-	PageFormatDialog:{spreadsheet:{menu:_('~Page...'),},},
 	PageDown:{text:{menu:_('Next Page'),},},
-	PageSetup:{presentation:{menu:_('~Page Properties...'),},},
+	PageFormatDialog:{spreadsheet:{menu:_('~Page...'),},},
+	PageSetup:{presentation:{menu:_('Properties...'),},},
 	PageUp:{text:{menu:_('Previous Page'),},},
 	ParaLeftToRight:{global:{menu:_('Left-To-Right'),},},
 	ParaRightToLeft:{global:{menu:_('Right-To-Left'),},},
 	ParagraphDialog:{global:{menu:_('P~aragraph...'),},},
-	ParaspaceDecrease:{global:{menu:_('Decrease Paragraph Spacing'),},},
-	ParaspaceIncrease:{global:{menu:_('Increase Paragraph Spacing'),},},
+	ParaspaceDecrease:{global:{context:_('Decrease Paragraph Spacing'),menu:_('Decrease Paragraph Spacing'),},},
+	ParaspaceIncrease:{global:{context:_('Increase Paragraph Spacing'),menu:_('Increase Paragraph Spacing'),},},
 	Paste:{global:{menu:_('~Paste'),},},
 	PasteSpecialMenu:{global:{menu:_('Paste ~Special'),},},
 	PasteUnformatted:{global:{context:_('~Unformatted Text'),menu:_('Paste Unformatted Text'),},},
@@ -189,7 +185,7 @@ var unoCommandsArray = {
 	RemoveTableOf:{text:{menu:_('Delete index'),},},
 	RenameTable:{spreadsheet:{menu:_('~Rename Sheet...'),},},
 	ReplyComment:{global:{menu:_('Reply Comment'),},},
-	ResetAttributes:{global:{menu:_('~Clear Direct Formatting'),},spreadsheet:{menu:_('Clear ~Direct Formatting'),},text:{menu:_('Clear ~Direct Formatting'),},},
+	ResetAttributes:{global:{menu:_('~Clear Direct Formatting'),},spreadsheet:{context:_('Clear Direct Formatting'),menu:_('Clear ~Direct Formatting'),},text:{context:_('Clear Direct Formatting'),menu:_('Clear ~Direct Formatting'),},},
 	RightPara:{global:{context:_('Align Right'),menu:_('Right'),},},
 	RotateLeft:{text:{menu:_('Rotate 90° ~Left'),},},
 	RotateMenu:{global:{menu:_('Rot~ate'),},},
@@ -198,7 +194,7 @@ var unoCommandsArray = {
 	SaveAs:{global:{menu:_('Save ~As...'),},},
 	SearchDialog:{global:{menu:_('Find & Rep~lace...'),},},
 	SelectAll:{global:{menu:_('Select ~All'),},},
-	SelectTable:{presentation:{menu:_('~Table'),},text:{menu:_('~Table'),},},
+	SelectTable:{presentation:{menu:_('~Select...'),},text:{menu:_('~Table'),},},
 	SendToBack:{global:{menu:_('~Send to Back'),},},
 	SetAnchorAtChar:{text:{menu:_('To ~Character'),},},
 	SetAnchorToChar:{text:{menu:_('As C~haracter'),},},
@@ -208,8 +204,8 @@ var unoCommandsArray = {
 	SetLanguageAllTextMenu:{global:{menu:_('For All Text'),},},
 	SetLanguageParagraphMenu:{global:{menu:_('For Paragraph'),},},
 	SetLanguageSelectionMenu:{global:{menu:_('For Selection'),},},
-	SetOptimalColumnWidth:{spreadsheet:{menu:_('~Optimal Width...'),},text:{menu:_('Optimal Column Width'),},},
-	SetOptimalRowHeight:{spreadsheet:{menu:_('~Optimal Height...'),},text:{menu:_('Optimal Row Height'),},},
+	SetOptimalColumnWidth:{presentation:{menu:_('Optimal Column Width'),},spreadsheet:{menu:_('~Optimal Width...'),},text:{menu:_('Optimal Column Width'),},},
+	SetOptimalRowHeight:{presentation:{menu:_('Optimal Row Height'),},spreadsheet:{menu:_('~Optimal Height...'),},text:{menu:_('Optimal Row Height'),},},
 	Shadowed:{global:{menu:_('Shadow'),},},
 	SheetMenu:{spreadsheet:{menu:_('~Sheet'),},},
 	Show:{spreadsheet:{menu:_('~Show Sheet...'),},},
@@ -231,10 +227,10 @@ var unoCommandsArray = {
 	Strikeout:{global:{menu:_('Strikethrough'),},},
 	SubScript:{global:{menu:_('Subscript'),},text:{menu:_('Subscript'),},},
 	SuperScript:{global:{menu:_('Superscript'),},text:{menu:_('Superscript'),},},
-	TableDeleteMenu:{text:{menu:_('~Delete'),},},
-	TableDialog:{presentation:{menu:_('Ta~ble Properties...'),},text:{menu:_('~Properties...'),},},
-	TableInsertMenu:{text:{menu:_('~Insert'),},},
-	TableMenu:{text:{menu:_('T~able'),},},
+	TableDeleteMenu:{global:{menu:_('~Delete'),},},
+	TableDialog:{presentation:{menu:_('~Properties...'),},text:{menu:_('~Properties...'),},},
+	TableInsertMenu:{global:{menu:_('~Insert'),},},
+	TableMenu:{global:{menu:_('T~able'),},},
 	TableSelectMenu:{text:{menu:_('~Select'),},},
 	TaskPaneInsertPage:{presentation:{menu:_('Insert Slide'),},},
 	TextAlign:{global:{menu:_('Alig~n'),},},
@@ -244,14 +240,15 @@ var unoCommandsArray = {
 	TrackChanges:{text:{menu:_('~Record'),},},
 	TransformDialog:{global:{menu:_('Position and Si~ze...'),},},
 	Underline:{global:{menu:_('Underline'),},},
-	UnderlineDouble:{presentation:{menu:_('Double Underline '),},spreadsheet:{menu:_('Underline: Double'),},text:{menu:_('Double Underline '),},},
+	UnderlineDouble:{global:{menu:_('Double Underline'),},},
 	Undo:{global:{menu:_('~Undo'),},},
 	Ungroup:{global:{menu:_('~Ungroup...'),},},
 	UpSearch:{global:{menu:_('Find Previous'),},},
 	UpdateCurIndex:{text:{context:_('Update index'),menu:_('Current ~Index'),},},
 	Validation:{spreadsheet:{menu:_('~Validity...'),},},
 	ViewMenu:{global:{menu:_('~View'),},},
-	WordCountDialog:{text:{menu:_('~Word Count'),},},
+	Watermark:{text:{menu:_('Watermark...'),},},
+	WordCountDialog:{text:{menu:_('~Word Count...'),},},
 	WrapAnchorOnly:{text:{menu:_('~First Paragraph'),},},
 	WrapContour:{text:{menu:_('~Contour'),},},
 	WrapIdeal:{text:{menu:_('~Optimal Page Wrap'),},},
commit 282228cc494e2bd34011781376344f849281bf5b
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Fri Jan 4 07:12:23 2019 -0500
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    leaflet: pass the dialog ID to close dialogs
    
    Change-Id: If52c75725e115a8ce878f9a823edcd9df12f3a58

diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js
index 86d4b935f..3f5ddbf58 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -263,7 +263,7 @@ L.Control.LokDialog = L.Control.extend({
 		} else if (e.action === 'close') {
 			parent = this._getParentId(e.id);
 			if (parent)
-				this._onDialogChildClose(this._toStrId(parent));
+				this._onDialogChildClose(parent);
 			else
 				this._onDialogClose(e.id, false);
 		}
@@ -612,7 +612,7 @@ L.Control.LokDialog = L.Control.extend({
 	},
 
 	_onDialogChildClose: function(dialogId) {
-		$('#' + dialogId + '-floating').remove();
+		$('#' + this._toStrId(dialogId) + '-floating').remove();
 		// remove any extra height allocated for the parent container
 		var canvasHeight = document.getElementById(dialogId + '-canvas').height;
 		$('#' + dialogId).height(canvasHeight + 'px');
commit 30fb30cff4f418a3ac29b9d19c9297f4278a3a1f
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Wed Dec 26 13:46:15 2018 -0500
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    wsd: use same method to parse json
    
    DynamicStruct is also more recent and is missing
    from older distros and versions of Poco, so avoid
    using it just for that.
    
    Change-Id: I465fbbc4350101d382877bd42a1704e4e7827102

diff --git a/test/httpwstest.cpp b/test/httpwstest.cpp
index 4ca610e0b..8a4f23c38 100644
--- a/test/httpwstest.cpp
+++ b/test/httpwstest.cpp
@@ -2703,11 +2703,13 @@ void HTTPWSTest::testUndoConflict()
         // undo conflict
         response = getResponseString(socket0, "unocommandresult:", testname + "0 ");
         Poco::JSON::Object::Ptr objJSON = parser.parse(response.substr(17)).extract<Poco::JSON::Object::Ptr>();
-        Poco::DynamicStruct dsJSON = *objJSON;
-        CPPUNIT_ASSERT_EQUAL(dsJSON["commandName"].toString(), std::string(".uno:Undo"));
-        CPPUNIT_ASSERT_EQUAL(dsJSON["success"].toString(), std::string("true"));
-        CPPUNIT_ASSERT_EQUAL(dsJSON["result"]["type"].toString(), std::string("long"));
-        CPPUNIT_ASSERT(Poco::strToInt(dsJSON["result"]["value"].toString(), conflict, 10));
+        CPPUNIT_ASSERT_EQUAL(objJSON->get("commandName").toString(), std::string(".uno:Undo"));
+        CPPUNIT_ASSERT_EQUAL(objJSON->get("success").toString(), std::string("true"));
+        CPPUNIT_ASSERT(objJSON->has("result"));
+        const Poco::Dynamic::Var parsedResultJSON = objJSON->get("result");
+        const auto& resultObj = parsedResultJSON.extract<Poco::JSON::Object::Ptr>();
+        CPPUNIT_ASSERT_EQUAL(resultObj->get("type").toString(), std::string("long"));
+        CPPUNIT_ASSERT(Poco::strToInt(resultObj->get("value").toString(), conflict, 10));
         CPPUNIT_ASSERT(conflict > 0); /*UNDO_CONFLICT*/
     }
     catch(const Poco::Exception& exc)
commit 405cf487df6f4f5d9b61eb13726f6ad1d8af5326
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Sat Dec 29 16:46:40 2018 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    loleaflet: fix view document bounds when re-size occurs
    
    Change-Id: I55c00a877f90fd56b0dc4260a332a29ec0ba3ad1

diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js
index c2e90f0c8..9fb9db193 100644
--- a/loleaflet/src/layer/tile/ImpressTileLayer.js
+++ b/loleaflet/src/layer/tile/ImpressTileLayer.js
@@ -29,6 +29,7 @@ L.ImpressTileLayer = L.TileLayer.extend({
 		map.on('AnnotationSave', this.onAnnotationSave, this);
 		map.on('AnnotationScrollUp', this.onAnnotationScrollUp, this);
 		map.on('AnnotationScrollDown', this.onAnnotationScrollDown, this);
+		map.on('resize', this.onResize, this);
 	},
 
 	getAnnotation: function (id) {
@@ -61,6 +62,12 @@ L.ImpressTileLayer = L.TileLayer.extend({
 		}
 	},
 
+	onResize: function () {
+		if (!L.Browser.mobile) {
+			this._map.setView(this._map.getCenter(), this._map.getZoom(), {reset: true});
+		}
+	},
+
 	onAdd: function (map) {
 		L.TileLayer.prototype.onAdd.call(this, map);
 		this._annotations = {};
commit dac9a5761de63b47661572fc2d2d2607c7007e1c
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Sat Dec 22 20:59:12 2018 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    loleaflet: w2toolbar: disable logging info "add"
    
    Change-Id: I74089564483ea575f0dc31f3895321ee7cf9ae5c

diff --git a/loleaflet/js/w2ui-1.5.rc1.js b/loleaflet/js/w2ui-1.5.rc1.js
index d6b0bc19c..023587e95 100644
--- a/loleaflet/js/w2ui-1.5.rc1.js
+++ b/loleaflet/js/w2ui-1.5.rc1.js
@@ -1787,7 +1787,7 @@ w2utils.event = {
         if (!edata.type) { console.log('ERROR: You must specify event type when calling .on() method of '+ this.name); return; }
         if (!handler) { console.log('ERROR: You must specify event handler function when calling .on() method of '+ this.name); return; }
         if (!$.isArray(this.handlers)) this.handlers = [];
-        console.log('add', edata);
+        // console.log('add', edata);
         this.handlers.push({ edata: edata, handler: handler });
     },
 
commit a92ebcacf725bec9acc5c8915b81a827aa6c2762
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Sat Dec 22 16:27:58 2018 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    loleaflet: mobile: fix "Uncaught TypeError: Cannot read property"
    
    'getCenter' of null
    
    Change-Id: Ie02b06c2a2c7362a4271d29fecdcc9ca09328ae2

diff --git a/loleaflet/src/layer/tile/GridLayer.js b/loleaflet/src/layer/tile/GridLayer.js
index afca4f8b4..3fcbbbac5 100644
--- a/loleaflet/src/layer/tile/GridLayer.js
+++ b/loleaflet/src/layer/tile/GridLayer.js
@@ -1159,7 +1159,7 @@ L.GridLayer = L.Layer.extend({
 	},
 
 	_preFetchTiles: function () {
-		if (this._emptyTilesCount > 0) {
+		if (this._emptyTilesCount > 0 || !this._map) {
 			return;
 		}
 		var center = this._map.getCenter();
commit 1e9be7972a765a173bc24a9df442195ddfa3e470
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Sat Dec 22 15:23:04 2018 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    loleaflet: ensure to not show the elements when request main html
    
    Remove all CSS files from server and requests loleaflet.html,
    it should load a blank page, but some elements still rendered
    
    Change-Id: I025c93d9c674be22279dc87f440d321dcf00b79d

diff --git a/loleaflet/html/loleaflet.html.m4 b/loleaflet/html/loleaflet.html.m4
index 358437802..c8cf895c6 100644
--- a/loleaflet/html/loleaflet.html.m4
+++ b/loleaflet/html/loleaflet.html.m4
@@ -86,11 +86,11 @@ ifelse(MOBILEAPP,[true],
         <div id="document-logo"></div>
        </div>
        <!-- Mobile menu toggle button (hamburger/x icon) -->
-       <input id="main-menu-state" type="checkbox" />
+       <input id="main-menu-state" type="checkbox" style="display: none"/>
        <ul id="main-menu" class="sm sm-simple lo-menu"></ul>
        <div id="document-titlebar">
          <div class="document-title">
-           <input id="document-name-input" type="text" disabled="true"/>
+           <input id="document-name-input" type="text" disabled="true" style="display: none"/>
          </div>
        </div>
      </nav>
commit 3b93d5f61b015321c71c07a5054ad8e2ad7207a7
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Dec 21 16:13:08 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    Small conditions refactor 2
    
    Change-Id: I11bb3a2ae2907e9cba46f3339b457812c6d1d246

diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index ab0adaa6b..181c99d1f 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1242,7 +1242,7 @@ public:
             for (auto& it : self->_sessions)
             {
                 std::shared_ptr<ChildSession> session = it.second;
-                if (session && !it.second->isCloseFrame())
+                if (session && !session->isCloseFrame())
                 {
                     session->loKitCallback(type, payload);
                 }
commit 8613f11c7545e9dbf9ec778ca797f593c314fd3b
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Dec 21 15:58:16 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    Small refactor of conditions
    
    Change-Id: Id3884d8385bf1c138eef2909220bfef352b95370

diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 8fd0d54fc..ab0adaa6b 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1242,12 +1242,9 @@ public:
             for (auto& it : self->_sessions)
             {
                 std::shared_ptr<ChildSession> session = it.second;
-                if (session)
+                if (session && !it.second->isCloseFrame())
                 {
-                    if (!it.second->isCloseFrame())
-                    {
-                        session->loKitCallback(type, payload);
-                    }
+                    session->loKitCallback(type, payload);
                 }
             }
             return;
commit d30ade3ff350229b2132d6a6dbb02d948e1ac216
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Nov 21 16:04:10 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    Show progressbar on loading
    
    Change-Id: Id2f6b35843380726e10570c2c3e501921e882b52

diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index f5c63dd08..8fd0d54fc 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1237,6 +1237,21 @@ public:
             self->setDocumentPassword(type);
             return;
         }
+        else if(type == LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE)
+        {
+            for (auto& it : self->_sessions)
+            {
+                std::shared_ptr<ChildSession> session = it.second;
+                if (session)
+                {
+                    if (!it.second->isCloseFrame())
+                    {
+                        session->loKitCallback(type, payload);
+                    }
+                }
+            }
+            return;
+        }
 
         // Broadcast leftover status indicator callbacks to all clients
         self->broadcastCallbackToClients(type, payload);
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 9a7b1dbe0..a5b3abf90 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -710,7 +710,7 @@ L.Socket = L.Class.extend({
 		}
 		else if (textMsg.startsWith('statusindicator:')) {
 			//FIXME: We should get statusindicator when saving too, no?
-			this._map.showBusy(_('Connecting...'), false);
+			this._map.showBusy(_('Connecting...'), true);
 			if (textMsg.startsWith('statusindicator: ready')) {
 				// We're connected: cancel timer and dialog.
 				this.ReconnectCount = 0;
commit db319170ba8153c3e732c09a9e6e6f0402508095
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Dec 17 16:58:42 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    Add 'Share...' to Calc and Impress
    
    Change-Id: I289ff2e557adcb9c1b06adcb8521156d0cb00394

diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index 88a34c64b..8a4477f8f 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -235,6 +235,7 @@ L.Control.Menubar = L.Control.extend({
 			{name: _UNO('.uno:PickList', 'presentation'), id: 'file', type: 'menu', menu: [
 				{name: _UNO('.uno:Save', 'presentation'), id: 'save', type: 'action'},
 				{name: _UNO('.uno:SaveAs', 'presentation'), id: 'saveas', type: 'action'},
+				{name: _('Share...'), id:'shareas', type: 'action'},
 				{name: _UNO('.uno:Print', 'presentation'), id: 'print', type: 'action'},
 				{name: _('See revision history'), id: 'rev-history', type: 'action'},
 				{name: _('Download as'), id: 'downloadas', type: 'menu', menu: [
@@ -322,6 +323,7 @@ L.Control.Menubar = L.Control.extend({
 			{name: _UNO('.uno:PickList', 'spreadsheet'), id: 'file', type: 'menu', menu: [
 				{name: _UNO('.uno:Save', 'spreadsheet'), id: 'save', type: 'action'},
 				{name: _UNO('.uno:SaveAs', 'spreadsheet'), id: 'saveas', type: 'action'},
+				{name: _('Share...'), id:'shareas', type: 'action'},
 				{name: _UNO('.uno:Print', 'spreadsheet'), id: 'print', type: 'action'},
 				{name: _('See revision history'), id: 'rev-history', type: 'action'},
 				{name: _('Download as'), id:'downloadas', type: 'menu', menu: [
commit 6369907b518abf95b43a39f27fe834c12f468e68
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Tue Dec 18 12:59:53 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    When entering the revision history, we attempt to hide the cursor too early.
    
    Change-Id: Id594a71f539354579fb96866e73c40e8788a18db

diff --git a/loleaflet/src/layer/marker/ClipboardContainer.js b/loleaflet/src/layer/marker/ClipboardContainer.js
index b9fc2757b..41aae051d 100644
--- a/loleaflet/src/layer/marker/ClipboardContainer.js
+++ b/loleaflet/src/layer/marker/ClipboardContainer.js
@@ -80,6 +80,10 @@ L.ClipboardContainer = L.Layer.extend({
 	},
 
 	showCursor: function () {
+		if (!this._map._docLayer._cursorMarker) {
+			return;
+		}
+
 		this._map.addLayer(this._map._docLayer._cursorMarker);
 
 		// move the hidden input field with the cursor
@@ -88,6 +92,10 @@ L.ClipboardContainer = L.Layer.extend({
 	},
 
 	hideCursor: function () {
+		if (!this._map._docLayer._cursorMarker) {
+			return;
+		}
+
 		this._map.removeLayer(this._map._docLayer._cursorMarker);
 	},
 
commit ca9bea755ac06a2e08af01a8fc4139c633f098ad
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Sun Dec 16 12:16:25 2018 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    loleaflet: mobile: show 'Paste' toolbar item when ...
    
    the cursor handler is clicked
    
    Change-Id: I455a87c3d9543cd64dc44d11ee1b692a42f9c74d

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index a18ff3961..edd51e0dc 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -107,6 +107,7 @@ L.Map = L.Evented.extend({
 
 		if (L.Browser.mobile) {
 			this._clipboardContainer = L.control.mobileInput().addTo(this);
+			this._clipboardContainer._cursorHandler.on('up', this.tap._onCursorClick, this.tap);
 		} else {
 			this._clipboardContainer = L.clipboardContainer();
 			this.addLayer(this._clipboardContainer);
diff --git a/loleaflet/src/map/handler/Map.Tap.js b/loleaflet/src/map/handler/Map.Tap.js
index 4d0d584fa..5c10a0ef4 100644
--- a/loleaflet/src/map/handler/Map.Tap.js
+++ b/loleaflet/src/map/handler/Map.Tap.js
@@ -20,6 +20,17 @@ L.Map.Tap = L.Handler.extend({
 		L.DomEvent.off(this._map._container, 'touchstart', this._onDown, this);
 	},
 
+	_onCursorClick: function (e) {
+		L.DomEvent.preventDefault(e.originalEvent);
+
+		var state = this._map['stateChangeHandler'].getItemValue('.uno:Paste');
+		if (state !== 'disabled') {
+			L.setOptions(this._toolbar, {item: 'paste'});
+			this._toolbar._pos = this._map.latLngToContainerPoint(this._map._docLayer._visibleCursor.getNorthWest());
+			this._toolbar.addTo(this._map);
+		}
+	},
+
 	_onDown: function (e) {
 		if (!e.touches || !this._map._docLayer) { return; }
 
commit 421545a9cb7c42efbfd2fc25a5bf81365aefa26d
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Sun Dec 16 12:13:35 2018 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    loleaflet: set options to show the Paste toolbar ...
    
    item of the context toolbar
    
    Change-Id: I865083bb93cb2a7309f28e1559c23a9d5c5286e0

diff --git a/loleaflet/src/control/Control.ContextToolbar.js b/loleaflet/src/control/Control.ContextToolbar.js
index a261b4e84..b1a8708ea 100644
--- a/loleaflet/src/control/Control.ContextToolbar.js
+++ b/loleaflet/src/control/Control.ContextToolbar.js
@@ -5,7 +5,8 @@
 
 L.Control.ContextToolbar = L.Control.extend({
 	options: {
-		position: 'topleft'
+		position: 'topleft',
+		item: ''
 	},
 
 	initialize: function (options) {
@@ -16,10 +17,22 @@ L.Control.ContextToolbar = L.Control.extend({
 		if (!this._container) {
 			this._initLayout();
 		}
+		if (this.options.item === 'paste') {
+			this._paste.style.display = '';
+			this._cut.style.display = 'none';
+			this._copy.style.display = 'none';
+		}
+
 		this._container.style.visibility = 'hidden';
 		return this._container;
 	},
 
+	onRemove: function () {
+		this._paste.style.display = '';
+		this._cut.style.display = '';
+		this._copy.style.display = '';
+		this.options.item = '';
+	},
 
 	_initLayout: function () {
 		this._container = L.DomUtil.create('div', 'loleaflet-context-toolbar');
@@ -32,24 +45,25 @@ L.Control.ContextToolbar = L.Control.extend({
 		    tbody = L.DomUtil.create('tbody', '', container),
 		    tr = L.DomUtil.create('tr', '', tbody);
 
-		var cut = L.DomUtil.create(tagTd, 'loleaflet-context-button loleaflet-context-cut', tr);
-		L.DomEvent.on(cut, stopEvents,  L.DomEvent.stopPropagation)
-			.on(cut, onDown, this.onMouseDown, this)
-			.on(cut, onUp, this.onMouseUp, this);
-		var copy = L.DomUtil.create(tagTd, 'loleaflet-context-button loleaflet-context-copy', tr);
-		L.DomEvent.on(copy, stopEvents,  L.DomEvent.stopPropagation)
-			.on(copy, onDown, this.onMouseDown, this)
-			.on(copy, onUp, this.onMouseUp, this);
-		var paste = L.DomUtil.create(tagTd, 'loleaflet-context-button loleaflet-context-paste', tr);
-		L.DomEvent.on(paste, stopEvents,  L.DomEvent.stopPropagation)
-			.on(paste, onDown, this.onMouseDown, this)
-			.on(paste, onUp, this.onMouseUp, this);
+		this._cut = L.DomUtil.create(tagTd, 'loleaflet-context-button loleaflet-context-cut', tr);
+		L.DomEvent.on(this._cut, stopEvents,  L.DomEvent.stopPropagation)
+			.on(this._cut, onDown, this.onMouseDown, this)
+			.on(this._cut, onUp, this.onMouseUp, this);
+		this._copy = L.DomUtil.create(tagTd, 'loleaflet-context-button loleaflet-context-copy', tr);
+		L.DomEvent.on(this._copy, stopEvents,  L.DomEvent.stopPropagation)
+			.on(this._copy, onDown, this.onMouseDown, this)
+			.on(this._copy, onUp, this.onMouseUp, this);
+		this._paste = L.DomUtil.create(tagTd, 'loleaflet-context-button loleaflet-context-paste', tr);
+		L.DomEvent.on(this._paste, stopEvents,  L.DomEvent.stopPropagation)
+			.on(this._paste, onDown, this.onMouseDown, this)
+			.on(this._paste, onUp, this.onMouseUp, this);
 	},
 
 	onAdded: function () {
 		if (this._pos) {
 			var maxBounds = this._map.getPixelBounds();
-			var size = new L.Point(this._container.clientWidth,this._container.clientHeight);
+			var size = L.point(this._container.clientWidth,this._container.clientHeight);
+			this._pos._add(L.point(-size.x / 2, -size.y));
 			var bounds = new L.Bounds(this._pos, this._pos.add(size));
 			if (!maxBounds.contains(bounds)) {
 				var offset = L.point(0, 0);
commit 55bfb01b1e1c41712c4bbbe4ca78bbc47ddde66b
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Sun Dec 16 12:11:07 2018 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    loleaflet: mobile: update new cursor position when ...
    
    the cursor handler is dragged
    
    Change-Id: I96c587098ac5c703dd7e1710e5aa39c6b9b349c6

diff --git a/loleaflet/src/control/Control.MobileInput.js b/loleaflet/src/control/Control.MobileInput.js
index 8fb306202..487b3573a 100644
--- a/loleaflet/src/control/Control.MobileInput.js
+++ b/loleaflet/src/control/Control.MobileInput.js
@@ -17,6 +17,7 @@ L.Control.MobileInput = L.Control.extend({
 			draggable: true
 		});
 
+		this._cursorHandler.on('dragend', this.onDragEnd, this);
 	},
 
 	onAdd: function () {
@@ -24,6 +25,12 @@ L.Control.MobileInput = L.Control.extend({
 		return this._container;
 	},
 
+	onDragEnd: function () {
+		var mousePos = this._map._docLayer._latLngToTwips(this._cursorHandler.getLatLng());
+		this._map._docLayer._postMouseEvent('buttondown', mousePos.x, mousePos.y, 1, 1, 0);
+		this._map._docLayer._postMouseEvent('buttonup', mousePos.x, mousePos.y, 1, 1, 0);
+	},
+
 	onGotFocus: function () {
 		if (this._map._docLayer._cursorMarker) {
 			this._cursorHandler.setLatLng(this._map._docLayer._visibleCursor.getSouthWest());
commit cc6e5c844e1f4a6838bf7ef777ad18404d3d0b3f
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Sun Dec 16 12:08:33 2018 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    loleaflet: mobile: add a cursor handler
    
    Change-Id: Ie569ad2ddba85cb4a3559ae12c8451190460f7a9

diff --git a/loleaflet/css/selectionMarkers.css b/loleaflet/css/selectionMarkers.css
index 91578d99d..ec076e464 100644
--- a/loleaflet/css/selectionMarkers.css
+++ b/loleaflet/css/selectionMarkers.css
@@ -11,3 +11,10 @@
 	height: 44px;
 	background-image: url('images/handle_end.png');
 	}
+
+.leaflet-cursor-handler {
+	margin-left: -12px;
+	width: 25px;
+	height: 41px;
+	background-image: url('images/cursor-handler.png');
+}
diff --git a/loleaflet/images/cursor-handler.png b/loleaflet/images/cursor-handler.png
new file mode 100644
index 000000000..f362715b0
Binary files /dev/null and b/loleaflet/images/cursor-handler.png differ
diff --git a/loleaflet/src/control/Control.MobileInput.js b/loleaflet/src/control/Control.MobileInput.js
index 7887e556e..8fb306202 100644
--- a/loleaflet/src/control/Control.MobileInput.js
+++ b/loleaflet/src/control/Control.MobileInput.js
@@ -9,6 +9,14 @@ L.Control.MobileInput = L.Control.extend({
 
 	initialize: function (options) {
 		L.setOptions(this, options);
+		this._cursorHandler = L.marker(new L.LatLng(0, 0), {
+			icon: L.divIcon({
+				className: 'leaflet-cursor-handler',
+				iconSize: null
+			}),
+			draggable: true
+		});
+
 	},
 
 	onAdd: function () {
@@ -18,7 +26,13 @@ L.Control.MobileInput = L.Control.extend({
 
 	onGotFocus: function () {
 		if (this._map._docLayer._cursorMarker) {
+			this._cursorHandler.setLatLng(this._map._docLayer._visibleCursor.getSouthWest());
 			this._map.addLayer(this._map._docLayer._cursorMarker);
+			if (this._map._docLayer._selections.getLayers().length === 0) {
+				this._map.addLayer(this._cursorHandler);
+			} else {
+				this._map.removeLayer(this._cursorHandler);
+			}
 		}
 	},
 
@@ -26,6 +40,7 @@ L.Control.MobileInput = L.Control.extend({
 		if (this._map._docLayer._cursorMarker) {
 			this._textArea.value = '';
 			this._map.removeLayer(this._map._docLayer._cursorMarker);
+			this._map.removeLayer(this._cursorHandler);
 		}
 	},
 
commit 48ebffaae72a3b1a49195aca78f48660954e27e5
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Sun Dec 16 11:54:23 2018 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    loleaflet: add event listener 'up' of the DOM draggable element
    
    so we can handle the click event too
    
    Change-Id: I6854ce0b7e2c16a2b63fd33f9b9053e4b55e0d49

diff --git a/loleaflet/src/dom/Draggable.js b/loleaflet/src/dom/Draggable.js
index f7aa5b31a..b98f93961 100644
--- a/loleaflet/src/dom/Draggable.js
+++ b/loleaflet/src/dom/Draggable.js
@@ -147,7 +147,7 @@ L.Draggable = L.Evented.extend({
 		this.fire('drag', e);
 	},
 
-	_onUp: function () {
+	_onUp: function (e) {
 		L.DomUtil.removeClass(document.body, 'leaflet-dragging');
 
 		if (this._lastTarget) {
@@ -171,6 +171,8 @@ L.Draggable = L.Evented.extend({
 			this.fire('dragend', {
 				distance: this._newPos.distanceTo(this._startPos)
 			});
+		} else {
+			this.fire('up', {originalEvent: e});
 		}
 
 		this._moving = false;
diff --git a/loleaflet/src/layer/marker/Marker.Drag.js b/loleaflet/src/layer/marker/Marker.Drag.js
index 38d87735a..942aaa7bf 100644
--- a/loleaflet/src/layer/marker/Marker.Drag.js
+++ b/loleaflet/src/layer/marker/Marker.Drag.js
@@ -18,7 +18,8 @@ L.Handler.MarkerDrag = L.Handler.extend({
 		this._draggable.on({
 			dragstart: this._onDragStart,
 			drag: this._onDrag,
-			dragend: this._onDragEnd
+			dragend: this._onDragEnd,
+			up: this._onUp
 		}, this).enable();
 
 		L.DomUtil.addClass(icon, 'leaflet-marker-draggable');
@@ -28,7 +29,8 @@ L.Handler.MarkerDrag = L.Handler.extend({
 		this._draggable.off({
 			dragstart: this._onDragStart,
 			drag: this._onDrag,
-			dragend: this._onDragEnd
+			dragend: this._onDragEnd,
+			up: this._onUp
 		}, this).disable();
 
 		if (this._marker._icon) {
@@ -70,5 +72,9 @@ L.Handler.MarkerDrag = L.Handler.extend({
 		this._marker
 		    .fire('moveend')
 		    .fire('dragend', e);
+	},
+
+	_onUp: function (e) {
+		this._marker.fire('up', e);
 	}
 });
commit a3151e6ccd1af212e534c5bb9b99074f39b16550
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Sun Dec 16 11:49:01 2018 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    loleaflet: fix when the blinking cursor is hidden
    
    Change-Id: I7c816eef37351132d81be8560f6cdd14711572f7

diff --git a/loleaflet/src/control/Control.MobileInput.js b/loleaflet/src/control/Control.MobileInput.js
index 61cf21f6b..7887e556e 100644
--- a/loleaflet/src/control/Control.MobileInput.js
+++ b/loleaflet/src/control/Control.MobileInput.js
@@ -62,6 +62,10 @@ L.Control.MobileInput = L.Control.extend({
 		}
 	},
 
+	hideCursor: function () {
+		this.onLostFocus();
+	},
+
 	_initLayout: function () {
 		var constOff = 'off',
 		stopEvents = 'touchstart touchmove touchend mousedown mousemove mouseout mouseover mouseup mousewheel click scroll',
diff --git a/loleaflet/src/layer/marker/ClipboardContainer.js b/loleaflet/src/layer/marker/ClipboardContainer.js
index 1ae56d7d9..b9fc2757b 100644
--- a/loleaflet/src/layer/marker/ClipboardContainer.js
+++ b/loleaflet/src/layer/marker/ClipboardContainer.js
@@ -87,6 +87,10 @@ L.ClipboardContainer = L.Layer.extend({
 		L.DomUtil.setPosition(this._container, this._map.latLngToLayerPoint(L.latLng(cursorPos)).round());
 	},
 
+	hideCursor: function () {
+		this._map.removeLayer(this._map._docLayer._cursorMarker);
+	},
+
 	_setPos: function (pos) {
 		L.DomUtil.setPosition(this._container, pos);
 	}
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 8eb10b0be..4d0cc213d 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1645,8 +1645,8 @@ L.TileLayer = L.GridLayer.extend({
 		&& !this._isEmptyRectangle(this._visibleCursor)) {
 			this._updateCursorPos();
 		}
-		else if (this._cursorMarker) {
-			this._map.removeLayer(this._cursorMarker);
+		else {
+			this._map._clipboardContainer.hideCursor();
 		}
 	},
 
commit 11bd561efa201c53c7cdc42f56f029a9e562e17e
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Wed Dec 12 22:19:06 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    menubar: Currently we cannot use 'hidden: true' for 'styles'.
    
    When we do, they are never populated & shown.
    
    Change-Id: Ida58035fcdcde7446c206213155b06cf88a61c86

diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 7bdcab507..4646801ab 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -703,7 +703,7 @@ function createToolbar() {
 						e.item.html = undefined;
 					}});
 				}
-			}, hidden: true, mobile: false, tablet: false },
+			}, desktop: true, mobile: false, tablet: false}, // FIXME would be better to start with 'hidden: false' and show it only where necessary, but that currently ends up with never showing 'styles'
 		{type: 'html', id: 'fonts',
 			html: '<select class="fonts-select"><option>Liberation Sans</option></select>',
 			onRefresh: function (edata) {
commit ec316e80cf8c2762d405da543e2e6be4bf245cff
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Wed Dec 12 14:26:54 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    sd menubar: Introduce Character..., Paragraph... and Page Properties...
    
    Change-Id: I043e6af1c903f359d029128d039b0d377ba6111a

diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index df59cf5e1..88a34c64b 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -277,6 +277,10 @@ L.Control.Menubar = L.Control.extend({
                                {uno: '.uno:HeaderAndFooter'}]
 			},
 			{name: _UNO('.uno:FormatMenu', 'presentation'), type: 'menu', menu: [
+				{uno: '.uno:FontDialog'},
+				{uno: '.uno:ParagraphDialog'},
+				{uno: '.uno:PageSetup'},
+				{type: 'separator'},
 				{uno: '.uno:TransformDialog'},
 				{uno: '.uno:FormatLine'},
 				{uno: '.uno:FormatArea'},
diff --git a/loleaflet/src/unocommands.js b/loleaflet/src/unocommands.js
index bb268778c..b8130c4c0 100644
--- a/loleaflet/src/unocommands.js
+++ b/loleaflet/src/unocommands.js
@@ -168,6 +168,7 @@ var unoCommandsArray = {
 	PageDialog:{global:{menu:_('~Page...'),},text:{menu:_('~Page...'),},},
 	PageFormatDialog:{spreadsheet:{menu:_('~Page...'),},},
 	PageDown:{text:{menu:_('Next Page'),},},
+	PageSetup:{presentation:{menu:_('~Page Properties...'),},},
 	PageUp:{text:{menu:_('Previous Page'),},},
 	ParaLeftToRight:{global:{menu:_('Left-To-Right'),},},
 	ParaRightToLeft:{global:{menu:_('Right-To-Left'),},},
commit b270b4e42c9c711e9bb3fe960cc640934ca21c19
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Wed Dec 12 14:22:09 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    Makefile: Reintroduce the check for missing .uno: commands.
    
    Change-Id: If290ff9878fac6f9100246cad4fbc87b559fc7b7

diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am
index 1bb7e5ed8..2732e1928 100644
--- a/loleaflet/Makefile.am
+++ b/loleaflet/Makefile.am
@@ -148,6 +148,7 @@ LOLEAFLET_PREFIX := $(if $(ENABLE_DEBUG),$(abs_builddir),$(abs_builddir)/build)
 EXTRA_DIST = $(shell find . -type f -not -path './.git/*' | sed 's/.\///')
 
 all-local:
+	$(abs_top_srcdir)/scripts/unocommands.py --check $(abs_top_srcdir)
 	@$(MAKE) node_modules
 	@$(MAKE) build-loleaflet
 
commit 61a2ac2954e4fd3d46b5d94e9a5ec5bb1815ecfe
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Dec 12 19:04:41 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    Use same buttons on tablet like mobile
    
    Change-Id: I50b747a67d17f1cc5380ad375ec796c2ac1c73e9

diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 8909f13e5..7bdcab507 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -669,7 +669,7 @@ function createToolbar() {
 	var toolItems = [
 		{type: 'button',  id: 'closemobile',  img: 'closemobile', desktop: false, mobile: false, tablet: true, hidden: true},
 		{type: 'button',  id: 'save', img: 'save', hint: _UNO('.uno:Save')},
-		{type: 'button',  id: 'print', img: 'print', hint: _UNO('.uno:Print', 'text'), mobile: false},
+		{type: 'button',  id: 'print', img: 'print', hint: _UNO('.uno:Print', 'text'), mobile: false, tablet: false},
 		{type: 'break', id: 'savebreak', mobile: false},
 		{type: 'button',  id: 'undo',  img: 'undo', hint: _UNO('.uno:Undo'), uno: 'Undo', disabled: true, mobile: false},
 		{type: 'button',  id: 'redo',  img: 'redo', hint: _UNO('.uno:Redo'), uno: 'Redo', disabled: true, mobile: false},
@@ -678,7 +678,7 @@ function createToolbar() {
 		{type: 'break', mobile: false},
 		{type: 'menu-radio', id: 'zoom', text: '100%',
 			selected: 'zoom100',
-			mobile: false,
+			mobile: false, tablet: false,
 			items: [
 				{ id: 'zoom50', text: '50%', scale: 6},
 				{ id: 'zoom60', text: '60%', scale: 7},
@@ -691,8 +691,8 @@ function createToolbar() {
 				{ id: 'zoom200', text: '200%', scale: 14}
 			]
 		},
-		{type: 'break', mobile: false},
-		{type: 'html',   id: 'styles',
+		{type: 'break', mobile: false, tablet: false,},
+		{type: 'html', id: 'styles',
 			html: '<select class="styles-select"><option>Default Style</option></select>',
 			onRefresh: function (edata) {
 				if (!edata.item.html) {
@@ -703,8 +703,8 @@ function createToolbar() {
 						e.item.html = undefined;
 					}});
 				}
-			}, mobile: false },
-		{type: 'html',   id: 'fonts',
+			}, hidden: true, mobile: false, tablet: false },
+		{type: 'html', id: 'fonts',
 			html: '<select class="fonts-select"><option>Liberation Sans</option></select>',
 			onRefresh: function (edata) {
 				if (!edata.item.html) {
@@ -728,7 +728,7 @@ function createToolbar() {
 					}});
 				}
 			}, mobile: false},
-		{type: 'break', mobile: false},
+		{type: 'break', mobile: false, tablet: false },
 		{type: 'button',  id: 'bold',  img: 'bold', hint: _UNO('.uno:Bold'), uno: 'Bold'},
 		{type: 'button',  id: 'italic', img: 'italic', hint: _UNO('.uno:Italic'), uno: 'Italic'},
 		{type: 'button',  id: 'underline',  img: 'underline', hint: _UNO('.uno:Underline'), uno: 'Underline'},
@@ -810,7 +810,7 @@ function createToolbar() {
 		{type: 'button',  id: 'insertsymbol', img: 'insertsymbol', hint: _UNO('.uno:InsertSymbol', '', true), uno: 'InsertSymbol'},
 		{type: 'spacer'},
 		{type: 'button',  id: 'edit',  img: 'edit'},
-		{type: 'button',  id: 'fold',  img: 'fold', mobile: false, hidden: true},
+		{type: 'button',  id: 'fold',  img: 'fold', desktop: true, mobile: false, hidden: true},
 		{type: 'button',  id: 'hamburger-tablet',  img: 'hamburger', desktop: false, mobile: false, tablet: true, hidden: true}
 	];
 
@@ -1177,7 +1177,7 @@ function initNormalToolbar(toolItems) {
 				{type: 'button',  id: 'cancelsearch', img: 'cancel', hint: _('Cancel the search'), hidden: true},
 				{type: 'html',  id: 'left'},
 				{type: 'html',  id: 'right'},
-				{type: 'html',    id: 'modifiedstatuslabel', html: '<div id="modifiedstatuslabel" class="loleaflet-font"></div>', mobile:false},
+				{type: 'html',  id: 'modifiedstatuslabel', hidden: true, html: '<div id="modifiedstatuslabel" class="loleaflet-font"></div>', mobile: false, tablet: false},
 				{type: 'break', id: 'modifiedstatuslabelbreak', mobile: false},
 				{type: 'drop', id: 'userlist', img: 'users', hidden: true, html: '<div id="userlist_container"><table id="userlist_table"><tbody></tbody></table>' +
 					'<hr><table class="loleaflet-font" id="editor-btn">' +
@@ -1591,24 +1591,24 @@ function onDocLayerInit() {
 					type: 'html', id: 'RowColSelCount',
 					html: '<div id="RowColSelCount" class="loleaflet-font" title="' + _('Selected range of cells') + '" style="padding: 5px 5px;">    &nbsp</div>'
 				},
-				{type: 'break', id: 'break3'},
+				{type: 'break', id: 'break3', tablet: false},
 				{
-					type: 'html', id: 'InsertMode', mobile: false,
+					type: 'html', id: 'InsertMode', mobile: false, tablet: false,
 					html: '<div id="InsertMode" class="loleaflet-font" title="' + _('Entering text mode') + '" style="padding: 5px 5px;">    &nbsp</div>'
 				},
-				{type: 'break', id: 'break4'},
+				{type: 'break', id: 'break4', tablet: false},
 				{
-					type: 'html', id: 'LanguageStatus', mobile: false,
+					type: 'html', id: 'LanguageStatus', mobile: false, tablet: false,
 					html: '<div id="LanguageStatus" class="loleaflet-font" title="' + _('Text Language') + '" style="padding: 5px 5px;">    &nbsp</div>'
 				},
-				{type: 'break', id: 'break5'},
+				{type: 'break', id: 'break5', tablet: false},
 				{
-					type: 'html', id: 'StatusSelectionMode', mobile: false,
+					type: 'html', id: 'StatusSelectionMode', mobile: false, tablet: false,
 					html: '<div id="StatusSelectionMode" class="loleaflet-font" title="' + _('Selection Mode') + '" style="padding: 5px 5px;">    &nbsp</div>'
 				},
-				{type: 'break', id: 'break8', mobile: false},
+				{type: 'break', id: 'break8', mobile: false, tablet: false},
 				{
-					type: 'html', id: 'StateTableCell', mobile: false,
+					type: 'html', id: 'StateTableCell', mobile: false, tablet: false,
 					html: '<div id="StateTableCell" class="loleaflet-font" title="' + _('Choice of functions') + '" style="padding: 5px 5px;">    &nbsp</div>'
 				},
 				{
@@ -1621,7 +1621,7 @@ function onDocLayerInit() {
 						{id: '512', text: _('Sum')},
 						{id: '8192', text: _('Selection count')},
 						{id: '1', text: _('None')}
-					]
+					], tablet: false
 				},
 				{type: 'break', id: 'break8', mobile: false}
 			]);
@@ -1645,22 +1645,22 @@ function onDocLayerInit() {
 				},
 				{type: 'break', id: 'break2'},
 				{
-					type: 'html', id: 'StateWordCount', mobile: false,
+					type: 'html', id: 'StateWordCount', mobile: false, tablet: false,
 					html: '<div id="StateWordCount" class="loleaflet-font" title="' + _('Word Counter') + '" style="padding: 5px 5px;">    &nbsp</div>'
 				},
-				{type: 'break', id: 'break5', mobile: false},
+				{type: 'break', id: 'break5', mobile: false, tablet: false},
 				{
-					type: 'html', id: 'InsertMode', mobile: false,
+					type: 'html', id: 'InsertMode', mobile: false, tablet: false,
 					html: '<div id="InsertMode" class="loleaflet-font" title="' + _('Entering text mode') + '" style="padding: 5px 5px;">    &nbsp</div>'
 				},
-				{type: 'break', id: 'break6', mobile: false},
+				{type: 'break', id: 'break6', mobile: false, tablet: false},
 				{
-					type: 'html', id: 'StatusSelectionMode', mobile: false,
+					type: 'html', id: 'StatusSelectionMode', mobile: false, tablet: false,
 					html: '<div id="StatusSelectionMode" class="loleaflet-font" title="' + _('Selection Mode') + '" style="padding: 5px 5px;">    &nbsp</div>'
 				},
-				{type: 'break', id: 'break7', mobile: false},
+				{type: 'break', id: 'break7', mobile: false, tablet: false},
 				{
-					type: 'html', id: 'LanguageStatus', mobile: false,
+					type: 'html', id: 'LanguageStatus', mobile: false, tablet: false,
 					html: '<div id="LanguageStatus" class="loleaflet-font" title="' + _('Text Language') + '" style="padding: 5px 5px;">    &nbsp</div>'
 				},
 				{type: 'break', id: 'break8', mobile: false}
@@ -1680,9 +1680,9 @@ function onDocLayerInit() {
 					type: 'html', id: 'PageStatus',
 					html: '<div id="PageStatus" class="loleaflet-font" title="' + _('Number of Slides') + '" style="padding: 5px 5px;">    &nbsp</div>'
 				},
-				{type: 'break', id: 'break2', mobile: false},
+				{type: 'break', id: 'break2', mobile: false, tablet: false},
 				{
-					type: 'html', id: 'LanguageStatus', mobile: false,
+					type: 'html', id: 'LanguageStatus', mobile: false, tablet: false,
 					html: '<div id="LanguageStatus" class="loleaflet-font" title="' + _('Text Language') + '" style="padding: 5px 5px;">    &nbsp</div>'
 				},
 				{type: 'break', id: 'break8', mobile: false}
commit 2e301fa719955e8def63629d0dac61e3ddc6e0ba
Author:     Marco Cecchetti <mrcekets at gmail.com>
AuthorDate: Fri Dec 7 11:19:32 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:40 2019 +0100

    loleaflet: perform graphic moving through TransformDialog
    
    Change-Id: I749c68eac25843b0765ac61458df8b00c56426d1

diff --git a/loleaflet/plugins/path-transform/src/Path.Drag.js b/loleaflet/plugins/path-transform/src/Path.Drag.js
index be74e555c..36acdd8b1 100644
--- a/loleaflet/plugins/path-transform/src/Path.Drag.js
+++ b/loleaflet/plugins/path-transform/src/Path.Drag.js
@@ -365,7 +365,7 @@ var fnInitHook = function() {
 	} else if (this.dragging) {
 		this.dragging.disable();
 	}
-}
+};
 
 L.Path.addInitHook(fnInitHook);
 L.SVGGroup.addInitHook(fnInitHook);
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 19cdd0182..8eb10b0be 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1790,6 +1790,45 @@ L.TileLayer = L.GridLayer.extend({
 		}
 	},
 
+	// Update dragged graphics selection
+	_onGraphicMove: function (e) {
+		if (!e.pos) { return; }
+		var aPos = this._latLngToTwips(e.pos);
+		if (e.type === 'graphicmovestart') {
+			this._graphicMarker.isDragged = true;
+			this._graphicMarker._startPos = aPos;
+		}
+		else if (e.type === 'graphicmoveend') {
+			var deltaPos = aPos.subtract(this._graphicMarker._startPos);
+			var newPos = this._graphicSelectionTwips.min.add(deltaPos);
+			var size = this._graphicSelectionTwips.getSize();
+
+			// try to keep shape inside document
+			if (newPos.x + size.x > this._docWidthTwips)
+				newPos.x = this._docWidthTwips - size.x;
+			if (newPos.x < 0)
+				newPos.x = 0;
+
+			if (newPos.y + size.y > this._docHeightTwips)
+				newPos.y = this._docHeightTwips - size.y;
+			if (newPos.y < 0)
+				newPos.y = 0;
+
+			var param = {
+				TransformPosX: {
+					type: 'long',
+					value: newPos.x
+				},
+				TransformPosY: {
+					type: 'long',
+					value: newPos.y
+				}
+			};
+			this._map.sendUnoCommand('.uno:TransformDialog ', param);
+			this._graphicMarker.isDragged = false;
+		}
+	},
+
 	// Update dragged graphics selection resize.
 	_onGraphicEdit: function (e) {
 		if (!e.pos) { return; }
@@ -2000,7 +2039,7 @@ L.TileLayer = L.GridLayer.extend({
 				return;
 			}
 
-			this._graphicMarker.addEventParent(this._map);
+			this._graphicMarker.on('graphicmovestart graphicmoveend', this._onGraphicMove, this);
 			this._graphicMarker.on('scalestart scaleend', this._onGraphicEdit, this);
 			this._graphicMarker.on('rotatestart rotateend', this._onGraphicRotate, this);
 			this._map.addLayer(this._graphicMarker);
@@ -2008,7 +2047,7 @@ L.TileLayer = L.GridLayer.extend({
 			this._graphicMarker.transform.enable({uniformScaling: !this._isGraphicAngleDivisibleBy90()});
 		}
 		else if (this._graphicMarker) {
-			this._graphicMarker.removeEventParent(this._map);
+			this._graphicMarker.off('graphicmovestart graphicmoveend', this._onGraphicMove, this);
 			this._graphicMarker.off('scalestart scaleend', this._onGraphicEdit, this);
 			this._graphicMarker.off('rotatestart rotateend', this._onGraphicRotate, this);
 			this._graphicMarker.dragging.disable();
diff --git a/loleaflet/src/layer/vector/SVGGroup.js b/loleaflet/src/layer/vector/SVGGroup.js
index af1e16a06..c9548e347 100644
--- a/loleaflet/src/layer/vector/SVGGroup.js
+++ b/loleaflet/src/layer/vector/SVGGroup.js
@@ -24,13 +24,50 @@ L.SVGGroup = L.Layer.extend({
 		var size = L.bounds(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),
 			this._map.latLngToLayerPoint(this._bounds.getSouthEast())).getSize();
 
+		if (doc.lastChild.localName !== 'svg')
+			return;
+
+		L.DomUtil.remove(this._rect._path);
 		this._svg = this._path.appendChild(doc.lastChild);
+		this._svg.setAttribute('opacity', 0);
 		this._svg.setAttribute('width', size.x);
 		this._svg.setAttribute('height', size.y);
-		this._svg.setAttribute('display', 'none');
+		this._svg.setAttribute('pointer-events', 'visiblePainted');
+		this._dragShape = this._svg;
+		L.DomEvent.on(this._svg, 'mousedown', this._onDragStart, this);
+
 		this._update();
 	},
 
+	_onDragStart: function(evt) {
+		if (!this._dragShape)
+			return;
+
+		this._showEmbeddedSVG();
+		L.DomEvent.on(this._dragShape, 'mouseup', this._onDragEnd, this);
+
+		var data = {
+			originalEvent: evt,
+			containerPoint: this._map.mouseEventToContainerPoint(evt)
+		};
+		this.dragging._onDragStart(data);
+
+		var pos = this._map.mouseEventToLatLng(evt);
+		this.fire('graphicmovestart', {pos: pos});
+	},
+
+	_onDragEnd: function(evt) {
+		if (!this._dragShape)
+			return;
+
+		L.DomEvent.off(this._dragShape, 'mouseup', this._onDragEnd, this);
+		this.dragging._onDragEnd(evt);
+
+		this._hideEmbeddedSVG();
+		var pos = this._map.mouseEventToLatLng(evt);
+		this.fire('graphicmoveend', {pos: pos});
+	},
+
 	bringToFront: function () {
 		if (this._renderer) {
 			this._renderer._bringToFront(this);
@@ -63,7 +100,8 @@ L.SVGGroup = L.Layer.extend({
 			this._rect._renderer = this._renderer;
 			L.DomUtil.addClass(this._path, 'leaflet-control-buttons-disabled');
 			this._path.appendChild(this._rect._path);
-			this.addInteractiveTarget(this._rect._path);
+			this._dragShape = this._rect._path;
+			L.DomEvent.on(this._rect._path, 'mousedown', this._onDragStart, this);
 		}
 		this._update();
 	},
@@ -77,6 +115,7 @@ L.SVGGroup = L.Layer.extend({
 
 	removeEmbeddedSVG: function () {
 		if (this._svg) {
+			this._dragShape = null;
 			L.DomUtil.remove(this._svg);
 			delete this._svg;
 			this._update();
@@ -85,7 +124,7 @@ L.SVGGroup = L.Layer.extend({
 
 	_hideEmbeddedSVG: function () {
 		if (this._svg) {
-			this._svg.setAttribute('display', 'none');
+			this._svg.setAttribute('opacity', 0);
 		}
 	},
 
@@ -111,7 +150,7 @@ L.SVGGroup = L.Layer.extend({
 
 	_showEmbeddedSVG: function () {
 		if (this._svg) {
-			this._svg.setAttribute('display', '');
+			this._svg.setAttribute('opacity', 1);
 		}
 	},
 
commit 5375f53ffa8600aa90886a6cd5ad5997022e9079
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Sun Dec 9 19:55:20 2018 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:39 2019 +0100

    loleaflet: calculate offset when intersect max bounds
    
    Change-Id: Ie0252e19b230d40a14b3871cff51e5ba1da57da2

diff --git a/loleaflet/src/control/Control.ContextToolbar.js b/loleaflet/src/control/Control.ContextToolbar.js
index 217b222f8..a261b4e84 100644
--- a/loleaflet/src/control/Control.ContextToolbar.js
+++ b/loleaflet/src/control/Control.ContextToolbar.js
@@ -16,18 +16,11 @@ L.Control.ContextToolbar = L.Control.extend({
 		if (!this._container) {
 			this._initLayout();
 		}
-		if (this._pos) {
-			var maxBounds = this._map.getPixelBounds();
-			var size = new L.Point(this._container.clientWidth,this._container.clientHeight);
-			var bounds = new L.Bounds(this._pos, this._pos.add(size));
-			if (!maxBounds.contains(bounds)) {
-				this._pos._subtract(new L.Point(bounds.max.x - maxBounds.max.x, bounds.max.y - maxBounds.max.y));
-			}
-			L.DomUtil.setPosition(this._container, this._pos);
-		}
+		this._container.style.visibility = 'hidden';
 		return this._container;
 	},
 
+
 	_initLayout: function () {
 		this._container = L.DomUtil.create('div', 'loleaflet-context-toolbar');
 
@@ -53,6 +46,27 @@ L.Control.ContextToolbar = L.Control.extend({
 			.on(paste, onUp, this.onMouseUp, this);
 	},
 
+	onAdded: function () {
+		if (this._pos) {
+			var maxBounds = this._map.getPixelBounds();
+			var size = new L.Point(this._container.clientWidth,this._container.clientHeight);
+			var bounds = new L.Bounds(this._pos, this._pos.add(size));
+			if (!maxBounds.contains(bounds)) {
+				var offset = L.point(0, 0);
+				if (bounds.max.x > maxBounds.max.x) {
+					offset.x = size.x;
+				}
+
+				if (bounds.max.y > maxBounds.max.y) {
+					offset.y = size.y;
+				}
+				this._pos._subtract(offset);
+			}
+			L.DomUtil.setPosition(this._container, this._pos);
+		}
+		this._container.style.visibility = '';
+	},
+
 	onMouseDown: function (e) {
 		L.DomUtil.addClass(e.target || e.srcElement, 'loleaflet-context-down');
 		L.DomEvent.preventDefault(e);
diff --git a/loleaflet/src/control/Control.js b/loleaflet/src/control/Control.js
index 3ca991bff..271072e38 100644
--- a/loleaflet/src/control/Control.js
+++ b/loleaflet/src/control/Control.js
@@ -53,6 +53,10 @@ L.Control = L.Class.extend({
 			corner.appendChild(container);
 		}
 
+		if (this.onAdded) {
+			this.onAdded(this._map);
+		}
+
 		return this;
 	},
 
diff --git a/loleaflet/src/geometry/Bounds.js b/loleaflet/src/geometry/Bounds.js
index 8b3fbfe1b..b1b73ec1d 100644
--- a/loleaflet/src/geometry/Bounds.js
+++ b/loleaflet/src/geometry/Bounds.js
@@ -83,6 +83,12 @@ L.Bounds.prototype = {
 		return xIntersects && yIntersects;
 	},
 
+	toString: function () {
+		return '[' +
+		        this.min.toString() + ', ' +
+		        this.max.toString() + ']';
+	},
+
 	isValid: function () {
 		return !!(this.min && this.max);
 	}
commit b007656e6a40209cafaef4bef2d4bd959f5b0d9d
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Thu Nov 29 16:40:41 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:39 2019 +0100

    Add a test case of SVG export of Writer image
    
    Change-Id: Ic81754d965a89106f50866a148c7ced0be4a3e9a

diff --git a/test/data/non-shape-image.odt b/test/data/non-shape-image.odt
new file mode 100644
index 000000000..0943f2752
Binary files /dev/null and b/test/data/non-shape-image.odt differ
diff --git a/test/data/non_shape_writer_image.svg b/test/data/non_shape_writer_image.svg
new file mode 100644
index 000000000..771ce3c31
--- /dev/null
+++ b/test/data/non_shape_writer_image.svg
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<svg version="1.2" width="95.23mm" height="60.31mm" viewBox="0 0 9523 6031" preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xml:space="preserve">
+ <defs class="EmbeddedBulletChars">
+  <g id="bullet-char-template-57356" transform="scale(0.00048828125,-0.00048828125)">
+   <path d="M 580,1141 L 1163,571 580,0 -4,571 580,1141 Z"/>
+  </g>
+  <g id="bullet-char-template-57354" transform="scale(0.00048828125,-0.00048828125)">
+   <path d="M 8,1128 L 1137,1128 1137,0 8,0 8,1128 Z"/>
+  </g>
+  <g id="bullet-char-template-10146" transform="scale(0.00048828125,-0.00048828125)">
+   <path d="M 174,0 L 602,739 174,1481 1456,739 174,0 Z M 1358,739 L 309,1346 659,739 1358,739 Z"/>
+  </g>
+  <g id="bullet-char-template-10132" transform="scale(0.00048828125,-0.00048828125)">
+   <path d="M 2015,739 L 1276,0 717,0 1260,543 174,543 174,936 1260,936 717,1481 1274,1481 2015,739 Z"/>
+  </g>
+  <g id="bullet-char-template-10007" transform="scale(0.00048828125,-0.00048828125)">
+   <path d="M 0,-2 C -7,14 -16,27 -25,37 L 356,567 C 262,823 215,952 215,954 215,979 228,992 255,992 264,992 276,990 289,987 310,991 331,999 354,1012 L 381,999 492,748 772,1049 836,1024 860,1049 C 881,1039 901,1025 922,1006 886,937 835,863 770,784 769,783 710,716 594,584 L 774,223 C 774,196 753,168 711,139 L 727,119 C 717,90 699,76 672,76 641,76 570,178 457,381 L 164,-76 C 142,-110 111,-127 72,-127 30,-127 9,-110 8,-76 1,-67 -2,-52 -2,-32 -2,-23 -1,-13 0,-2 Z"/>
+  </g>
+  <g id="bullet-char-template-10004" transform="scale(0.00048828125,-0.00048828125)">
+   <path d="M 285,-33 C 182,-33 111,30 74,156 52,228 41,333 41,471 41,549 55,616 82,672 116,743 169,778 240,778 293,778 328,747 346,684 L 369,508 C 377,444 397,411 428,410 L 1163,1116 C 1174,1127 1196,1133 1229,1133 1271,1133 1292,1118 1292,1087 L 1292,965 C 1292,929 1282,901 1262,881 L 442,47 C 390,-6 338,-33 285,-33 Z"/>
+  </g>
+  <g id="bullet-char-template-9679" transform="scale(0.00048828125,-0.00048828125)">
+   <path d="M 813,0 C 632,0 489,54 383,161 276,268 223,411 223,592 223,773 276,916 383,1023 489,1130 632,1184 813,1184 992,1184 1136,1130 1245,1023 1353,916 1407,772 1407,592 1407,412 1353,268 1245,161 1136,54 992,0 813,0 Z"/>
+  </g>
+  <g id="bullet-char-template-8226" transform="scale(0.00048828125,-0.00048828125)">
+   <path d="M 346,457 C 273,457 209,483 155,535 101,586 74,649 74,723 74,796 101,859 155,911 209,963 273,989 346,989 419,989 480,963 531,910 582,859 608,796 608,723 608,648 583,586 532,535 482,483 420,457 346,457 Z"/>
+  </g>
+  <g id="bullet-char-template-8211" transform="scale(0.00048828125,-0.00048828125)">
+   <path d="M -4,459 L 1135,459 1135,606 -4,606 -4,459 Z"/>
+  </g>
+  <g id="bullet-char-template-61548" transform="scale(0.00048828125,-0.00048828125)">
+   <path d="M 173,740 C 173,903 231,1043 346,1159 462,1274 601,1332 765,1332 928,1332 1067,1274 1183,1159 1299,1043 1357,903 1357,740 1357,577 1299,437 1183,322 1067,206 928,148 765,148 601,148 462,206 346,322 231,437 173,577 173,740 Z"/>
+  </g>
+ </defs>
+ <g class="Page">
+  <g class="Graphic">
+   <g>
+    <rect class="BoundingBox" stroke="none" fill="none" x="0" y="0" width="9523" height="6031"/><desc>120</desc>
+    <image x="0" y="0" width="9523" height="6031" preserveAspectRatio="none" xlink:href="data:image/png;base64,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"/>
+   </g>
+  </g>
+ </g>
+</svg>
\ No newline at end of file
diff --git a/test/httpwstest.cpp b/test/httpwstest.cpp
index ee22be827..4ca610e0b 100644
--- a/test/httpwstest.cpp
+++ b/test/httpwstest.cpp
@@ -116,6 +116,7 @@ class HTTPWSTest : public CPPUNIT_NS::TestFixture
     CPPUNIT_TEST(testUndoConflict);
     CPPUNIT_TEST(testRenderShapeSelectionImpress);
     CPPUNIT_TEST(testRenderShapeSelectionWriter);
+    CPPUNIT_TEST(testRenderShapeSelectionWriterImage);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -175,6 +176,7 @@ class HTTPWSTest : public CPPUNIT_NS::TestFixture
     void testUndoConflict();
     void testRenderShapeSelectionImpress();
     void testRenderShapeSelectionWriter();
+    void testRenderShapeSelectionWriterImage();
 
     void loadDoc(const std::string& documentURL, const std::string& testname);
 
@@ -2779,6 +2781,34 @@ void HTTPWSTest::testRenderShapeSelectionWriter()
     }
 }
 
+void HTTPWSTest::testRenderShapeSelectionWriterImage()
+{
+    const char* testname = "testRenderShapeSelectionWriterImage ";
+    try
+    {
+        std::string documentPath, documentURL;
+        getDocumentPathAndURL("non-shape-image.odt", documentPath, documentURL, testname);
+
+        std::shared_ptr<LOOLWebSocket> socket = loadDocAndGetSocket(_uri, documentURL, testname);
+
+        // Select the shape with SHIFT + F4
+        sendKeyPress(socket, 0, 771 | skShift, testname);
+        sendTextFrame(socket, "rendershapeselection mimetype=image/svg+xml", testname);
+        std::vector<char> responseSVG = getResponseMessage(socket, "shapeselectioncontent:", testname);
+        CPPUNIT_ASSERT(!responseSVG.empty());
+        auto it = std::find(responseSVG.begin(), responseSVG.end(),'\n');
+        if (it != responseSVG.end())
+            responseSVG.erase(responseSVG.begin(), ++it);
+
+        const std::vector<char> expectedSVG = helpers::readDataFromFile("non_shape_writer_image.svg");
+        CPPUNIT_ASSERT(expectedSVG == responseSVG);
+    }
+    catch (const Poco::Exception& exc)
+    {
+        CPPUNIT_FAIL(exc.displayText());
+    }
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(HTTPWSTest);
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit e394999caad5015294c7973787aca9993b5b1eba
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Nov 16 16:01:04 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:52:39 2019 +0100

    Add test case for SVG export of selected shapes in case of Writer
    
    Change-Id: I96e4e4bb098ea37974d6cc684c9b8170ad72869e

diff --git a/test/data/shape.odt b/test/data/shape.odt
new file mode 100644
index 000000000..aea2e212f
Binary files /dev/null and b/test/data/shape.odt differ
diff --git a/test/data/shape_writer.svg b/test/data/shape_writer.svg
new file mode 100644
index 000000000..8937cb663
--- /dev/null
+++ b/test/data/shape_writer.svg
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<svg version="1.2" width="33.67mm" height="82.62mm" viewBox="7310 6216 3367 8262" preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xml:space="preserve">
+ <defs class="EmbeddedBulletChars">
+  <g id="bullet-char-template-57356" transform="scale(0.00048828125,-0.00048828125)">
+   <path d="M 580,1141 L 1163,571 580,0 -4,571 580,1141 Z"/>
+  </g>
+  <g id="bullet-char-template-57354" transform="scale(0.00048828125,-0.00048828125)">
+   <path d="M 8,1128 L 1137,1128 1137,0 8,0 8,1128 Z"/>
+  </g>
+  <g id="bullet-char-template-10146" transform="scale(0.00048828125,-0.00048828125)">
+   <path d="M 174,0 L 602,739 174,1481 1456,739 174,0 Z M 1358,739 L 309,1346 659,739 1358,739 Z"/>
+  </g>
+  <g id="bullet-char-template-10132" transform="scale(0.00048828125,-0.00048828125)">
+   <path d="M 2015,739 L 1276,0 717,0 1260,543 174,543 174,936 1260,936 717,1481 1274,1481 2015,739 Z"/>
+  </g>
+  <g id="bullet-char-template-10007" transform="scale(0.00048828125,-0.00048828125)">
+   <path d="M 0,-2 C -7,14 -16,27 -25,37 L 356,567 C 262,823 215,952 215,954 215,979 228,992 255,992 264,992 276,990 289,987 310,991 331,999 354,1012 L 381,999 492,748 772,1049 836,1024 860,1049 C 881,1039 901,1025 922,1006 886,937 835,863 770,784 769,783 710,716 594,584 L 774,223 C 774,196 753,168 711,139 L 727,119 C 717,90 699,76 672,76 641,76 570,178 457,381 L 164,-76 C 142,-110 111,-127 72,-127 30,-127 9,-110 8,-76 1,-67 -2,-52 -2,-32 -2,-23 -1,-13 0,-2 Z"/>
+  </g>
+  <g id="bullet-char-template-10004" transform="scale(0.00048828125,-0.00048828125)">
+   <path d="M 285,-33 C 182,-33 111,30 74,156 52,228 41,333 41,471 41,549 55,616 82,672 116,743 169,778 240,778 293,778 328,747 346,684 L 369,508 C 377,444 397,411 428,410 L 1163,1116 C 1174,1127 1196,1133 1229,1133 1271,1133 1292,1118 1292,1087 L 1292,965 C 1292,929 1282,901 1262,881 L 442,47 C 390,-6 338,-33 285,-33 Z"/>
+  </g>
+  <g id="bullet-char-template-9679" transform="scale(0.00048828125,-0.00048828125)">
+   <path d="M 813,0 C 632,0 489,54 383,161 276,268 223,411 223,592 223,773 276,916 383,1023 489,1130 632,1184 813,1184 992,1184 1136,1130 1245,1023 1353,916 1407,772 1407,592 1407,412 1353,268 1245,161 1136,54 992,0 813,0 Z"/>
+  </g>
+  <g id="bullet-char-template-8226" transform="scale(0.00048828125,-0.00048828125)">
+   <path d="M 346,457 C 273,457 209,483 155,535 101,586 74,649 74,723 74,796 101,859 155,911 209,963 273,989 346,989 419,989 480,963 531,910 582,859 608,796 608,723 608,648 583,586 532,535 482,483 420,457 346,457 Z"/>
+  </g>

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list