[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - 40 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:42:26 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 | 72 ++++++++++---------
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 | 40 ++++++----
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 | 16 ++--
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, 588 insertions(+), 138 deletions(-)
New commits:
commit 454f6737b545a3bc00e6d8c30d566ff621149b10
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:33:51 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 9a28f811b914a49e328dcb6e764f563176011482
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:25:32 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 f325b077abae634669a2b6d9d5d815c86217c4be
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:24:51 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 3430adf296e75f8f7ef40959f021d4d85c8f39d2
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:24:42 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 e3a89916b..d5a7a65bf 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
@@ -203,6 +207,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 f4636f98283c7c985eb6289b5f188bcb4ff6f3f8
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:20:50 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 e97683cbd734d459b76580361c0b3fb8841f3eb5
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:20:17 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 4199ece0c..d5ade812e 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 705438016..447a23a90 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 27e236edb4b94f08e277e6e57b1965ae588914ca
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Tue Jan 8 16:16:41 2019 -0400
Commit: Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:17:32 2019 +0100
loleaflet: simplify code to show next and prev tool items
Change-Id: Id6a3f8862b9b4539fa2c47f4c91d0f0f781b1089
diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index d163c5c40..b122ad85b 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -847,14 +847,7 @@ function initMobileToolbar(toolItems) {
onClick(e, e.target);
hideTooltip(this, e.target);
},
- onRefresh: function(e) {
- var docType = map.getDocType();
- if (docType === 'presentation' && (e.target === 'prev' || e.target === 'next')) {
- if (this.get(e.target).hidden === true) {
- this.show(e.target);
- }
- }
-
+ onRefresh: function() {
var showUserList = map['wopi'].HideUserList !== null &&
map['wopi'].HideUserList !== undefined &&
$.inArray('true', map['wopi'].HideUserList) < 0 &&
@@ -1704,6 +1697,7 @@ function onDocLayerInit() {
case 'drawing':
toolbarUp.show('leftpara', 'centerpara', 'rightpara', 'justifypara', 'breakpara', 'linespacing',
'breakspacing', 'defaultbullet', 'defaultnumbering', 'breakbullet', 'inserttable');
+ statusbar.show('prev', 'next');
$('#presentation-toolbar').show();
break;
commit ec5b92c9ff99deb66426d1abbd5ec1d73ccbffaf
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Tue Jan 8 11:23:52 2019 -0400
Commit: Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:15:39 2019 +0100
loleaflet: create only once slide sorter scrollbar
affects performance recreating scrollbar each slide preview
Change-Id: I2e414850b920de69da119dc57310d3960b5a343e
diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js
index c5b24729c..e3a89916b 100644
--- a/loleaflet/src/control/Control.PartsPreview.js
+++ b/loleaflet/src/control/Control.PartsPreview.js
@@ -34,6 +34,7 @@ L.Control.PartsPreview = L.Control.extend({
if (!this._previewInitialized)
{
// make room for the preview
+ var control = this;
var docContainer = this._map.options.documentContainer;
L.DomUtil.addClass(docContainer, 'parts-preview-document');
setTimeout(L.bind(function () {
@@ -43,6 +44,21 @@ L.Control.PartsPreview = L.Control.extend({
var previewContBB = this._partsPreviewCont.getBoundingClientRect();
this._previewContTop = previewContBB.top;
var bottomBound = previewContBB.bottom + previewContBB.height / 2;
+
+ $('#slide-sorter').mCustomScrollbar({
+ axis: 'y',
+ theme: 'dark-thick',
+ scrollInertia: 0,
+ alwaysShowScrollbar: 1,
+ callbacks:{
+ whileScrolling: function() {
+ control._onScroll(this);
+ }
+ }
+ });
+ this._scrollContainer = $('#slide-sorter .mCSB_container').get(0);
+
+ // Create the preview parts
for (var i = 0; i < parts; i++) {
this._previewTiles.push(this._createPreview(i, e.partNames[i], bottomBound));
}
@@ -65,7 +81,7 @@ L.Control.PartsPreview = L.Control.extend({
},
_createPreview: function (i, hashCode, bottomBound) {
- var frame = L.DomUtil.create('div', 'preview-frame', this._partsPreviewCont);
+ var frame = L.DomUtil.create('div', 'preview-frame', this._scrollContainer);
L.DomUtil.create('span', 'preview-helper', frame);
var imgClassName = 'preview-img';
@@ -187,22 +203,6 @@ L.Control.PartsPreview = L.Control.extend({
_updatePreview: function (e) {
if (this._map.getDocType() === 'presentation' || this._map.getDocType() === 'drawing') {
- // the scrollbar has to be re-initialized here else it doesn't work
- // probably a bug from the scrollbar
- var control = this;
- this._previewTiles[e.id].onload = function () {
- $('#slide-sorter').mCustomScrollbar({
- axis: 'y',
- theme: 'dark-thick',
- scrollInertia: 0,
- alwaysShowScrollbar: 1,
- callbacks:{
- whileScrolling: function() {
- control._onScroll(this);
- }
- }
- });
- };
this._previewTiles[e.id].src = e.tile;
}
},
commit 5321622f7f7f3fff1867a190f066a40d4516b2c3
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:10:14 2019 +0100
Hide 'styles' listbox on loading mobile
Change-Id: Ie1a4a6640712536a1dd4319e4a5799794ba80eac
diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index ad1a77e9b..d163c5c40 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -699,7 +699,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) {
@@ -1035,8 +1035,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 c1b9f4c5e2450d4ea8175beb99813534b5b57392
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:10:03 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 9cef5bee9ec60dc18e1a3b718c5dd10141e96da2
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:09:54 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 acd56e1855861f577e9c3e561343753fc4b75eab
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Fri Jan 4 13:02:26 2019 -0400
Commit: Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 22 14:09:47 2019 +0100
loleaflet: avoid fire timer event for each toolbar item
onRefresh is called for each item, so calling show will
queue timer event O(n)
Change-Id: Ice9f4d0a515f6bf56471a8eb1d07e40638a7e020
diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 06f0f4ed0..ad1a77e9b 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -847,11 +847,12 @@ function initMobileToolbar(toolItems) {
onClick(e, e.target);
hideTooltip(this, e.target);
},
- onRefresh: function() {
+ onRefresh: function(e) {
var docType = map.getDocType();
- if (docType === 'presentation') {
- this.show('prev');
- this.show('next');
+ if (docType === 'presentation' && (e.target === 'prev' || e.target === 'next')) {
+ if (this.get(e.target).hidden === true) {
+ this.show(e.target);
+ }
}
var showUserList = map['wopi'].HideUserList !== null &&
commit 2169daa2507d410f24b45a1348bb1c789206f04e
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:01:53 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 991a7a378..2f3710351 100644
--- a/loleaflet/src/unocommands.js
+++ b/loleaflet/src/unocommands.js
@@ -30,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 Formatting'),},},
ContinueNumbering:{text:{menu:_('Continue previous numbering'),},},
ControlCodes:{text:{menu:_('For~matting Marks'),},},
Copy:{global:{menu:_('~Copy'),},},
@@ -61,9 +61,9 @@ var unoCommandsArray = {
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'),},},
@@ -81,10 +81,10 @@ var unoCommandsArray = {
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'),},},
@@ -92,13 +92,13 @@ var unoCommandsArray = {
HideDetail:{global:{menu:_('~Hide Details'),},},
HideRow:{spreadsheet:{context:_('H~ide Rows'),menu:_('H~ide'),},},
HyperlinkDialog:{global:{context:_('Insert Hyperlink'),menu:_('~Hyperlink...'),},},
- IndexesMenu:{text:{menu:_('~Table of Contents and Index'),},},
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...'),},},
+ 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'),},},
@@ -127,7 +127,7 @@ var unoCommandsArray = {
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'),},},
InsertSymbol:{global:{context:_('Insert Special Character'),menu:_('S~pecial Character...'),},},
@@ -162,8 +162,8 @@ 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'),},},
+ PageFormatDialog:{spreadsheet:{menu:_('~Page...'),},},
PageSetup:{presentation:{menu:_('~Page Properties...'),},},
PageUp:{text:{menu:_('Previous Page'),},},
ParaLeftToRight:{global:{menu:_('Left-To-Right'),},},
@@ -247,6 +247,7 @@ var unoCommandsArray = {
UpdateCurIndex:{text:{context:_('Update index'),menu:_('Current ~Index'),},},
Validation:{spreadsheet:{menu:_('~Validity...'),},},
ViewMenu:{global:{menu:_('~View'),},},
+ Watermark:{text:{menu:_('Watermark...'),},},
WordCountDialog:{text:{menu:_('~Word Count'),},},
WrapAnchorOnly:{text:{menu:_('~First Paragraph'),},},
WrapContour:{text:{menu:_('~Contour'),},},
commit e7c9ebbaf675ea5723fb0225170d360a6872aa33
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 13:35:52 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 546e42c8decc75b6f719bf661d258559e3fa9529
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 13:30:46 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 2589aceeb..b2ba3ed70 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 3df58bd0d16ce7bef214a2243dab1c25532b7f17
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 13:30:28 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 7145aec3be4c8208e457c7f95b43b1084a999b28
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 13:30:22 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 83b5af7a56fece5c6e91fc8b7abf1dc0e0a009ea
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 13:30:13 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 fa0cb4cdff3985a5402f1383da085b6850fdcecc
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 13:30:07 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 9814f4906..0e10fcdcf 100644
--- a/loleaflet/html/loleaflet.html.m4
+++ b/loleaflet/html/loleaflet.html.m4
@@ -84,11 +84,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 7d6f9277f74689c18f5872e049cde242a7f4010f
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 13:29:58 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 4df27942be72e389b6d0d79e1376ffd7b5342e51
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 13:29:52 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 0ba13494a370b2a87ce5df2f471b403bc40640c2
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 13:29:28 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 d221b3e9a9a2f492f28be2878eaf1cb32d0be1ae
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 13:27:55 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 6c23cfe22ede2f33292a07de61f6dc5c44373433
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 13:27:35 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 d41b22a2d3534c455013f3857d6b5a83adf1e6bc
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 13:27:04 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 e23befaa16cbbe215c4d9615e79cee9ac0996fde
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 13:26:52 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 dad8156da81a60926d313f3626136c9141a75a40
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 13:26:41 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 0481284e382fdb9e3e41b2439858f16ee8c6812b
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 13:26:34 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 fbdb3ed3bc2f7b39c375ac3e34ceef1738eee559
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 13:26:28 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 b5d79789c31edf880f38aa39d34c0264871de6bd
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 13:26:22 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 562c31746df7ec6d00e8e9f8aaea2a4ed90d76da
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 12:37:19 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 00801b4ac..06f0f4ed0 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -699,7 +699,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 b4fb7459eb24d5353dcff438783eba2d27b230c2
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 12:36:34 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 9f25c9ef5..991a7a378 100644
--- a/loleaflet/src/unocommands.js
+++ b/loleaflet/src/unocommands.js
@@ -164,6 +164,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 5a464ad3979d89abc4764cc9f6228bec7baefd2f
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 12:36:07 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 ed253951c4387b48d405f2a34f1c836060b9d456
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 12:35:42 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 60bb3ad37..00801b4ac 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -665,7 +665,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},
@@ -674,7 +674,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},
@@ -687,8 +687,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) {
@@ -699,8 +699,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) {
@@ -724,7 +724,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'},
@@ -806,7 +806,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}
];
@@ -1179,7 +1179,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">' +
@@ -1593,24 +1593,24 @@ function onDocLayerInit() {
type: 'html', id: 'RowColSelCount',
html: '<div id="RowColSelCount" class="loleaflet-font" title="' + _('Selected range of cells') + '" style="padding: 5px 5px;">  </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;">  </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;">  </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;">  </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;">  </div>'
},
{
@@ -1623,7 +1623,7 @@ function onDocLayerInit() {
{id: '512', text: _('Sum')},
{id: '8192', text: _('Selection count')},
{id: '1', text: _('None')}
- ]
+ ], tablet: false
},
{type: 'break', id: 'break8', mobile: false}
]);
@@ -1647,22 +1647,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;">  </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;">  </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;">  </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;">  </div>'
},
{type: 'break', id: 'break8', mobile: false}
@@ -1682,9 +1682,9 @@ function onDocLayerInit() {
type: 'html', id: 'PageStatus',
html: '<div id="PageStatus" class="loleaflet-font" title="' + _('Number of Slides') + '" style="padding: 5px 5px;">  </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;">  </div>'
},
{type: 'break', id: 'break8', mobile: false}
commit 626aca555158471a05629316ece37675ab2d8fec
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 11:38:20 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 bb73991ff9898981d0070d87f6adfa0ecaefe128
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 11:36:27 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 f57224870bbe4529337b1cd461fb06db515b71ac
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 11:32: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 be6f86db5..2589aceeb 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);
@@ -2769,6 +2771,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 8fa5dec38943cab49d09c87c2689d0a30828f8fc
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 11:32:18 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>
+ <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="com.sun.star.drawing.CustomShape">
+ <g id="id1">
+ <rect class="BoundingBox" stroke="none" fill="none" x="7310" y="6216" width="3367" height="8262"/><desc>150</desc><desc>139</desc><desc>133</desc><desc>132</desc><desc>111</desc>
+ <path fill="rgb(114,159,207)" stroke="none" d="M 7311,14474 L 7311,7057 8151,6218 10673,6218 10673,13633 9832,14474 7311,14474 Z M 7311,6218 L 7311,6218 Z M 10673,14474 L 10673,14474 Z"/><desc>140</desc><desc>139</desc><desc>132</desc><desc>512: XPATHSTROKE_SEQ_BEGIN</desc><desc>132</desc><desc>133</desc><desc>109</desc>
+ <path fill="none" stroke="rgb(52,101,164)" d="M 7311,14474 L 7311,7057 8151,6218 10673,6218 10673,13633 9832,14474 7311,14474 Z"/><desc>512: XPATHSTROKE_SEQ_END</desc><desc>140</desc><desc>139</desc><desc>132</desc><desc>512: XPATHSTROKE_SEQ_BEGIN</desc><desc>132</desc><desc>133</desc><desc>109</desc>
+ <path fill="none" stroke="rgb(52,101,164)" d="M 7311,6218 L 7311,6218 Z"/><desc>512: XPATHSTROKE_SEQ_END</desc><desc>140</desc><desc>139</desc><desc>132</desc><desc>512: XPATHSTROKE_SEQ_BEGIN</desc><desc>132</desc><desc>133</desc><desc>109</desc>
+ <path fill="none" stroke="rgb(52,101,164)" d="M 10673,14474 L 10673,14474 Z"/><desc>512: XPATHSTROKE_SEQ_END</desc><desc>140</desc><desc>139</desc><desc>133</desc><desc>132</desc><desc>111</desc>
+ <path fill="rgb(139,176,217)" stroke="none" d="M 7311,7057 L 8151,6218 10673,6218 9832,7057 7311,7057 Z M 7311,6218 L 7311,6218 Z M 10673,14474 L 10673,14474 Z"/><desc>140</desc><desc>139</desc><desc>132</desc><desc>512: XPATHSTROKE_SEQ_BEGIN</desc><desc>132</desc><desc>133</desc><desc>109</desc>
+ <path fill="none" stroke="rgb(52,101,164)" d="M 7311,7057 L 8151,6218 10673,6218 9832,7057 7311,7057 Z"/><desc>512: XPATHSTROKE_SEQ_END</desc><desc>140</desc><desc>139</desc><desc>132</desc><desc>512: XPATHSTROKE_SEQ_BEGIN</desc><desc>132</desc><desc>133</desc><desc>109</desc>
+ <path fill="none" stroke="rgb(52,101,164)" d="M 7311,6218 L 7311,6218 Z"/><desc>512: XPATHSTROKE_SEQ_END</desc><desc>140</desc><desc>139</desc><desc>132</desc><desc>512: XPATHSTROKE_SEQ_BEGIN</desc><desc>132</desc><desc>133</desc><desc>109</desc>
+ <path fill="none" stroke="rgb(52,101,164)" d="M 10673,14474 L 10673,14474 Z"/><desc>512: XPATHSTROKE_SEQ_END</desc><desc>140</desc><desc>139</desc><desc>133</desc><desc>132</desc><desc>111</desc>
+ <path fill="rgb(91,127,166)" stroke="none" d="M 9832,14474 L 9832,7057 10673,6218 10673,13633 9832,14474 Z M 7311,6218 L 7311,6218 Z M 10673,14474 L 10673,14474 Z"/><desc>140</desc><desc>139</desc><desc>132</desc><desc>512: XPATHSTROKE_SEQ_BEGIN</desc><desc>132</desc><desc>133</desc><desc>109</desc>
+ <path fill="none" stroke="rgb(52,101,164)" d="M 9832,14474 L 9832,7057 10673,6218 10673,13633 9832,14474 Z"/><desc>512: XPATHSTROKE_SEQ_END</desc><desc>140</desc><desc>139</desc><desc>132</desc><desc>512: XPATHSTROKE_SEQ_BEGIN</desc><desc>132</desc><desc>133</desc><desc>109</desc>
+ <path fill="none" stroke="rgb(52,101,164)" d="M 7311,6218 L 7311,6218 Z"/><desc>512: XPATHSTROKE_SEQ_END</desc><desc>140</desc><desc>139</desc><desc>132</desc><desc>512: XPATHSTROKE_SEQ_BEGIN</desc><desc>132</desc><desc>133</desc><desc>109</desc>
+ <path fill="none" stroke="rgb(52,101,164)" d="M 10673,14474 L 10673,14474 Z"/><desc>512: XPATHSTROKE_SEQ_END</desc><desc>140</desc>
+ </g>
+ </g>
+ </g>
+</svg>
\ No newline at end of file
diff --git a/test/data/shapes.svg b/test/data/shapes_impress.svg
similarity index 98%
rename from test/data/shapes.svg
rename to test/data/shapes_impress.svg
index 3cc9e8f18..0cfac22b7 100644
--- a/test/data/shapes.svg
+++ b/test/data/shapes_impress.svg
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg version="1.2" viewBox="3302 4572 20830 8384" 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:presentation="http://sun.com/xmlns/staroffice/presentation" xmlns:smil="http://www.w3.org/2001/SMIL20/" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xml:space="preserve">
+<svg version="1.2" viewBox="3301 4571 20832 8386" 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:presentation="http://sun.com/xmlns/staroffice/presentation" xmlns:smil="http://www.w3.org/2001/SMIL20/" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation: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"/>
diff --git a/test/httpwstest.cpp b/test/httpwstest.cpp
index e86bec22c..be6f86db5 100644
--- a/test/httpwstest.cpp
+++ b/test/httpwstest.cpp
@@ -114,7 +114,8 @@ class HTTPWSTest : public CPPUNIT_NS::TestFixture
CPPUNIT_TEST(testAlertAllUsers);
CPPUNIT_TEST(testViewInfoMsg);
CPPUNIT_TEST(testUndoConflict);
- CPPUNIT_TEST(testRenderShapeSelection);
+ CPPUNIT_TEST(testRenderShapeSelectionImpress);
+ CPPUNIT_TEST(testRenderShapeSelectionWriter);
CPPUNIT_TEST_SUITE_END();
@@ -172,7 +173,8 @@ class HTTPWSTest : public CPPUNIT_NS::TestFixture
void testAlertAllUsers();
void testViewInfoMsg();
void testUndoConflict();
- void testRenderShapeSelection();
+ void testRenderShapeSelectionImpress();
+ void testRenderShapeSelectionWriter();
void loadDoc(const std::string& documentURL, const std::string& testname);
@@ -2712,9 +2714,9 @@ void HTTPWSTest::testUndoConflict()
}
}
-void HTTPWSTest::testRenderShapeSelection()
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list