[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src loleaflet/unocommands.js

2018-02-16 Thread Henry Castro
 loleaflet/src/control/Control.Menubar.js |9 +
 loleaflet/unocommands.js |8 
 2 files changed, 17 insertions(+)

New commits:
commit 785fb7e34a16e7d60f13256b306fd74598fea06b
Author: Henry Castro 
Date:   Fri Feb 16 10:23:01 2018 -0400

loleaflet: add "Insert Fields" menu

Field
Page Number
Page Count
Date
Time
Title
Author
Subject

Change-Id: I4360372312abab04c34411bdca317b59c93141c4
Reviewed-on: https://gerrit.libreoffice.org/49866
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 349b7b5f..f2ba32ef 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -64,6 +64,15 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:InsertGraphic', 'text'), id: 
'insertgraphic', type: 'action'},
{name: _UNO('.uno:InsertAnnotation', 'text'), 
id: 'insertcomment', type: 'action'},
{type: 'separator'},
+   {name: _UNO('.uno:InsertField', 'text'), type: 
'menu', menu: [
+   {uno: '.uno:InsertPageNumberField'},
+   {uno: '.uno:InsertPageCountField'},
+   {uno: '.uno:InsertDateField'},
+   {uno: '.uno:InsertTimeField'},
+   {uno: '.uno:InsertTitleField'},
+   {uno: '.uno:InsertAuthorField'},
+   {uno: '.uno:InsertTopicField'}
+   ]},
{name: _UNO('.uno:InsertHeaderFooterMenu', 
'text'), type: 'menu', menu: [
{name: _UNO('.uno:InsertPageHeader', 
'text'), type: 'menu', menu: [
{name: _('All'), disabled: 
true, id: 'insertheader', tag: '_ALL_', uno: '.uno:InsertPageHeader?'}]},
diff --git a/loleaflet/unocommands.js b/loleaflet/unocommands.js
index b11631ce..d537e01c 100644
--- a/loleaflet/unocommands.js
+++ b/loleaflet/unocommands.js
@@ -84,12 +84,15 @@ var unoCommandsArray = {
IncrementLevel:{text:{menu:_('Promote One Level'),},},
IncrementSubLevels:{text:{menu:_('Promote One Level With 
Subpoints'),},},
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'),},},
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'),},},
InsertColumnsMenu:{spreadsheet:{menu:_('Insert Co~lumns'),},},
+   InsertDateField:{text:{menu:_('~Date'),},},
InsertEndnote:{text:{menu:_('~Endnote'),},},
+   InsertField:{text:{menu:_('~Fields'),},},
InsertFootnote:{text:{menu:_('~Footnote'),},},
InsertGraphic:{global:{context:_('Insert 
Image'),menu:_('~Image...'),},},
InsertHardHyphen:{global:{menu:_('Non-br~eaking hyphen'),},},
@@ -101,6 +104,8 @@ var unoCommandsArray = {
InsertNonBreakingSpace:{global:{menu:_('~Non-breaking space'),},},
InsertPageFooter:{text:{menu:_('Foote~r'),},},
InsertPageHeader:{text:{menu:_('He~ader'),},},
+   InsertPageCountField:{text:{menu:_('Page ~Count'),},},
+   InsertPageNumberField:{global:{menu:_('~Page 
Numbers...'),},text:{menu:_('~Page Number'),},},
InsertPagebreak:{text:{menu:_('~Page Break'),},},
InsertRLM:{global:{menu:_('~Right-to-left mark'),},},
InsertRowBreak:{spreadsheet:{menu:_('~Row Break'),},},
@@ -110,6 +115,9 @@ var unoCommandsArray = {
InsertSlide:{presentation:{menu:_('New Slid~e'),},},
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'),},},

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-02-15 Thread Andras Timar
 loleaflet/src/control/Control.Menubar.js |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8c6b75565c4155456420aca8f09dd4671ac17387
Author: Andras Timar 
Date:   Thu Feb 15 21:59:30 2018 +0100

loleaflet: fix Insert Header and Footer menu

Change-Id: I7ba5101c752aeef9f3c5f674bfbb900704333c7f

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 9b3b8a8d..349b7b5f 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -65,9 +65,9 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:InsertAnnotation', 'text'), 
id: 'insertcomment', type: 'action'},
{type: 'separator'},
{name: _UNO('.uno:InsertHeaderFooterMenu', 
'text'), type: 'menu', menu: [
-   {name: _UNO('.uno:InsertPageHeader'), 
type: 'menu', menu: [
+   {name: _UNO('.uno:InsertPageHeader', 
'text'), type: 'menu', menu: [
{name: _('All'), disabled: 
true, id: 'insertheader', tag: '_ALL_', uno: '.uno:InsertPageHeader?'}]},
-   {name: _UNO('.uno:InsertPageFooter'), 
type: 'menu', menu: [
+   {name: _UNO('.uno:InsertPageFooter', 
'text'), type: 'menu', menu: [
{name: _('All'), disabled: 
true, id: 'insertfooter', tag: '_ALL_', uno: '.uno:InsertPageFooter?'}]}
]},
{uno: '.uno:InsertFootnote'},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-02-15 Thread Henry Castro
 loleaflet/src/layer/AnnotationManager.js |   19 ---
 loleaflet/src/layer/marker/Annotation.js |4 +++-
 2 files changed, 7 insertions(+), 16 deletions(-)

New commits:
commit a5250566f98645b2bee03aa86fcf261a5824e9c8
Author: Henry Castro 
Date:   Thu Feb 1 21:43:15 2018 -0400

loleaflet: propagate text selected events to parent element

Change-Id: I9b88c42b6bf40dfe856e92f345633855234c7a5d
Reviewed-on: https://gerrit.libreoffice.org/49126
Reviewed-by: Jan Holesovsky 
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/loleaflet/src/layer/AnnotationManager.js 
b/loleaflet/src/layer/AnnotationManager.js
index c3e9b9a2..5636456b 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -70,15 +70,9 @@ L.AnnotationManager = L.Class.extend({
weight: 2,
opacity: 0.25
});
+   comment.textSelected.addEventParent(this._map);
L.DomEvent.on(comment.textSelected, 'contextmenu', 
L.DomEvent.preventDefault);
-   comment.textSelected.on('click', function(e) {
-   // Simulate a click at this position in the 
document
-   var latlng = 
this._map.mouseEventToLatLng(e.originalEvent);
-   var pos = 
this._map._docLayer._latLngToTwips(latlng);
-   
this._map._docLayer._postMouseEvent('buttondown', pos.x, pos.y, 1, 1, 0);
-   this._map._docLayer._postMouseEvent('buttonup', 
pos.x, pos.y, 1, 1, 0);
-
-   // Also select this comment
+   comment.textSelected.on('click', function() {
this.selectById(comment.id);
}, this);
}
@@ -108,14 +102,9 @@ L.AnnotationManager = L.Class.extend({
fillOpacity: 0,
opacity: 0
});
+   redline.textSelected.addEventParent(this._map);
L.DomEvent.on(redline.textSelected, 'contextmenu', 
L.DomEvent.preventDefault);
-   redline.textSelected.on('click', function(e) {
-   // Simulate a click at this position in the 
document
-   var latlng = 
this._map.mouseEventToLatLng(e.originalEvent);
-   var pos = 
this._map._docLayer._latLngToTwips(latlng);
-   
this._map._docLayer._postMouseEvent('buttondown', pos.x, pos.y, 1, 1, 0);
-   this._map._docLayer._postMouseEvent('buttonup', 
pos.x, pos.y, 1, 1, 0);
-
+   redline.textSelected.on('click', function() {
this.selectById(redline.id);
}, this);
}
diff --git a/loleaflet/src/layer/marker/Annotation.js 
b/loleaflet/src/layer/marker/Annotation.js
index 9682034d..73c4b560 100644
--- a/loleaflet/src/layer/marker/Annotation.js
+++ b/loleaflet/src/layer/marker/Annotation.js
@@ -37,7 +37,8 @@ L.Annotation = L.Layer.extend({
onRemove: function (map) {
map._panes.popupPane.removeChild(this._container);
if (this._data.textSelected) {
-   this._map.removeLayer(this._data.textSelected);
+   this._data.textSelected.removeEventParent(map);
+   map.removeLayer(this._data.textSelected);
}
this._map = null;
},
@@ -52,6 +53,7 @@ L.Annotation = L.Layer.extend({
 
setData: function (data) {
if (this._data.textSelected) {
+   this._data.textSelected.removeEventParent(this._map);
this._map.removeLayer(this._data.textSelected);
}
this._data = data;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-02-15 Thread Pranav Kant
 loleaflet/src/control/Control.LokDialog.js |   92 ++---
 loleaflet/src/map/handler/Map.Keyboard.js  |9 +-
 2 files changed, 76 insertions(+), 25 deletions(-)

New commits:
commit 8227c6853a4f0b59a84d61ddd537f79232f868dc
Author: Pranav Kant 
Date:   Wed Feb 14 18:11:31 2018 +0530

Use real input element for user input instead of canvas

This allows moving the IME candidate window according to where the
cursor in the lok dialog is.

Change-Id: Icf17f1fc1d3f6af619c8e0037c32109d2b4721fc
(cherry picked from commit 199b582e06a3234a1803553bf5be88c4d462ffc6)
Reviewed-on: https://gerrit.libreoffice.org/49778
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index d30e2411..7b43848b 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -2,7 +2,7 @@
  * L.Control.LokDialog used for displaying LOK dialogs
  */
 
-/* global vex $ map */
+/* global vex $ map L */
 L.Control.LokDialog = L.Control.extend({
 
dialogIdPrefix: 'lokdialog-',
@@ -145,12 +145,7 @@ L.Control.LokDialog = L.Control.extend({
var y = parseInt(rectangle[1]);
var height = parseInt(rectangle[3]);
 
-   var dialogCursor = L.DomUtil.get(strDlgId + 
'-cursor');
-   L.DomUtil.setStyle(dialogCursor, 'height', 
height + 'px');
-   L.DomUtil.setStyle(dialogCursor, 'display', 
this._dialogs[e.id].cursorVisible ? 'block' : 'none');
-   // set the position of the cursor container 
element
-   L.DomUtil.setStyle(this._dialogs[e.id].cursor, 
'left', x + 'px');
-   L.DomUtil.setStyle(this._dialogs[e.id].cursor, 
'top', y + 'px');
+   this._updateDialogCursor(e.id, x, y, height);
}
} else if (e.action === 'title_changed') {
if (e.title && this._dialogs[parseInt(e.id)]) {
@@ -174,7 +169,20 @@ L.Control.LokDialog = L.Control.extend({
this._map.sendUnoCommand(e.uno);
},
 
-   _launchDialogCursor: function(dialogId) {
+   _updateDialogCursor: function(dlgId, x, y, height) {
+   var strDlgId = this._toDlgPrefix(dlgId);
+   var dialogCursor = L.DomUtil.get(strDlgId + '-cursor');
+   L.DomUtil.setStyle(dialogCursor, 'height', height + 'px');
+   L.DomUtil.setStyle(dialogCursor, 'display', 
this._dialogs[dlgId].cursorVisible ? 'block' : 'none');
+   // set the position of the cursor container element
+   L.DomUtil.setStyle(this._dialogs[dlgId].cursor, 'left', x + 
'px');
+   L.DomUtil.setStyle(this._dialogs[dlgId].cursor, 'top', y + 
'px');
+
+   // update the input as well
+   this._updateDialogInput(dlgId);
+   },
+
+   _createDialogCursor: function(dialogId) {
var id = this._toRawDlgId(dialogId);
this._dialogs[id].cursor = L.DomUtil.create('div', 
'leaflet-cursor-container', L.DomUtil.get(dialogId));
var cursor = L.DomUtil.create('div', 'leaflet-cursor 
lokdialog-cursor', this._dialogs[id].cursor);
@@ -182,6 +190,39 @@ L.Control.LokDialog = L.Control.extend({
L.DomUtil.addClass(cursor, 'blinking-cursor');
},
 
+   _createDialogInput: function(dialogId) {
+   var id = this._toRawDlgId(dialogId);
+   var clipDlgContainer = L.DomUtil.create('div', 
'clipboard-container', L.DomUtil.get(dialogId));
+   clipDlgContainer.id = dialogId + '-clipboard-container';
+   var dlgTextArea = L.DomUtil.create('input', 'clipboard', 
clipDlgContainer);
+   dlgTextArea.setAttribute('type', 'text');
+   dlgTextArea.setAttribute('autocorrect', 'off');
+   dlgTextArea.setAttribute('autocapitalize', 'off');
+   dlgTextArea.setAttribute('autocomplete', 'off');
+   dlgTextArea.setAttribute('spellcheck', 'false');
+   this._dialogs[id].input = dlgTextArea;
+
+   return dlgTextArea;
+   },
+
+   _updateDialogInput: function(dlgId) {
+   if (!this._dialogs[dlgId].input)
+   return;
+
+   var strDlgId = this._toDlgPrefix(dlgId);
+   var left = 
parseInt(L.DomUtil.getStyle(this._dialogs[dlgId].cursor, 'left'));
+   var top = 
parseInt(L.DomUtil.getStyle(this._dialogs[dlgId].cursor, 'top'));
+   var dlgContainer = L.DomUtil.get(strDlgId + 
'-clipboard-container');
+   L.DomUtil.setPosition(dlgContainer, new L.Point(left, 

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-02-15 Thread Pranav Kant
 loleaflet/src/layer/tile/TileLayer.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6b6bb753ff532d88addbf7ce9a90191455947dd0
Author: Pranav Kant 
Date:   Fri Feb 9 15:06:06 2018 +0530

loleaflet: IME candidate window pos should be wrt container, not layer

Change-Id: I362fb414d114d64650a6c6ec466d066ea815b333
(cherry picked from commit 2a8159ad759e1eab4b6dfb8d898029a1d16059f4)
Reviewed-on: https://gerrit.libreoffice.org/49776
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index a4b95dbc..7072a848 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1441,7 +1441,7 @@ L.TileLayer = L.GridLayer.extend({
 
// move the hidden input field with the cursor
var clipContainer = 
L.DomUtil.get('doc-clipboard-container');
-   var pos = 
this._map.latLngToLayerPoint(L.latLng(cursorPos)).round();
+   var pos = 
this._map.latLngToContainerPoint(L.latLng(cursorPos)).round();
L.DomUtil.setPosition(clipContainer, pos);
}
else if (this._cursorMarker) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-02-15 Thread Aron Budea
 loleaflet/src/control/Control.Menubar.js |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit c5f88ade7b550c5260dcd431e0eac51f4b34a33d
Author: Aron Budea 
Date:   Thu Feb 15 07:30:14 2018 +0100

loleaflet: add download as RTF option

Change-Id: Id258461ff49bcc6d6a0b1e4df826c184e769c5e1
Reviewed-on: https://gerrit.libreoffice.org/49787
Reviewed-by: pranavk 
Tested-by: pranavk 
(cherry picked from commit 1cfe416559951ad7079a176d4c02de9aa0c1e5fe)
Reviewed-on: https://gerrit.libreoffice.org/49788
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 8ba9d677..9b3b8a8d 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -23,7 +23,8 @@ L.Control.Menubar = L.Control.extend({
{name: _('PDF Document (.pdf)'), id: 
'downloadas-pdf', type: 'action'},
{name: _('ODF text document (.odt)'), 
id: 'downloadas-odt', type: 'action'},
{name: _('Microsoft Word 2003 (.doc)'), 
id: 'downloadas-doc', type: 'action'},
-   {name: _('Microsoft Word (.docx)'), id: 
'downloadas-docx', type: 'action'}]}]
+   {name: _('Microsoft Word (.docx)'), id: 
'downloadas-docx', type: 'action'},
+   {name: _('Rich Text (.rtf)'), id: 
'downloadas-rtf', type: 'action'}]}],
},
{name: _UNO('.uno:EditMenu', 'text'), type: 'menu', 
menu: [
{uno: '.uno:Undo'},
@@ -374,7 +375,7 @@ L.Control.Menubar = L.Control.extend({
allowedReadonlyMenus: ['file', 'downloadas', 'view', 'help'],
 
allowedViewModeActions: [
-   'downloadas-pdf', 'downloadas-odt', 'downloadas-doc', 
'downloadas-docx', // file menu
+   'downloadas-pdf', 'downloadas-odt', 'downloadas-doc', 
'downloadas-docx', 'downloadas-rtf', // file menu
'downloadas-odp', 'downloadas-ppt', 'downloadas-pptx', 
// file menu
'downloadas-ods', 'downloadas-xls', 'downloadas-xlsx', 
// file menu
'fullscreen', 'zoomin', 'zoomout', 'zoomreset', // view 
menu
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-02-09 Thread Pranav Kant
 loleaflet/src/control/Styles.js |   20 
 1 file changed, 20 deletions(-)

New commits:
commit 37df54ec094e4d9d2cc6c81b3199ef65e0e4993b
Author: Pranav Kant 
Date:   Fri Feb 2 18:38:48 2018 +0530

Unused object definition

Change-Id: Idacd860d7d48a555863601a06cd1a2533b93b508
(cherry picked from commit 79c941e819df0a6ed16971a8872aa83b4209de97)
Reviewed-on: https://gerrit.libreoffice.org/49403
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Styles.js b/loleaflet/src/control/Styles.js
index 7cd3febd..5321e788 100644
--- a/loleaflet/src/control/Styles.js
+++ b/loleaflet/src/control/Styles.js
@@ -279,26 +279,6 @@ L.Styles = {
'List 5':'List 5'
},
 
-   // For impress documents, LOK STATE_CHANGED callback return these 
internal names
-   // which are different from what is returned by initial .uno:StyleApply.
-   // Convert these names to our stored internal names before processing
-   impressMapping : {
-   'Titel':'title',
-   'Untertitel':'subtitle',
-   'Gliederung 1':'outline1',
-   'Gliederung 2':'outline2',
-   'Gliederung 3':'outline3',
-   'Gliederung 4':'outline4',
-   'Gliederung 5':'outline5',
-   'Gliederung 6':'outline6',
-   'Gliederung 7':'outline7',
-   'Gliederung 8':'outline8',
-   'Gliederung 9':'outline9',
-   'Hintergrund':'background',
-   'Hintergrundobjekte':'backgroundobjects',
-   'Notizen':'notes'
-   },
-
impressLayout : [
{id: 0, text: 'Title Slide'},
{id: 1, text: 'Title, Content'},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-02-09 Thread Pranav Kant
 loleaflet/src/map/Map.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 84f34aace2190126320966d939acf7a8785828f9
Author: Pranav Kant 
Date:   Fri Feb 2 18:20:10 2018 +0530

Guard this

Change-Id: I8f5824e16ed734a5ed7ae8ad42c1107be2c8a9d2
(cherry picked from commit 02de8cecbfb317c78602b3dca6a148e8149b1091)
Reviewed-on: https://gerrit.libreoffice.org/49402
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 2e9054f4..10f5acfd 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -166,7 +166,7 @@ L.Map = L.Evented.extend({
} else {
this._activate();
}
-   } else {
+   } else if (this._docLayer) {
// remove the comments and changes
this._docLayer.clearAnnotations();
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-02-09 Thread Pranav Kant
 loleaflet/src/layer/tile/CalcTileLayer.js|5 +
 loleaflet/src/layer/tile/ImpressTileLayer.js |6 ++
 loleaflet/src/layer/tile/TileLayer.js|4 
 loleaflet/src/layer/tile/WriterTileLayer.js  |7 +++
 loleaflet/src/map/Map.js |3 +++
 5 files changed, 21 insertions(+), 4 deletions(-)

New commits:
commit 3844cd3a82a09c0a97ab5b27bb9367c288825dc8
Author: Pranav Kant 
Date:   Fri Feb 2 14:42:44 2018 +0530

loleaflet: Remove comments, changes on doc disconnect

Change-Id: Iccad2afe8a8ddf85fd83577c1d1b822724ce318a
(cherry picked from commit ef05eb36e4d4b3d70afc83ca5b267e23e46bf3e4)
(cherry picked from commit db5083b08eaea805173658321b76a26b5d50f481)
Reviewed-on: https://gerrit.libreoffice.org/49135
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index d0296b15..a485746d 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -48,9 +48,7 @@ L.CalcTileLayer = L.TileLayer.extend({
 
clearAnnotations: function () {
for (var tab in this._annotations) {
-   for (var key in this._annotations[tab]) {
-   
this.hideAnnotation(this._annotations[tab][key]);
-   }
+   this.hideAnnotations(tab);
}
this._annotations = {};
},
@@ -99,7 +97,6 @@ L.CalcTileLayer = L.TileLayer.extend({
},
 
hideAnnotations: function (part) {
-
var annotations = this._annotations[part];
for (var key in annotations) {
this.hideAnnotation(annotations[key]);
diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js 
b/loleaflet/src/layer/tile/ImpressTileLayer.js
index b8731417..3e97c11d 100644
--- a/loleaflet/src/layer/tile/ImpressTileLayer.js
+++ b/loleaflet/src/layer/tile/ImpressTileLayer.js
@@ -41,6 +41,12 @@ L.ImpressTileLayer = L.TileLayer.extend({
return null;
},
 
+   clearAnnotations: function() {
+   for (var part in this._partHashes) {
+   this.hideAnnotations(part);
+   }
+   },
+
hideAnnotations: function (part) {
this._selectedAnnotation = undefined;
var annotations = this._annotations[this._partHashes[part]];
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 16ac17b3..0ac34006 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -286,6 +286,10 @@ L.TileLayer = L.GridLayer.extend({
map.fire('statusindicator', {statusType: 'loleafletloaded'});
},
 
+   clearAnnotations: function() {
+   console.debug('Implemented in child  classes');
+   },
+
getEvents: function () {
var events = {
viewreset: this._viewReset,
diff --git a/loleaflet/src/layer/tile/WriterTileLayer.js 
b/loleaflet/src/layer/tile/WriterTileLayer.js
index b88b60b8..6c1a886b 100644
--- a/loleaflet/src/layer/tile/WriterTileLayer.js
+++ b/loleaflet/src/layer/tile/WriterTileLayer.js
@@ -16,6 +16,13 @@ L.WriterTileLayer = L.TileLayer.extend({
}
},
 
+   clearAnnotations: function() {
+   if (this._annotations) {
+   this._annotations.clear();
+   this._annotations.clearChanges();
+   }
+   },
+
onRemove: function (map) {
map.off('updatemaxbounds', this._onUpdateMaxBounds, this);
},
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 6c5d8f71..2e9054f4 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -166,6 +166,9 @@ L.Map = L.Evented.extend({
} else {
this._activate();
}
+   } else {
+   // remove the comments and changes
+   this._docLayer.clearAnnotations();
}
}, this);
},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-02-09 Thread Pranav Kant
 loleaflet/src/control/Control.LokDialog.js |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 7b7a76ad4bbdeda8e0fdc030dd98a040087925ae
Author: Pranav Kant 
Date:   Tue Jan 30 21:56:55 2018 +0530

No context menu on dialog's floating window canvas

Change-Id: Ia6c8cc5d8d198862cf674d43de2937e4a72fdfbb
(cherry picked from commit 497319834e68784490feaf83192b3052a5ff8d66)
Reviewed-on: https://gerrit.libreoffice.org/48916
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 06d6a527..ae9b712c 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -346,6 +346,8 @@ L.Control.LokDialog = L.Control.extend({
L.DomUtil.setStyle(floatingCanvas, 'left', left + 'px'); // 
yes, it's necessary to append 'px'
L.DomUtil.setStyle(floatingCanvas, 'top', top + 'px');
 
+   L.DomEvent.on(floatingCanvas, 'contextmenu', 
L.DomEvent.preventDefault);
+
// attach events
L.DomEvent.on(floatingCanvas, 'mousedown mouseup', function(e) {
var buttons = 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-02-09 Thread Henry Castro
 loleaflet/src/control/Control.Menubar.js  |  120 +-
 loleaflet/src/map/handler/Map.StateChanges.js |4 
 2 files changed, 85 insertions(+), 39 deletions(-)

New commits:
commit 84151ad9945faa11d9a18cfa828e7fd307bcc8c7
Author: Henry Castro 
Date:   Thu Jan 11 13:51:30 2018 -0400

loleaflet: add page styles to header & footer

Change-Id: Iaea6edeb819e2b750148c9ebb62b1acda4d4c951
Reviewed-on: https://gerrit.libreoffice.org/47773
Reviewed-by: Henry Castro 
Tested-by: Henry Castro 
Reviewed-on: https://gerrit.libreoffice.org/48237
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 095ed06c..8ba9d677 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -64,8 +64,11 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:InsertAnnotation', 'text'), 
id: 'insertcomment', type: 'action'},
{type: 'separator'},
{name: _UNO('.uno:InsertHeaderFooterMenu', 
'text'), type: 'menu', menu: [
-   {uno: '.uno:InsertPageHeader'},
-   {uno: '.uno:InsertPageFooter'}]},
+   {name: _UNO('.uno:InsertPageHeader'), 
type: 'menu', menu: [
+   {name: _('All'), disabled: 
true, id: 'insertheader', tag: '_ALL_', uno: '.uno:InsertPageHeader?'}]},
+   {name: _UNO('.uno:InsertPageFooter'), 
type: 'menu', menu: [
+   {name: _('All'), disabled: 
true, id: 'insertfooter', tag: '_ALL_', uno: '.uno:InsertPageFooter?'}]}
+   ]},
{uno: '.uno:InsertFootnote'},
{uno: '.uno:InsertEndnote'},
{type: 'separator'},
@@ -387,6 +390,7 @@ L.Control.Menubar = L.Control.extend({
map.on('doclayerinit', this._onDocLayerInit, this);
map.on('addmenu', this._addMenu, this);
map.on('commandvalues', this._onInitMenu, this);
+   map.on('updatetoolbarcommandvalues', this._onStyleMenu, this);
},
 
_addMenu: function (e) {
@@ -407,19 +411,26 @@ L.Control.Menubar = L.Control.extend({
this._menubarCont.insertBefore(liItem, 
this._menubarCont.firstChild);
},
 
-   _createLangMenuItem: function (lang, command) {
+   _createUnoMenuItem: function (caption, command, tag) {
var liItem, aItem;
liItem = L.DomUtil.create('li', '');
aItem = L.DomUtil.create('a', '', liItem);
-   $(aItem).text(lang);
+   $(aItem).text(caption);
$(aItem).data('type', 'unocommand');
-   $(aItem).data('uno', '.uno:LanguageStatus?Language:string=' + 
command);
+   $(aItem).data('uno', command);
+   $(aItem).data('tag', tag);
return liItem;
},
 
+
_onInitMenu: function (e) {
if (e.commandName === '.uno:LanguageStatus' && 
L.Util.isArray(e.commandValues)) {
-   var resetLang = _('Reset to Default Language'), 
translated, neutral;
+   var translated, neutral;
+   var constDefa = 'Default_RESET_LANGUAGES';
+   var constCurr = 'Current_RESET_LANGUAGES';
+   var constPara = 'Paragraph_RESET_LANGUAGES';
+   var constLang = '.uno:LanguageStatus?Language:string=';
+   var resetLang = _('Reset to Default Language');
var languages  = [];
 
e.commandValues.forEach(function(language) {
@@ -435,16 +446,33 @@ L.Control.Menubar = L.Control.extend({
for (var lang in languages) {
translated = languages[lang].translated;
neutral = languages[lang].neutral;
-   
$menuSelection.append(this._createLangMenuItem(translated, 
encodeURIComponent('Current_' + neutral)));
-   
$menuParagraph.append(this._createLangMenuItem(translated, 
encodeURIComponent('Paragraph_' + neutral)));
-   
$menuDefault.append(this._createLangMenuItem(translated, 
encodeURIComponent('Default_' + neutral)));
+   
$menuSelection.append(this._createUnoMenuItem(translated, constLang + 
encodeURIComponent('Current_' + neutral)));
+   
$menuParagraph.append(this._createUnoMenuItem(translated, 

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-02-09 Thread Andras Timar
 loleaflet/src/control/Control.AlertDialog.js |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 379453f5fbe20f4d280beb4511e07ef75bc69fdb
Author: Andras Timar 
Date:   Fri Feb 9 15:16:08 2018 +0100

fix variable replacement in string

Change-Id: Id99f1e04c508678e0acfc040511e327910e04772
Reviewed-on: https://gerrit.libreoffice.org/49497
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.AlertDialog.js 
b/loleaflet/src/control/Control.AlertDialog.js
index f91fceae..1d9b9e48 100644
--- a/loleaflet/src/control/Control.AlertDialog.js
+++ b/loleaflet/src/control/Control.AlertDialog.js
@@ -26,8 +26,8 @@ L.Control.AlertDialog = L.Control.extend({
return;
} else if (e.cmd && e.kind) {
var msg = _('The server encountered a %0 error while 
parsing the %1 command.');
-   msg.replace('%0', e.kind);
-   msg.replace('%1', e.cmd);
+   msg = msg.replace('%0', e.kind);
+   msg = msg.replace('%1', e.cmd);
vex.dialog.alert(msg);
}
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-02-05 Thread Marco Cecchetti
 loleaflet/src/control/Control.Header.js |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 31d2fc7cb079fc28674d8de8b8770c1e0e923047
Author: Marco Cecchetti 
Date:   Fri Feb 2 12:36:24 2018 +0100

loleaflet: calc: double click on resize area freezes header handling

Change-Id: I05d758ed0cb6cafa5ab14418b82f23b607e4ea95
Reviewed-on: https://gerrit.libreoffice.org/49239
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.Header.js 
b/loleaflet/src/control/Control.Header.js
index ad8edec3..22e176da 100644
--- a/loleaflet/src/control/Control.Header.js
+++ b/loleaflet/src/control/Control.Header.js
@@ -396,6 +396,10 @@ L.Control.Header = L.Control.extend({
if (!this._hitResizeArea)
return;
 
+   var rect = this.getHeaderEntryBoundingClientRect();
+   if (!rect)
+   return;
+
L.DomUtil.disableImageDrag();
L.DomUtil.disableTextSelection();
 
@@ -408,7 +412,7 @@ L.Control.Header = L.Control.extend({
L.DomEvent.on(document, 'mousemove', 
this._onMouseMoveForDragging, this);
L.DomEvent.on(document, 'mouseup', this._onMouseUp, this);
 
-   var rect = this.getHeaderEntryBoundingClientRect();
+
this._start = new L.Point(rect.left, rect.top);
this._offset = new L.Point(rect.right - e.clientX, rect.bottom 
- e.clientY);
this._item = target;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-01-29 Thread Aron Budea
 loleaflet/src/control/Control.RowHeader.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ca0078b55440c3f9791595483ca210ed820c6b5d
Author: Aron Budea 
Date:   Sat Jan 27 19:22:46 2018 +0100

Table row header: use correct uno command

Change-Id: I042b3ce495b77296f29d62899bb048e58f4d552c
Reviewed-on: https://gerrit.libreoffice.org/48750
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.RowHeader.js 
b/loleaflet/src/control/Control.RowHeader.js
index 468359ea..352c0eaf 100644
--- a/loleaflet/src/control/Control.RowHeader.js
+++ b/loleaflet/src/control/Control.RowHeader.js
@@ -56,7 +56,7 @@ L.Control.RowHeader = L.Control.Header.extend({
className: 'loleaflet-font',
items: {
'insertrowabove': {
-   name: _UNO('.uno:InsertRows', 
'spreadsheet', true),
+   name: _UNO('.uno:InsertRowsRowsBefore', 
'spreadsheet', true),
callback: function(key, options) {
var index = 
rowHeaderObj._lastMouseOverIndex;
if (index) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-01-25 Thread Pranav Kant
 loleaflet/src/control/Control.LokDialog.js |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit de8974a8161f5acdcf08ddbf7bde55541b6d4bfb
Author: Pranav Kant 
Date:   Thu Jan 25 21:12:15 2018 +0530

loleaflet: Ignore callbacks without an active dialog

Change-Id: Ie828309b8a3d9201f5e7071884ec7cadf2cacb21
Reviewed-on: https://gerrit.libreoffice.org/48621
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index eac2baf0..06d6a527 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -111,7 +111,13 @@ L.Control.LokDialog = L.Control.extend({
this._createDialogChild(e.id, parentId, top, 
left);
this._sendPaintWindow(e.id, 
this._createRectStr(null, 0, 0, width, height));
}
-   } else if (e.action === 'invalidate') {
+   }
+
+   // all other callbacks doens't make sense without an active 
dialog
+   if (!(this._isOpen(e.id) || this._getParentDialog(e.id)))
+   return;
+
+   if (e.action === 'invalidate') {
var parent = this._getParentDialog(e.id);
var rectangle = e.rectangle;
if (parent) { // this is a floating window
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-01-25 Thread Pranav Kant
 loleaflet/src/control/Control.LokDialog.js |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 3e4a78ccc3410b16fe6b34eea23720f551f53383
Author: Pranav Kant 
Date:   Thu Jan 25 20:02:32 2018 +0530

loleaflet: Don't try to paint if floating window has vanished

Change-Id: I9284c7ec73f6f0e900d3efa2d055eb8b7d5303b2
Reviewed-on: https://gerrit.libreoffice.org/48620
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 95cb64d8..eac2baf0 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -297,7 +297,10 @@ L.Control.LokDialog = L.Control.extend({
_paintDialogChild: function(dialogId, width, height, rectangle, 
imgData) {
var strDlgId = this._toDlgPrefix(dialogId);
var img = new Image();
-   var canvas = document.getElementById(strDlgId + '-floating');
+   var canvas = L.DomUtil.get(strDlgId + '-floating');
+   if (!canvas)
+   return; // no floating window to paint to
+
canvas.width = width;
canvas.height = height;
var ctx = canvas.getContext('2d');
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src loleaflet/unocommands.js

2018-01-24 Thread Michael Meeks
 loleaflet/src/control/Control.Menubar.js |1 +
 loleaflet/unocommands.js |1 +
 2 files changed, 2 insertions(+)

New commits:
commit 01474347ec897b43213703a1dd826432f988b2ac
Author: Michael Meeks 
Date:   Mon Jan 22 16:40:15 2018 +

Add the Thesaurus dialog.

Change-Id: I976ffd46e95dfa675150ee66650f211b2c9f5cdc
Reviewed-on: https://gerrit.libreoffice.org/48537
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 1a458b1b..095ed06c 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -184,6 +184,7 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:ToolsMenu', 'text'), id: 'tools', 
type: 'menu', menu: [
{uno: '.uno:SpellingAndGrammarDialog'},
{uno: '.uno:SpellOnline'},
+   {uno: '.uno:ThesaurusDialog'},
{name: _UNO('.uno:LanguageMenu'), type: 'menu', 
menu: [
{name: 
_UNO('.uno:SetLanguageSelectionMenu', 'text'), type: 'menu', menu: [
{name: _('None (Do not check 
spelling)'), id: 'noneselection', uno: 
'.uno:LanguageStatus?Language:string=Current_LANGUAGE_NONE'}]},
diff --git a/loleaflet/unocommands.js b/loleaflet/unocommands.js
index 14ec0ce6..32221b0f 100644
--- a/loleaflet/unocommands.js
+++ b/loleaflet/unocommands.js
@@ -209,6 +209,7 @@ var unoCommandsArray = {
TableSelectMenu:{text:{menu:_('~Select'),},},
TaskPaneInsertPage:{presentation:{menu:_('Insert Slide'),},},
TextAlign:{global:{menu:_('Alig~n'),},},
+   
ThesaurusDialog:{global:{menu:_('~Thesaurus...'),},text:{menu:_('~Thesaurus...'),},},
ToggleMergeCells:{spreadsheet:{menu:_('M~erge and Center Cells'),},},
ToolsMenu:{global:{menu:_('~Tools'),},},
TrackChanges:{text:{menu:_('~Record'),},},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-01-18 Thread Pranav Kant
 loleaflet/src/control/Control.LokDialog.js |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 525ab5c6c0c72b8a7fcd159e129c41d4adfb2579
Author: Pranav Kant 
Date:   Thu Jan 18 12:27:52 2018 +0530

loleaflet: No native contextmenu options on dialog canvas

Dialogs can have their own context menu invoked upon right click. And
they already works (i.e. are tunneled properly); so, let's use them.

Change-Id: I7d504923c272227dca94058995456d89e1079c29
(cherry picked from commit 63e089ec22150524d040f544538f8455e62a1887)
Reviewed-on: https://gerrit.libreoffice.org/48087
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 21d8a6e5..95cb64d8 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -190,6 +190,8 @@ L.Control.LokDialog = L.Control.extend({
dialogCanvas.contentEditable = true;
dialogCanvas.id = strDlgId + '-canvas';
 
+   L.DomEvent.on(dialogCanvas, 'contextmenu', 
L.DomEvent.preventDefault);
+
var that = this;
$(dialogContainer).dialog({
width: width,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-01-18 Thread Andras Timar
 loleaflet/src/core/Socket.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bd33967ab3f8bae8edfaf70dda6109735fea7987
Author: Andras Timar 
Date:   Wed Jan 17 17:05:30 2018 +0100

fix l10n of this Oops message and use branding, if available

Change-Id: Iaaa3c93d7b025617059e2c8a55195eb67e23f399
Reviewed-on: https://gerrit.libreoffice.org/48065
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 8e2ec804..0d1b 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -34,7 +34,7 @@ L.Socket = L.Class.extend({
try {
this.socket = new WebSocket(map.options.server + 
'/lool/' + encodeURIComponent(map.options.doc + '?' + 
$.param(map.options.docParams)) + '/ws' + wopiSrc);
} catch (e) {
-   this._map.fire('error', {msg: _('Oops, there is a 
problem connecting to LibreOffice Online : ' + e), cmd: 'socket', kind: 
'failed', id: 3});
+   this._map.fire('error', {msg: _('Oops, there is a 
problem connecting to LibreOffice Online : ').replace('LibreOffice Online', 
(typeof brandProductName !== 'undefined' ? brandProductName : 'LibreOffice 
Online')) + e, cmd: 'socket', kind: 'failed', id: 3});
return;
}
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-01-18 Thread Henry Castro
 loleaflet/src/layer/tile/ImpressTileLayer.js |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit d43b656128fc77b7dde191ce686fe5b78770bea0
Author: Henry Castro 
Date:   Wed Jan 17 09:31:26 2018 -0400

loleaflet: fix first top annotation in Impress

Change-Id: I00afba0ab1696c22f910530154c5f7e8b8fef06f
Reviewed-on: https://gerrit.libreoffice.org/48051
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js 
b/loleaflet/src/layer/tile/ImpressTileLayer.js
index e20ff78a..b8731417 100644
--- a/loleaflet/src/layer/tile/ImpressTileLayer.js
+++ b/loleaflet/src/layer/tile/ImpressTileLayer.js
@@ -207,13 +207,17 @@ L.ImpressTileLayer = L.TileLayer.extend({
},
 
layoutAnnotations: function () {
+   var topAnnotation;
var annotations = 
this._annotations[this._partHashes[this._selectedPart]];
var topRight = 
this._map.latLngToLayerPoint(this._map.options.docBounds.getNorthEast())
.add(L.point((this._selectedAnnotation ? 3 : 2) * 
this.options.marginX, this.options.marginY));
-   var topAnnotation = this._topAnnotation[this._selectedPart];
var bounds, annotation;
for (var index in annotations) {
annotation = annotations[index];
+   if (!this._topAnnotation[this._selectedPart]) {
+   this._topAnnotation[this._selectedPart] = 0;
+   }
+   topAnnotation = this._topAnnotation[this._selectedPart];
if (topAnnotation > 0 && parseInt(index) === 
topAnnotation - 1) {
// if the top annotation is not the first one, 
show a bit of the bottom of the previous annotation
// so that the user gets aware that there are 
more annotations above.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-01-17 Thread Michael Meeks
 loleaflet/src/map/handler/Map.Keyboard.js |   16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 035db689b2b2f7401d7abc138f068e2774d69bfa
Author: Michael Meeks 
Date:   Wed Jan 17 10:49:52 2018 +

Ensure we have the docLayer object as 'this' in _postKeyboardEvent.

Interestingly, we can have a 'this' that is not this object, that
means that this._clientVisibleArea is undefined, so page-up/down
don't work.

Fixes regression introduced by d1c8de9bf9021dedb67446439f117b1b64c7e2d9

Change-Id: If83b3542f17c1856af18c5c302e9d566761aeb12
Reviewed-on: https://gerrit.libreoffice.org/48039
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/loleaflet/src/map/handler/Map.Keyboard.js 
b/loleaflet/src/map/handler/Map.Keyboard.js
index 23c55f21..f37d4d87 100644
--- a/loleaflet/src/map/handler/Map.Keyboard.js
+++ b/loleaflet/src/map/handler/Map.Keyboard.js
@@ -242,9 +242,11 @@ L.Map.Keyboard = L.Handler.extend({
return;
}
var docLayer = this._map._docLayer;
+   var eventObject;
if (!postEventFn) {
// default is to post keyboard events on the document
postEventFn = docLayer._postKeyboardEvent;
+   eventObject = docLayer;
}
this.modifier = 0;
var shift = e.originalEvent.shiftKey ? this.keyModifier.shift : 
0;
@@ -315,7 +317,7 @@ L.Map.Keyboard = L.Handler.extend({
if (this.modifier) {
unoKeyCode |= this.modifier;
if (e.type !== 'keyup' && (this.modifier !== shift || 
(keyCode === 32 && !docLayer._isCursorVisible))) {
-   postEventFn.call(this, 'input', charCode, 
unoKeyCode);
+   postEventFn.call(eventObject, 'input', 
charCode, unoKeyCode);
e.originalEvent.preventDefault();
return;
}
@@ -329,7 +331,7 @@ L.Map.Keyboard = L.Handler.extend({
this._bufferedTextInputEvent = null;
 
if (this._handleOnKeyDown(keyCode, 
this.modifier) && charCode === 0) {
-   postEventFn.call(this, 'input', 
charCode, unoKeyCode);
+   postEventFn.call(eventObject, 'input', 
charCode, unoKeyCode);
}
}
else if ((e.type === 'keypress' || e.type === 
'compositionend') &&
@@ -347,10 +349,10 @@ L.Map.Keyboard = L.Handler.extend({
if (e.type === 'compositionend') {
// Set all keycodes to zero
for (var i = 0; i < 
compCharCodes.length; ++i) {
-   postEventFn.call(this, 'input', 
compCharCodes[i], 0);
+   postEventFn.call(eventObject, 
'input', compCharCodes[i], 0);
}
} else {
-   postEventFn.call(this, 'input', 
charCode, unoKeyCode);
+   postEventFn.call(eventObject, 'input', 
charCode, unoKeyCode);
}
 
this._keyHandled = true;
@@ -380,10 +382,10 @@ L.Map.Keyboard = L.Handler.extend({
var textInputData = 
this._bufferedTextInputEvent.originalEvent.data;
charCode = e.originalEvent.keyCode;
for (var i = 0; i < 
textInputData.length; i++) {
-   postEventFn.call(this, 'input', 
textInputData[i].charCodeAt(), 0);
+   postEventFn.call(eventObject, 
'input', textInputData[i].charCodeAt(), 0);
}
}
-   postEventFn.call(this, 'up', charCode, 
unoKeyCode);
+   postEventFn.call(eventObject, 'up', charCode, 
unoKeyCode);
 
this._keyHandled = true;
this._bufferedTextInputEvent = null;
@@ -409,7 +411,7 @@ L.Map.Keyboard = L.Handler.extend({
else if (key in this._panKeys && 
e.originalEvent.shiftKey &&
docLayer._selections.getLayers().length 
!== 0) {
// if there is a selection and the user wants 
to modify it
-   postEventFn.call(this, 'input', charCode, 
unoKeyCode);
+  

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-01-15 Thread Andras Timar
 loleaflet/src/control/Control.Menubar.js |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 9f44565598e6da9d8e2d9efb63c0a47cfb4f1611
Author: Andras Timar 
Date:   Tue Jan 9 10:45:53 2018 +0100

Put checkmark if spell checking language 'None' is selected

Change-Id: Iccbcbce2590b70c115199fcdb57bd5174d9c3a80
Reviewed-on: https://gerrit.libreoffice.org/47639
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 68d6fb9c..1a458b1b 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -538,6 +538,8 @@ L.Control.Menubar = L.Control.extend({
var data = 
decodeURIComponent($(aItem).data('uno'));
if (data.indexOf(lang) !== -1) {

$(aItem).addClass('lo-menu-item-checked');
+   } else if 
(data.indexOf('LANGUAGE_NONE') !== -1 && lang === '[None]') {
+   
$(aItem).addClass('lo-menu-item-checked');
} else {

$(aItem).removeClass('lo-menu-item-checked');
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src loleaflet/unocommands.js

2018-01-15 Thread Andras Timar
 loleaflet/src/control/Control.Menubar.js |   42 ++-
 loleaflet/unocommands.js |1 
 2 files changed, 5 insertions(+), 38 deletions(-)

New commits:
commit d61ce94ebf0d1ed78f1f71423f6ba7d33290b983
Author: Andras Timar 
Date:   Tue Jan 9 10:17:02 2018 +0100

Format - Page... dialog instead of custom Page menus

Change-Id: I7b91505a7f875fa67d4e5214bd697451c4b3c5e2
Reviewed-on: https://gerrit.libreoffice.org/47634
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 353672fd..68d6fb9c 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -157,18 +157,10 @@ L.Control.Menubar = L.Control.extend({
{uno: '.uno:FontDialog'},
{uno: '.uno:ParagraphDialog'},
{uno: '.uno:OutlineBullet'},
+   {uno: '.uno:PageDialog'},
{type: 'separator'},
-   {uno: '.uno:ResetAttributes'},
-   {name: _('Page'), type: 'menu', menu: [
-   {name: 'A4, ' + _('Portrait'), type: 
'action', id: 'a4portrait'},
-   {name: 'A4, ' + _('Landscape'), type: 
'action', id: 'a4landscape'},
-   {name: 'A5, ' + _('Portrait'), type: 
'action', id: 'a5portrait'},
-   {name: 'A5, ' + _('Landscape'), type: 
'action', id: 'a5landscape'},
-   {name: 'Letter, ' + _('Portrait'), 
type: 'action', id: 'letterportrait'},
-   {name: 'Letter, ' + _('Landscape'), 
type: 'action', id: 'letterlandscape'},
-   {name: 'Legal, ' + _('Portrait'), type: 
'action', id: 'legalportrait'},
-   {name: 'Legal, ' + _('Landscape'), 
type: 'action', id: 'legallandscape'}]}]
-   },
+   {uno: '.uno:ResetAttributes'}
+   ]},
{name: _UNO('.uno:TableMenu', 'text'), type: 'menu', 
menu: [
{name: _UNO('.uno:TableInsertMenu', 'text'), 
type: 'menu', menu: [
{uno: '.uno:InsertRowsBefore'},
@@ -658,35 +650,9 @@ L.Control.Menubar = L.Control.extend({
map.fire('postMessage', {msgId: 'close', args: 
{EverModified: map._everModified, Deprecated: true}});
map.fire('postMessage', {msgId: 'UI_Close', args: 
{EverModified: map._everModified}});
map.remove();
-   }
-   else if (id === 'repair') {
+   } else if (id === 'repair') {
map._socket.sendMessage('commandvalues 
command=.uno:DocumentRepair');
-   } else if (id === 'a4portrait') {
-   map.sendUnoCommand('.uno:AttributePageSize 
{"AttributePageSize.Width":{"type":"long", "value": 
"21000"},"AttributePageSize.Height":{"type":"long", "value": "29700"}}');
-   map.sendUnoCommand('.uno:AttributePage 
{"AttributePage.Landscape":{"type":"boolean", "value": "false"}}');
-   } else if (id === 'a4landscape') {
-   map.sendUnoCommand('.uno:AttributePageSize 
{"AttributePageSize.Height":{"type":"long", "value": 
"21000"},"AttributePageSize.Width":{"type":"long", "value": "29700"}}');
-   map.sendUnoCommand('.uno:AttributePage 
{"AttributePage.Landscape":{"type":"boolean", "value": "true"}}');
-   } else if (id === 'a5portrait') {
-   map.sendUnoCommand('.uno:AttributePageSize 
{"AttributePageSize.Width":{"type":"long", "value": 
"14800"},"AttributePageSize.Height":{"type":"long", "value": "21000"}}');
-   map.sendUnoCommand('.uno:AttributePage 
{"AttributePage.Landscape":{"type":"boolean", "value": "false"}}');
-   } else if (id === 'a5landscape') {
-   map.sendUnoCommand('.uno:AttributePageSize 
{"AttributePageSize.Height":{"type":"long", "value": 
"14800"},"AttributePageSize.Width":{"type":"long", "value": "21000"}}');
-   map.sendUnoCommand('.uno:AttributePage 
{"AttributePage.Landscape":{"type":"boolean", "value": "true"}}');
-   } else if (id === 'letterportrait') {
-   map.sendUnoCommand('.uno:AttributePageSize 
{"AttributePageSize.Width":{"type":"long", "value": 
"21950"},"AttributePageSize.Height":{"type":"long", "value": "27940"}}');
-   map.sendUnoCommand('.uno:AttributePage 

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-01-15 Thread Andras Timar
 loleaflet/src/control/Control.Menubar.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4decf25294f636f0b61546f49a99f7066ed0ae6f
Author: Andras Timar 
Date:   Tue Jan 9 09:36:35 2018 +0100

Only show checkmarks in Language -> For selection menu

Change-Id: I420b7f9fd1559fdeeedf8836c09021bee36dcbb6
Reviewed-on: https://gerrit.libreoffice.org/47631
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 89bbc507..353672fd 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -541,7 +541,7 @@ L.Control.Menubar = L.Control.extend({
} else {

$(aItem).removeClass('disabled');
}
-   if 
(unoCommand.indexOf('.uno:LanguageStatus') !== -1) {
+   if 
(unoCommand.indexOf('.uno:LanguageStatus?Language:string=Current_') !== -1) {
var lang = 
map['stateChangeHandler'].getItemValue('.uno:LanguageStatus');
var data = 
decodeURIComponent($(aItem).data('uno'));
if (data.indexOf(lang) !== -1) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-01-15 Thread Pranav Kant
 loleaflet/src/control/Control.LokDialog.js |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 4bf18a7bd2b96311d39abb92f1a9a3826db94515
Author: Pranav Kant 
Date:   Mon Jan 15 16:47:04 2018 +0530

loleaflet: Delay showing of dialog until we have the content

Change-Id: I5d29e64011931fc285191eb713f8cf746dbc6963
(cherry picked from commit 1f410064da480520050a00c5a6507c80e1d272b7)
Reviewed-on: https://gerrit.libreoffice.org/47896
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 82f69130..21d8a6e5 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -202,6 +202,8 @@ L.Control.LokDialog = L.Control.extend({
that._onDialogClose(that._toRawDlgId(strDlgId), 
true);
}
});
+   // don't show the dialog surround until we have the dialog 
content
+   $(dialogContainer).parent().hide();
 
this._dialogs[this._toRawDlgId(strDlgId)] = {
open: true,
@@ -270,6 +272,10 @@ L.Control.LokDialog = L.Control.extend({
}
 
ctx.drawImage(img, x, y);
+
+   // if dialog is hidden, show it
+   var dialogContainer = L.DomUtil.get(strDlgId);
+   $(dialogContainer).parent().show();
};
img.src = imgData;
},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src loleaflet/unocommands.js

2018-01-12 Thread Henry Castro
 loleaflet/src/control/Control.Menubar.js |   27 +--
 loleaflet/unocommands.js |3 +++
 2 files changed, 28 insertions(+), 2 deletions(-)

New commits:
commit 703861538ff2bddb157a4836c995154390df31aa
Author: Henry Castro 
Date:   Fri Jan 12 21:45:45 2018 +0100

loleaflet: add Header/Footer menu

Change-Id: Iabbb3e2a8eadadae2446b572f0e411491af9db4f
Reviewed-on: https://gerrit.libreoffice.org/47829
Reviewed-by: Henry Castro 
Tested-by: Henry Castro 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index c863eeec..ba9b9b30 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -63,6 +63,9 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:InsertGraphic', 'text'), id: 
'insertgraphic', type: 'action'},
{name: _UNO('.uno:InsertAnnotation', 'text'), 
id: 'insertcomment', type: 'action'},
{type: 'separator'},
+   {name: _UNO('.uno:InsertHeaderFooterMenu', 
'text'), type: 'menu', menu: [
+   {uno: '.uno:InsertPageHeader'},
+   {uno: '.uno:InsertPageFooter'}]},
{uno: '.uno:InsertFootnote'},
{uno: '.uno:InsertEndnote'},
{type: 'separator'},
@@ -683,6 +686,27 @@ L.Control.Menubar = L.Control.extend({
}
},
 
+   _sendCommand: function (item) {
+   var unoCommand = $(item).data('uno');
+   if (unoCommand == '.uno:InsertPageHeader' || unoCommand == 
'.uno:InsertPageFooter') {
+   if (map['stateChangeHandler'].getItemValue(unoCommand) 
=== 'true') {
+   vex.dialog.confirm({
+   message: (unoCommand.endsWith('Header') 
? _('Are you sure you want to delete the header?') :
+   _('Are you sure you want to 
delete the footer?')),
+   callback: function(value) {
+   if (value) {
+   
map.sendUnoCommand(unoCommand + '?On:bool=false');
+   }
+   }
+   });
+   } else {
+   map.sendUnoCommand(unoCommand + 
'?On:bool=true');
+   }
+   } else {
+   map.sendUnoCommand(unoCommand);
+   }
+   },
+
_onDeleteSlide: function(e) {
if (e) {
map.deletePage();
@@ -693,8 +717,7 @@ L.Control.Menubar = L.Control.extend({
var self = e.data.self;
var type = $(item).data('type');
if (type === 'unocommand') {
-   var unoCommand = $(item).data('uno');
-   map.sendUnoCommand(unoCommand);
+   self._sendCommand(item);
} else if (type === 'action') {
self._executeAction(item);
}
diff --git a/loleaflet/unocommands.js b/loleaflet/unocommands.js
index fade3dc0..706c7c6a 100644
--- a/loleaflet/unocommands.js
+++ b/loleaflet/unocommands.js
@@ -89,11 +89,14 @@ var unoCommandsArray = {
InsertFootnote:{text:{menu:_('~Footnote'),},},
InsertGraphic:{global:{context:_('Insert 
Image'),menu:_('~Image...'),},},
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'),},},
InsertMenu:{global:{menu:_('~Insert'),},},
InsertNeutralParagraph:{text:{menu:_('Insert Unnumbered Entry'),},},
InsertNonBreakingSpace:{global:{menu:_('~Non-breaking space'),},},
+   InsertPageFooter:{text:{menu:_('Foote~r'),},},
+   InsertPageHeader:{text:{menu:_('He~ader'),},},
InsertPagebreak:{text:{menu:_('~Page Break'),},},
InsertRLM:{global:{menu:_('~Right-to-left mark'),},},
InsertRows:{presentation:{menu:_('Insert 
Row'),},spreadsheet:{menu:_('Rows ~Above'),},text:{menu:_('Insert Row'),},},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-01-09 Thread Jan Holesovsky
 loleaflet/src/control/Toolbar.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 05715547d9548e300e26f60aa671d9fb965dbead
Author: Jan Holesovsky 
Date:   Tue Jan 9 11:47:34 2018 +0100

loleaflet: The document name must not contain spaces.

Change-Id: Icd6815c5644d42c009bb003cecc100527f6ee0a4
Reviewed-on: https://gerrit.libreoffice.org/47648
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 337188a0..6d5e7ae9 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -73,7 +73,7 @@ L.Map.include({
 
this.showBusy(_('Downloading...'), false);
this._socket.sendMessage('downloadas ' +
-   'name=' + name + ' ' +
+   'name=' + encodeURIComponent(name) + ' ' +
'id=' + id + ' ' +
'format=' + format + ' ' +
'options=' + options);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-01-02 Thread Andras Timar
 loleaflet/src/control/Control.DocumentRepair.js |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit f8bf2c28608c139279aaa484603da8cc539ff948
Author: Andras Timar 
Date:   Tue Jan 2 13:00:09 2018 +0100

l10n: localize 'Undo' and 'Redo' labels on Document Repair dialog

Change-Id: Ibd4236f85a6db92b7d6456f6f22115b35079da83
Reviewed-on: https://gerrit.libreoffice.org/47252
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.DocumentRepair.js 
b/loleaflet/src/control/Control.DocumentRepair.js
index f425db7f..bbd3b20b 100644
--- a/loleaflet/src/control/Control.DocumentRepair.js
+++ b/loleaflet/src/control/Control.DocumentRepair.js
@@ -37,6 +37,9 @@ L.Control.DocumentRepair = L.Control.extend({
var tbody = this._tbody = L.DomUtil.create('tbody', '', table);
var tr = L.DomUtil.create('tr', '', tbody);
var th = L.DomUtil.create('th', '', tr);
+   L.DomUtil.setStyle(th, 'display', 'none');
+   th.appendChild(document.createTextNode(''));
+   th = L.DomUtil.create('th', '', tr);
th.appendChild(document.createTextNode(_('Type')));
th = L.DomUtil.create('th', '', tr);
th.appendChild(document.createTextNode(_('Index')));
@@ -59,8 +62,11 @@ L.Control.DocumentRepair = L.Control.extend({
createAction: function (type, index, comment, viewId, dateTime) {
var row = L.DomUtil.create('tr', '', this._tbody);
var td = L.DomUtil.create('td', '', row);
+   L.DomUtil.setStyle(td, 'display', 'none');
td.appendChild(document.createTextNode(type));
td = L.DomUtil.create('td', '', row);
+   td.appendChild(document.createTextNode(_UNO('.uno:'+type)));
+   td = L.DomUtil.create('td', '', row);
td.appendChild(document.createTextNode(index));
td = L.DomUtil.create('td', '', row);
td.appendChild(document.createTextNode(comment));
@@ -125,7 +131,7 @@ L.Control.DocumentRepair = L.Control.extend({
_onJumpClick: function (e) {
if (this._selected) {
var action = this._selected.childNodes[0].innerHTML;
-   var index = 
parseInt(this._selected.childNodes[1].innerHTML);
+   var index = 
parseInt(this._selected.childNodes[2].innerHTML);
var command = {
Repair: {
type: 'boolean',
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-01-02 Thread Pranav Kant
 loleaflet/src/control/Control.LokDialog.js |   41 ++---
 loleaflet/src/layer/tile/TileLayer.js  |   14 -
 loleaflet/src/map/handler/Map.Keyboard.js  |   24 +---
 3 files changed, 17 insertions(+), 62 deletions(-)

New commits:
commit e59ef72e19bf3001fe4dd361531cbc8715609a73
Author: Pranav Kant 
Date:   Sat Dec 23 18:36:28 2017 +0530

loleaflet: Unify dialog key handling logic with document's

Change-Id: I422e813d76df9b52a860a05d09a89362dfb0b616
Reviewed-on: https://gerrit.libreoffice.org/47070
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 4abf350b..82f69130 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -222,7 +222,9 @@ L.Control.LokDialog = L.Control.extend({
this._postWindowMouseEvent(lokEventType, 
this._toRawDlgId(strDlgId), e.offsetX, e.offsetY, 1, buttons, 0);
}, this);
L.DomEvent.on(dialogCanvas, 'keyup keypress keydown', 
function(e) {
-   this._handleDialogKeyEvent(e, 
this._toRawDlgId(strDlgId));
+   // _onKeyDown fn below requires this kind of structure 
but leaflet DomEvent.on doesn't pass it
+   e.originalEvent = e;
+   map['keyboard']._onKeyDown(e, 
L.bind(this._postWindowKeyboardEvent, this, this._toRawDlgId(strDlgId)));
}, this);
L.DomEvent.on(dialogCanvas, 'contextmenu', function() {
return false;
@@ -242,43 +244,6 @@ L.Control.LokDialog = L.Control.extend({
  ' char=' + charcode + ' key=' + 
keycode);
},
 
-   _handleDialogKeyEvent: function(e, winid) {
-   var docLayer = this._map._docLayer;
-   this.modifier = 0;
-   var shift = e.shiftKey ? 
this._map['keyboard'].keyModifier.shift : 0;
-   var ctrl = e.ctrlKey ? this._map['keyboard'].keyModifier.ctrl : 
0;
-   var alt = e.altKey ? this._map['keyboard'].keyModifier.alt : 0;
-   var cmd = e.metaKey ? this._map['keyboard'].keyModifier.ctrl : 
0;
-   var location = e.location;
-   this.modifier = shift | ctrl | alt | cmd;
-
-   var charCode = e.charCode;
-   var keyCode = e.keyCode;
-   var unoKeyCode = this._map['keyboard']._toUNOKeyCode(keyCode);
-
-   if (this.modifier) {
-   unoKeyCode |= this.modifier;
-   if (e.type !== 'keyup') {
-   this._postWindowKeyboardEvent(winid, 'input', 
charCode, unoKeyCode);
-   return;
-   }
-   }
-
-   if (e.type === 'keydown' && 
this._map['keyboard'].handleOnKeyDownKeys[keyCode]) {
-   this._postWindowKeyboardEvent(winid, 'input', charCode, 
unoKeyCode);
-   }
-   else if (e.type === 'keypress' && 
(!this._map['keyboard'].handleOnKeyDownKeys[keyCode] || charCode !== 0)) {
-   if (charCode === keyCode && charCode !== 13) {
-   keyCode = 0;
-   unoKeyCode = 
this._map['keyboard']._toUNOKeyCode(keyCode);
-   }
-   this._postWindowKeyboardEvent(winid, 'input', charCode, 
unoKeyCode);
-   }
-   else if (e.type === 'keyup') {
-   this._postWindowKeyboardEvent(winid, 'up', charCode, 
unoKeyCode);
-   }
-   },
-
_onDialogClose: function(dialogId, notifyBackend) {
if (notifyBackend)
this._sendCloseWindow(dialogId);
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index de0091b5..16ac17b3 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1334,20 +1334,6 @@ L.TileLayer = L.GridLayer.extend({
}
},
 
-   _postKeyboardEvents: function(type, charcodes, keycodes) {
-   // Both are arrays
-   if (typeof(charcodes.length) !== 'number' && 
typeof(keycodes.length) !== 'number')
-   return;
-
-   // both have same length
-   if (charcodes.length !== keycodes.length)
-   return;
-
-   for (var i = 0; i < charcodes.length; i++) {
-   this._postKeyboardEvent(type, charcodes[i], 
keycodes[i]);
-   }
-   },
-
_postKeyboardEvent: function(type, charcode, keycode) {
if (this._docType === 'spreadsheet' && this._prevCellCursor && 
type === 'input') {
   

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-01-02 Thread Pranav Kant
 loleaflet/src/control/Control.LokDialog.js |  137 +
 1 file changed, 63 insertions(+), 74 deletions(-)

New commits:
commit f491dfb13059221cc4a829d01a89424c43cbbeae
Author: Pranav Kant 
Date:   Sat Dec 23 16:12:18 2017 +0530

Clean up; use Leaflet DomUtil API wherever possible

Not possible to use in all the cases while keeping the behavior same.
Need further investigation.

Also rearrange the API a bit in preparation to use the common
Map.Keyboard.js handler to handle key events for both dialog and the
document.

Change-Id: Ifd4ba2a9c1cdda50eb9c41ee43c7f883d71f65b1
Reviewed-on: https://gerrit.libreoffice.org/47068
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 2e1e80b1..0f3dc49f 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -39,12 +39,14 @@ L.Control.LokDialog = L.Control.extend({
$('#' + this._toDlgPrefix(dialogId)).length > 0;
},
 
+   // given a prefixed dialog id like 'lokdialog-323', gives a raw id, 323
_toRawDlgId: function(dialogId) {
if (typeof(dialogId) === 'string')
return parseInt(dialogId.replace(this.dialogIdPrefix, 
''));
return dialogId;
},
 
+   // converts a raw dialog id like 432, to 'lokdialog-432'
_toDlgPrefix: function(id) {
return this.dialogIdPrefix + id;
},
@@ -85,16 +87,13 @@ L.Control.LokDialog = L.Control.extend({
_onDialogMsg: function(e) {
e.id = parseInt(e.id);
var strDlgId = this._toDlgPrefix(e.id);
+
if (e.action === 'created') {
var width = parseInt(e.size.split(',')[0]);
var height = parseInt(e.size.split(',')[1]);
if (e.winType === 'dialog') {
this._launchDialog(this._toDlgPrefix(e.id), 
width, height, e.title);
this._sendPaintWindow(e.id, 
this._createRectStr(e.id));
-   if (e.title) {
-   this._dialogs[e.id].title = e.title;
-   $('#' + strDlgId).dialog('option', 
'title', e.title);
-   }
} else if (e.winType === 'child') {
if (!this._isOpen(e.parentId))
return;
@@ -128,8 +127,6 @@ L.Control.LokDialog = L.Control.extend({
} else if (e.action === 'size_changed') {
width = parseInt(e.size.split(',')[0]);
height = parseInt(e.size.split(',')[1]);
-
-   strDlgId = this._toDlgPrefix(e.id);
// FIXME: we don't really have to destroy and launch 
the dialog again but do it for
// now because the size sent to us previously in 
'created' cb is not correct
$('#' + strDlgId).remove();
@@ -142,10 +139,12 @@ L.Control.LokDialog = L.Control.extend({
var y = parseInt(rectangle[1]);
var height = parseInt(rectangle[3]);
 
-   $('#' + strDlgId + '-cursor').css({height: 
height});
-   // set the position of the lokdialog-cursor
-   $(this._dialogs[e.id].cursor).css({left: x, 
top: y});
-   $('#' + strDlgId + '-cursor').css({display: 
this._dialogs[e.id].cursorVisible ? 'block' : 'none'});
+   var dialogCursor = L.DomUtil.get(strDlgId + 
'-cursor');
+   L.DomUtil.setStyle(dialogCursor, 'height', 
height + 'px');
+   L.DomUtil.setStyle(dialogCursor, 'display', 
this._dialogs[e.id].cursorVisible ? 'block' : 'none');
+   // set the position of the cursor container 
element
+   L.DomUtil.setStyle(this._dialogs[e.id].cursor, 
'left', x + 'px');
+   L.DomUtil.setStyle(this._dialogs[e.id].cursor, 
'top', y + 'px');
}
} else if (e.action === 'title_changed') {
if (e.title && this._dialogs[parseInt(e.id)]) {
@@ -154,10 +153,8 @@ L.Control.LokDialog = L.Control.extend({
}
} else if (e.action === 'cursor_visible') {
this._dialogs[e.id].cursorVisible = e.visible === 
'true';
-   if (this._dialogs[e.id].cursorVisible)
-   $('#' + strDlgId + '-cursor').css({display: 

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-01-02 Thread Henry Castro
 loleaflet/src/layer/AnnotationManager.js |   25 -
 1 file changed, 16 insertions(+), 9 deletions(-)

New commits:
commit 015f2974a53e8fcdeaa400a345e7e68ed0072f9f
Author: Henry Castro 
Date:   Tue May 30 15:59:00 2017 -0400

loleaflet: merge comments and redlines items

Comments and Redlines were mutually exclusive, but a document
can contain both.

Change-Id: Idb13f0c0e1216edc6bed3291c0c486b45ad74b56
Reviewed-on: https://gerrit.libreoffice.org/38235
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 
Reviewed-on: https://gerrit.libreoffice.org/46448

diff --git a/loleaflet/src/layer/AnnotationManager.js 
b/loleaflet/src/layer/AnnotationManager.js
index 7b1cdf4e..c3e9b9a2 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -27,21 +27,28 @@ L.AnnotationManager = L.Class.extend({
 
// Remove only text comments from the document (excluding change 
tracking comments)
clear: function () {
-   for (var key in this._items) {
-   if (!this._items[key].trackchange) {
-   this._map.removeLayer(this._items[key]);
+   var it = 0;
+   while (it < this._items.length) {
+   if (!this._items[it].trackchange) {
+   this._map.removeLayer(this._items[it]);
+   this._items.splice(it, 1);
+   } else {
+   it++;
}
}
-   this._items = [];
this._selected = null;
this._map.removeLayer(this._arrow);
},
 
// Remove only change tracking comments from the document
clearChanges: function() {
-   for (var key in this._items) {
-   if (this._items[key].trackchange) {
-   this._map.removeLayer(this._items[key]);
+   var it = 0;
+   while (it < this._items.length) {
+   if (this._items[it].trackchange) {
+   this._map.removeLayer(this._items[it]);
+   this._items.splice(it, 1);
+   } else {
+   it++;
}
}
},
@@ -121,7 +128,7 @@ L.AnnotationManager = L.Class.extend({
var comment;
this.clear();
// items contains redlines
-   var ordered = !this._items.length > 0;
+   var ordered = !this._items.length;
for (var index in comments) {
comment = comments[index];
this.adjustComment(comment);
@@ -145,7 +152,7 @@ L.AnnotationManager = L.Class.extend({
var changecomment;
this.clearChanges();
// items contains comments
-   var ordered = !this._items.length > 0;
+   var ordered = !this._items.length;
for (var idx in redlines) {
changecomment = redlines[idx];
if (!this.adjustRedLine(changecomment)) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-12-28 Thread Aditya Dewan
 loleaflet/src/control/Ruler.js|   27 +++
 loleaflet/src/layer/tile/GridLayer.js |4 ++--
 2 files changed, 21 insertions(+), 10 deletions(-)

New commits:
commit 92f013af5be46c6bbb850deebde95ca4eff5f90c
Author: Aditya Dewan 
Date:   Mon Dec 11 01:15:07 2017 +0530

fix ruler misalignment due to comments

Change-Id: I0d69d6cb1fa57801ee969556a25c89bb9afe9869
(cherry picked from commit 1a191d9cd3370fc4922cd81d37eb4ea92e989349)
Reviewed-on: https://gerrit.libreoffice.org/47134
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js
index d13e3cbd..4251c568 100644
--- a/loleaflet/src/control/Ruler.js
+++ b/loleaflet/src/control/Ruler.js
@@ -30,7 +30,9 @@ L.Control.Ruler = L.Control.extend({
return this._initLayout();
},
 
-   _updatePaintTimer: function() {
+   _updatePaintTimer: function(e) {
+   if (e.extraSize)
+   this.options.extraSize = e.extraSize.x;
clearTimeout(this.options.timer);
this.options.timer = setTimeout(L.bind(this._updateBreakPoints, 
this), 300);
},
@@ -79,11 +81,8 @@ L.Control.Ruler = L.Control.extend({
if (this.options.margin1 == null || this.options.margin2 == 
null)
return;
 
-   if (this._map._docLayer._annotations._items.length === 0)
+   if (this._map._docLayer._annotations._items.length === 0 || 
!this.options.marginSet)
this.options.extraSize = 0;
-   else
-   this.options.extraSize = 290;
-   /// as used for the size of actual comments
 
var classMajorSep = 'loleaflet-ruler-maj',
classMargin = 'loleaflet-ruler-margin',
@@ -153,12 +152,24 @@ L.Control.Ruler = L.Control.extend({
_fixOffset: function() {
var scale = this._map.getZoomScale(this._map.getZoom(), 10);
var mapPane = this._map._mapPane;
-   var fTile = mapPane.getElementsByClassName('leaflet-tile')[0];
+
+   /// The rulerOffset depends on the leftmost tile's position
+   /// sometimes the leftmost tile is not available and we need to 
calculate
+   /// from the tiles that we have already.
+   var tiles = this._map._docLayer._tiles;
+   var firstTileKey = Object.keys(tiles)[0];
+   var columnNumber = parseInt(firstTileKey.match(/(\d*):/)[1]);
+   var firstTile = tiles[firstTileKey].el;
+   var firstTileXTranslate = parseInt(firstTile.style.left) - 
this._map._docLayer._tileWidthPx * columnNumber;
+
var tileContainer = 
mapPane.getElementsByClassName('leaflet-tile-container');
tileContainer = tileContainer[tileContainer.length - 1];
-   var mapPaneOffset = 
parseInt(mapPane.style.transform.match(/\(([-0-9]*)/)[1]) + 
parseInt(fTile.style.left) + 
parseInt(tileContainer.style.transform.match(/\(([-0-9]*)/)[1]) + 18 * scale;
+   var tileContainerXTranslate = 
parseInt(tileContainer.style.transform.match(/\(([-0-9]*)/)[1]);
+   var mapPaneXTranslate = 
parseInt(mapPane.style.transform.match(/\(([-0-9]*)/)[1]);
+
+   var rulerOffset = mapPaneXTranslate + firstTileXTranslate + 
tileContainerXTranslate + (this.options.tileMargin * scale);
 
-   this._rFace.style.marginLeft = mapPaneOffset + 'px';
+   this._rFace.style.marginLeft = rulerOffset + 'px';
},
 
_initiateDrag: function(e) {
diff --git a/loleaflet/src/layer/tile/GridLayer.js 
b/loleaflet/src/layer/tile/GridLayer.js
index d080cdfe..0325284f 100644
--- a/loleaflet/src/layer/tile/GridLayer.js
+++ b/loleaflet/src/layer/tile/GridLayer.js
@@ -391,10 +391,10 @@ L.GridLayer = L.Layer.extend({
 
var scrollPixelLimits = new L.Point(this._docWidthTwips / 
this._tileWidthTwips,
this._docHeightTwips / this._tileHeightTwips);
-   scrollPixelLimits = extraSize ? 
scrollPixelLimits.multiplyBy(this._tileSize).add(extraSize) :
+   scrollPixelLimits = extraSize ? 
scrollPixelLimits.multiplyBy(this._tileSize).add(extraSize.multiplyBy(scale)) :
scrollPixelLimits.multiplyBy(this._tileSize);
this._docPixelSize = {x: scrollPixelLimits.x, y: 
scrollPixelLimits.y};
-   this._map.fire('docsize', {x: scrollPixelLimits.x, y: 
scrollPixelLimits.y});
+   this._map.fire('docsize', {x: scrollPixelLimits.x, y: 
scrollPixelLimits.y, extraSize: extraSize});
},
 
_checkSpreadSheetBounds: function (newZoom) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-12-19 Thread Marco Cecchetti
 loleaflet/src/control/Control.ColumnHeader.js |1 +
 loleaflet/src/control/Control.RowHeader.js|1 +
 2 files changed, 2 insertions(+)

New commits:
commit 81c8935b468bae83568f3d7e5ee47962890d8bed
Author: Marco Cecchetti 
Date:   Tue Dec 19 11:18:23 2017 +0100

loleaflet: calc: corner click cause console error when there is no group

Change-Id: I6d6de4b1126294dc464cd07441e887221163
Reviewed-on: https://gerrit.libreoffice.org/46779
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.ColumnHeader.js 
b/loleaflet/src/control/Control.ColumnHeader.js
index 73bfc308..bc9d362d 100644
--- a/loleaflet/src/control/Control.ColumnHeader.js
+++ b/loleaflet/src/control/Control.ColumnHeader.js
@@ -516,6 +516,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({
if (pos.x <= rowOutlineWidth) {
// empty rectangle on the left select all
this._map.sendUnoCommand('.uno:SelectAll');
+   return;
}
 
var level = this._getGroupLevel(pos.y);
diff --git a/loleaflet/src/control/Control.RowHeader.js 
b/loleaflet/src/control/Control.RowHeader.js
index 5e637527..e70a0904 100644
--- a/loleaflet/src/control/Control.RowHeader.js
+++ b/loleaflet/src/control/Control.RowHeader.js
@@ -471,6 +471,7 @@ L.Control.RowHeader = L.Control.Header.extend({
if (pos.x > this.getOutlineWidth()) {
// empty rectangle on the right select all
this._map.sendUnoCommand('.uno:SelectAll');
+   return;
}
 
var level = this._getGroupLevel(pos.x);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-12-19 Thread Marco Cecchetti
 loleaflet/src/control/Control.Header.js |   18 --
 1 file changed, 18 deletions(-)

New commits:
commit f1fe2fe66cdebef8b6fcf57874a1d21c7a59a8e7
Author: Marco Cecchetti 
Date:   Mon Dec 18 21:59:17 2017 +0100

loleaflet: calc: removed unused function

Change-Id: I0dc6b7b60ab1af2e6d77ac8b8a79fc6ad56f68b8
Reviewed-on: https://gerrit.libreoffice.org/46747
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.Header.js 
b/loleaflet/src/control/Control.Header.js
index 8593052d..ad8edec3 100644
--- a/loleaflet/src/control/Control.Header.js
+++ b/loleaflet/src/control/Control.Header.js
@@ -503,24 +503,6 @@ L.Control.Header = L.Control.extend({
}
},
 
-   _getGroupLevelHeader: function (pos) {
-   if (!this._groups)
-   return;
-
-   var levels = this._groups.length + 1;
-   var size = this._levelSpacing + this._groupHeadSize;
-
-   var level = (pos + 1) / size | 0;
-   var relPos = pos % size;
-
-   if (level < this._groups.length && relPos > this._levelSpacing) 
{
-   return level;
-   }
-   else {
-   return -1;
-   }
-   },
-
_computeOutlineWidth: function () {
return this._levelSpacing + (this._groupHeadSize + 
this._levelSpacing) * (this._groups.length + 1);
},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-12-19 Thread Marco Cecchetti
 loleaflet/src/layer/tile/CalcTileLayer.js |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit af0993189f510abc067e6682fb41e1a839d62a07
Author: Marco Cecchetti 
Date:   Mon Dec 18 21:58:44 2017 +0100

loleaflet: calc: wrong data in firing of updaterowcolumnheaders event

two fixes:

- wrong data in firing of updaterowcolumnheaders event (messing up
pg-up/pg-down)

- console error message about invocation of a method for an undefined
object (annotation.mark)

Change-Id: I4e7d9de38ffe18b477c99147966fd91d7a460841
Reviewed-on: https://gerrit.libreoffice.org/46746
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index c628bfb8..d0296b15 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -211,7 +211,7 @@ L.CalcTileLayer = L.TileLayer.extend({
this._map.fire('updaterowcolumnheaders', {x: 0, y: 
this._map._getTopLeftPoint().y, offset: {x: 0, y: undefined}});
this._map._socket.sendMessage('commandvalues 
command=.uno:ViewAnnotationsPosition');
} else if (textMsg.startsWith('invalidateheader: all')) {
-   this._map.fire('updaterowcolumnheaders', {x: 
this._map._getTopLeftPoint().x, y: this._map._getTopLeftPoint(), offset: {x: 
undefined, y: undefined}});
+   this._map.fire('updaterowcolumnheaders', {x: 
this._map._getTopLeftPoint().x, y: this._map._getTopLeftPoint().y, offset: {x: 
undefined, y: undefined}});
this._map._socket.sendMessage('commandvalues 
command=.uno:ViewAnnotationsPosition');
} else {
L.TileLayer.prototype._onMessage.call(this, textMsg, 
img);
@@ -469,7 +469,9 @@ L.CalcTileLayer = L.TileLayer.extend({
var annotation = 
this._annotations[comment.tab][comment.id];
if (annotation) {

annotation.setLatLngBounds(comment.cellPos);
-   
annotation.mark.setLatLng(comment.cellPos.getNorthEast());
+   if (annotation.mark) {
+   
annotation.mark.setLatLng(comment.cellPos.getNorthEast());
+   }
}
}
this.showAnnotations();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-12-18 Thread Marco Cecchetti
 loleaflet/src/control/Control.Header.js |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit e3b893dbc69aad870b7101d48e6230b0690953f2
Author: Marco Cecchetti 
Date:   Sun Dec 17 18:58:01 2017 +0100

calc: fixing auto optimal size on double-click

Change-Id: I6341c617037cd876667681d4495f77e75cad8388
Reviewed-on: https://gerrit.libreoffice.org/46719
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.Header.js 
b/loleaflet/src/control/Control.Header.js
index 261b2958..8593052d 100644
--- a/loleaflet/src/control/Control.Header.js
+++ b/loleaflet/src/control/Control.Header.js
@@ -423,6 +423,10 @@ L.Control.Header = L.Control.extend({
this.onDragMove(this._item, this._start, this._offset, e);
},
 
+   _resetClickCount: function () {
+   this._clicks = 0;
+   },
+
_onMouseUp: function (e) {
// disable mouse events used on dragging
L.DomEvent.off(document, 'mousemove', 
this._onMouseMoveForDragging, this);
@@ -439,7 +443,7 @@ L.Control.Header = L.Control.extend({
this._clicks = 0;
} else {
this.onDragClick(this._item, ++this._clicks, e);
-   setTimeout(L.bind(this.initialize, this), 400);
+   setTimeout(L.bind(this._resetClickCount, this), 400);
}
 
this._item = this._start = this._offset = null;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-12-15 Thread Pranav Kant
 loleaflet/src/control/Control.LokDialog.js |   56 +
 1 file changed, 34 insertions(+), 22 deletions(-)

New commits:
commit 192a1f87024c97d4dda031a45cce4d4900416217
Author: Pranav Kant 
Date:   Fri Dec 15 20:05:27 2017 +0530

lokdialog: Handle 'title' field in the 'created' cb

While at it, move the title, width, height properties to this._dialogs
object as they are dialog specific.

Change-Id: Ibffcc57b0af210150690b2baf45d627baf5897fb
Reviewed-on: https://gerrit.libreoffice.org/46560
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 20fb5bf0..2e1e80b1 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -24,6 +24,7 @@ L.Control.LokDialog = L.Control.extend({
},
 
_getParentDialog: function(id) {
+   id = parseInt(id);
for (var winId in this._dialogs) {
if (this._dialogs[winId].childid && 
this._dialogs[winId].childid === id) {
return winId;
@@ -39,7 +40,9 @@ L.Control.LokDialog = L.Control.extend({
},
 
_toRawDlgId: function(dialogId) {
-   return dialogId.replace(this.dialogIdPrefix, '');
+   if (typeof(dialogId) === 'string')
+   return parseInt(dialogId.replace(this.dialogIdPrefix, 
''));
+   return dialogId;
},
 
_toDlgPrefix: function(id) {
@@ -48,11 +51,11 @@ L.Control.LokDialog = L.Control.extend({
 
// Create a rectangle string of form "x,y,width,height"
// if params are missing, assumes 0,0,dialog width, dialog height
-   _createRectStr: function(x, y, width, height) {
+   _createRectStr: function(id, x, y, width, height) {
if (!width)
-   width = this._width;
+   width = this._dialogs[parseInt(id)].width;
if (!height)
-   height = this._height;
+   height = this._dialogs[parseInt(id)].height;
if (!x)
x = 0;
if (!y)
@@ -80,15 +83,18 @@ L.Control.LokDialog = L.Control.extend({
},
 
_onDialogMsg: function(e) {
+   e.id = parseInt(e.id);
var strDlgId = this._toDlgPrefix(e.id);
if (e.action === 'created') {
var width = parseInt(e.size.split(',')[0]);
var height = parseInt(e.size.split(',')[1]);
if (e.winType === 'dialog') {
-   this._width = width;
-   this._height = height;
-   this._launchDialog(this._toDlgPrefix(e.id));
-   this._sendPaintWindow(e.id, 
this._createRectStr());
+   this._launchDialog(this._toDlgPrefix(e.id), 
width, height, e.title);
+   this._sendPaintWindow(e.id, 
this._createRectStr(e.id));
+   if (e.title) {
+   this._dialogs[e.id].title = e.title;
+   $('#' + strDlgId).dialog('option', 
'title', e.title);
+   }
} else if (e.winType === 'child') {
if (!this._isOpen(e.parentId))
return;
@@ -104,7 +110,7 @@ L.Control.LokDialog = L.Control.extend({
this._dialogs[parentId].childx = left;
this._dialogs[parentId].childy = top;
this._createDialogChild(e.id, parentId, top, 
left);
-   this._sendPaintWindow(e.id, 
this._createRectStr(0, 0, width, height));
+   this._sendPaintWindow(e.id, 
this._createRectStr(null, 0, 0, width, height));
}
} else if (e.action === 'invalidate') {
var parent = this._getParentDialog(e.id);
@@ -116,20 +122,19 @@ L.Control.LokDialog = L.Control.extend({
return;
 
if (!rectangle)
-   rectangle = '0,0,' + this._width + ',' 
+ this._height;
+   rectangle = '0,0,' + 
this._dialogs[e.id].width + ',' + this._dialogs[e.id].height;
}
this._sendPaintWindow(e.id, rectangle);
} else if (e.action === 'size_changed') {
-   this._width = parseInt(e.size.split(',')[0]);
-   this._height = parseInt(e.size.split(',')[1]);
+

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-12-15 Thread Marco Cecchetti
 loleaflet/src/control/Control.ColumnHeader.js |   11 ++
 loleaflet/src/control/Control.Header.js   |   43 +-
 loleaflet/src/control/Control.RowHeader.js|   11 ++
 loleaflet/src/layer/tile/CalcTileLayer.js |   11 --
 loleaflet/src/layer/tile/TileLayer.js |1 
 5 files changed, 32 insertions(+), 45 deletions(-)

New commits:
commit c17cf464740619d9b73200137b87de3b3ce715e7
Author: Marco Cecchetti 
Date:   Wed Dec 13 23:20:30 2017 +0100

calc: use cursor position for change header highlight quickier

This patch fixes also a bug: when in edit mode the header for cell A1
are highlighted

Change-Id: If97d8d151f9d216362a9b1472c2b29fbec4f9b73
Reviewed-on: https://gerrit.libreoffice.org/46539
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.ColumnHeader.js 
b/loleaflet/src/control/Control.ColumnHeader.js
index 65a8da8b..73bfc308 100644
--- a/loleaflet/src/control/Control.ColumnHeader.js
+++ b/loleaflet/src/control/Control.ColumnHeader.js
@@ -184,13 +184,10 @@ L.Control.ColumnHeader = L.Control.Header.extend({
},
 
_onUpdateCurrentColumn: function (e) {
-   var x = e.min.x;
-   var w = e.getSize().x;
-   if (x !== -1) {
-   x = this._twipsToPixels(x);
-   w = this._twipsToPixels(w);
-   }
-   this.updateCurrent(this._data, x, w);
+   var x = e.curX - this._startHeaderIndex;
+   var w = this._twipsToPixels(e.width);
+   var slim = w <= 1;
+   this.updateCurrent(this._data, x, slim);
},
 
_updateColumnHeader: function () {
diff --git a/loleaflet/src/control/Control.Header.js 
b/loleaflet/src/control/Control.Header.js
index e77c7799..261b2958 100644
--- a/loleaflet/src/control/Control.Header.js
+++ b/loleaflet/src/control/Control.Header.js
@@ -213,42 +213,31 @@ L.Control.Header = L.Control.extend({
this._selection.end = itEnd;
},
 
-   updateCurrent: function (data, start, size) {
+   updateCurrent: function (data, cursorPos, slim) {
if (!data || data.isEmpty())
return;
 
-   if (start < 0) {
+   if (cursorPos < 0) {
this.unselect(data.get(this._current));
this._current = -1;
return;
}
 
-   var x0 = 0, x1 = 0;
-   var prevEntry = null;
-   var entry = data.getFirst();
-   var zeroSizeEntry = false;
-   while (entry) {
-   x0 = entry.pos - entry.size;
-   x1 = entry.pos;
-   if (x0 <= start && start < x1) {
-   // we have a slim cursor because of a zero size 
entry ?
-   zeroSizeEntry = size <= 1 && prevEntry && 
prevEntry.size === 0;
-   // when a whole row (column) is selected the 
cell cursor is moved to the first column (row)
-   // but this action should not cause to 
select/unselect anything, on the contrary we end up
-   // with all column (row) header entries 
selected but the one where the cell cursor was
-   // previously placed
-   if (this._selection.start === -1 && 
this._selection.end === -1) {
-   this.unselect(data.get(this._current));
-   // no selection when the cell cursor is 
slim
-   if (!zeroSizeEntry)
-   this.select(entry);
-   }
-   this._current = zeroSizeEntry ? -1 : 
entry.index;
-   break;
-   }
-   prevEntry = entry;
-   entry = data.getNext();
+   var prevEntry = cursorPos > 0 ? data.get(cursorPos - 1) : null;
+   var zeroSizeEntry = slim && prevEntry && prevEntry.size === 0;
+
+   var entry = data.get(cursorPos);
+   if (this._selection.start === -1 && this._selection.end === -1) 
{
+   // when a whole row (column) is selected the cell 
cursor is moved to the first column (row)
+   // but this action should not cause to select/unselect 
anything, on the contrary we end up
+   // with all column (row) header entries selected but 
the one where the cell cursor was
+   // previously placed
+   this.unselect(data.get(this._current));
+   // no selection 

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-12-13 Thread Jan Holesovsky
 loleaflet/src/control/Control.ColumnHeader.js |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit ad712291d938d9439ee1c239db7ca71064fa74a2
Author: Jan Holesovsky 
Date:   Wed Dec 13 21:33:05 2017 +0100

Adjust the vertical centering of the column headers slightly.

Change-Id: Ief485cfb24bd57d5ec410866189e383658293cc4
Reviewed-on: https://gerrit.libreoffice.org/46425
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.ColumnHeader.js 
b/loleaflet/src/control/Control.ColumnHeader.js
index 7b0a25ab..6b0ae0d7 100644
--- a/loleaflet/src/control/Control.ColumnHeader.js
+++ b/loleaflet/src/control/Control.ColumnHeader.js
@@ -245,7 +245,11 @@ L.Control.ColumnHeader = L.Control.Header.extend({
ctx.font = this._font;
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
-   ctx.fillText(content, endPar - (width / 2), startOrt + (height 
/ 2));
+   // The '+ 1' below is a hack - it's currently not possible to 
measure
+   // the exact bounding box in html5's canvas, and the 
textBaseline
+   // 'middle' measures everything including the descent etc.
+   // '+ 1' looks visually fine, and seems safe enough
+   ctx.fillText(content, endPar - (width / 2), startOrt + (height 
/ 2) + 1);
// draw row separator
ctx.fillStyle = this._borderColor;
ctx.fillRect(endPar -1, startOrt, this._borderWidth, height);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-12-13 Thread Jan Holesovsky
 loleaflet/src/control/Control.Menubar.js |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit ba61ec9da2c073d2d728c5bb8df8912f5117fd5e
Author: Jan Holesovsky 
Date:   Wed Dec 13 19:49:11 2017 +0100

l10n: Calc and Impress should use _UNO('.uno:LanguageMenu') too.

Change-Id: I987821d9d9b0f40baea1879d28177e8e0c58a3a3
Reviewed-on: https://gerrit.libreoffice.org/46418
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 52474f5e..c15a286c 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -189,7 +189,7 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:ToolsMenu', 'text'), id: 'tools', 
type: 'menu', menu: [
{uno: '.uno:SpellingAndGrammarDialog'},
{uno: '.uno:SpellOnline'},
-   {name: _UNO('.uno:LanguageMenu', 'text'), type: 
'menu', menu: [
+   {name: _UNO('.uno:LanguageMenu'), type: 'menu', 
menu: [
{name: 
_UNO('.uno:SetLanguageSelectionMenu', 'text'), type: 'menu', menu: [
{name: _('None (Do not check 
spelling)'), id: 'noneselection', uno: 
'.uno:LanguageStatus?Language:string=Current_LANGUAGE_NONE'}]},
{name: 
_UNO('.uno:SetLanguageParagraphMenu', 'text'), type: 'menu', menu: [
@@ -267,7 +267,7 @@ L.Control.Menubar = L.Control.extend({
},
{name: _UNO('.uno:ToolsMenu', 'presentation'), id: 
'tools', type: 'menu', menu: [
{uno: '.uno:SpellOnline'},
-   {name: _('Language'), type: 'menu', menu: [
+   {name: _UNO('.uno:LanguageMenu'), type: 'menu', 
menu: [
{name: _('None (Do not check 
spelling)'), id: 'nonelanguage', uno: 
'.uno:LanguageStatus?Language:string=Default_LANGUAGE_NONE'}]}
]},
{name: _UNO('.uno:HelpMenu', 'presentation'), id: 
'help', type: 'menu', menu: [
@@ -348,7 +348,7 @@ L.Control.Menubar = L.Control.extend({
]},
{name: _UNO('.uno:ToolsMenu', 'spreadsheet'), id: 
'tools', type: 'menu', menu: [
{uno: '.uno:SpellOnline'},
-   {name: _('Language'), type: 'menu', menu: [
+   {name: _UNO('.uno:LanguageMenu'), type: 'menu', 
menu: [
{name: _('None (Do not check 
spelling)'), id: 'nonelanguage', uno: 
'.uno:LanguageStatus?Language:string=Default_LANGUAGE_NONE'}]}
]},
{name: _UNO('.uno:HelpMenu', 'spreadsheet'), id: 
'help', type: 'menu', menu: [
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-12-09 Thread Pranav Kant
 loleaflet/src/control/Control.LokDialog.js |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 351f7ad0f197be6331e1dc4ff4a71ddb409fbd09
Author: Pranav Kant 
Date:   Fri Dec 8 18:29:40 2017 +0530

lokdialog: fix cursor_visible status in dialogs

Change-Id: I4c96a05911df29207c9280c3835dbdd7e72a1e80
Reviewed-on: https://gerrit.libreoffice.org/46115
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 1c5fbe9f..20fb5bf0 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -140,13 +140,14 @@ L.Control.LokDialog = L.Control.extend({
$('#' + strDlgId + '-cursor').css({height: 
height});
// set the position of the lokdialog-cursor
$(this._dialogs[e.id].cursor).css({left: x, 
top: y});
+   $('#' + strDlgId + '-cursor').css({display: 
this._dialogs[e.id].cursorVisible ? 'block' : 'none'});
}
} else if (e.action === 'title_changed') {
this._title = e.title;
$('#' + strDlgId).dialog('option', 'title', e.title);
} else if (e.action === 'cursor_visible') {
-   var visible = e.visible === 'true';
-   if (visible)
+   this._dialogs[e.id].cursorVisible = e.visible === 
'true';
+   if (this._dialogs[e.id].cursorVisible)
$('#' + strDlgId + '-cursor').css({display: 
'block'});
else
$('#' + strDlgId + '-cursor').css({display: 
'none'});
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-12-08 Thread Jan Holesovsky
 loleaflet/src/control/Control.Menubar.js |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit be100fe06abbeabed05b0c8a02c4f6067fcfc774
Author: Jan Holesovsky 
Date:   Fri Dec 8 17:39:49 2017 +0100

l10n: Fix the Table menu in Impress.

Change-Id: I2cb8b98ecc1a18174b26dfaa9c96ad3829ff5989
Reviewed-on: https://gerrit.libreoffice.org/46099
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 858f7474..c3584c21 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -244,14 +244,14 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:FormatMenu', 'presentation'), type: 
'menu', menu: [
{uno: '.uno:EditStyle'}
]},
-   {name: _UNO('.uno:TableMenu', 'presentation'), type: 
'menu', menu: [
-   {name: _UNO('.uno:TableInsertMenu', 
'presentation'), type: 'menu', menu: [
+   {name: _UNO('.uno:TableMenu', 'text'/*HACK should be 
'presentation', but not in xcu*/), type: 'menu', menu: [
+   {name: _UNO('.uno:TableInsertMenu', 
'text'/*HACK should be 'presentation', but not in xcu*/), type: 'menu', menu: [
{uno: '.uno:InsertRowsBefore'},
{uno: '.uno:InsertRowsAfter'},
{type: 'separator'},
{uno: '.uno:InsertColumnsBefore'},
{uno: '.uno:InsertColumnsAfter'}]},
-   {name: _UNO('.uno:TableDeleteMenu', 
'presentation'), type: 'menu', menu: [
+   {name: _UNO('.uno:TableDeleteMenu', 
'text'/*HACK should be 'presentation', but not in xcu*/), type: 'menu', menu: [
{uno: '.uno:DeleteRows'},
{uno: '.uno:DeleteColumns'}]},
{uno: '.uno:MergeCells'}]
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src loleaflet/unocommands.js

2017-12-08 Thread Jan Holesovsky
 loleaflet/src/control/Control.Menubar.js |   23 ++-
 loleaflet/unocommands.js |   10 ++
 2 files changed, 28 insertions(+), 5 deletions(-)

New commits:
commit 2a42bf08c0add7fdd37893269cd51a10ca9a646a
Author: Jan Holesovsky 
Date:   Fri Dec 8 10:01:18 2017 +0100

calc: Add AutoFilter and various other sorting and filtering to the menu.

Change-Id: I20a481d258e35f5119ed65a68f9816c13e0451eb
Reviewed-on: https://gerrit.libreoffice.org/46074
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index afb6422a..84e8f830 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -323,13 +323,26 @@ L.Control.Menubar = L.Control.extend({
{uno: '.uno:DeleteColumns'}
]},
{name: _UNO('.uno:DataMenu'), type: 'menu', menu: [
-   {uno: '.uno:Group'},
-   {uno: '.uno:Ungroup'},
+   {uno: '.uno:DataSort'},
+   {uno: '.uno:SortAscending'},
+   {uno: '.uno:SortDescending'},
{type: 'separator'},
-   {uno: '.uno:ClearOutline'},
+   {uno: '.uno:DataFilterAutoFilter'},
+   {name: _UNO('.uno:FilterMenu'), type: 'menu', 
menu: [
+   {uno: '.uno:DataFilterStandardFilter'},
+   {uno: '.uno:DataFilterSpecialFilter'},
+   {type: 'separator'},
+   {uno: '.uno:DataFilterRemoveFilter'},
+   {uno: 
'.uno:DataFilterHideAutoFilter'}]},
{type: 'separator'},
-   {uno: '.uno:ShowDetail'},
-   {uno: '.uno:HideDetail'}
+   {name: _UNO('.uno:GroupOutlineMenu'), type: 
'menu', menu: [
+   {uno: '.uno:Group'},
+   {uno: '.uno:Ungroup'},
+   {type: 'separator'},
+   {uno: '.uno:ClearOutline'},
+   {type: 'separator'},
+   {uno: '.uno:HideDetail'},
+   {uno: '.uno:ShowDetail'}]}
]},
{name: _UNO('.uno:ToolsMenu'), id: 'tools', type: 
'menu', menu: [
{uno: '.uno:SpellOnline'},
diff --git a/loleaflet/unocommands.js b/loleaflet/unocommands.js
index 712069cf..4a1557b5 100644
--- a/loleaflet/unocommands.js
+++ b/loleaflet/unocommands.js
@@ -28,7 +28,13 @@ var unoCommandsArray = {
 Copy: _('~Copy'),
 CopyHyperlinkLocation: _('Copy Link Location'),
 Cut: _('~Cut'),
+DataFilterAutoFilter: _('Auto~Filter'),
+DataFilterHideAutoFilter: _('~Hide AutoFilter'),
+DataFilterRemoveFilter: _('~Reset Filter'),
+DataFilterSpecialFilter: _('~Advanced Filter...'),
+DataFilterStandardFilter: _('~Standard Filter...'),
 DataMenu: _('~Data'),
+DataSort: _('~Sort...'),
 DecrementIndent: _('Decrease'),
 DecrementLevel: _('Demote One Level'),
 DecrementSubLevels: _('Demote One Level With Subpoints'),
@@ -47,6 +53,7 @@ var unoCommandsArray = {
 EntireCell: _('Select Cell'),
 EntireColumn: _('Select Column'),
 EntireRow: _('Select Rows'),
+FilterMenu: _('More ~Filters'),
 FontDialog: _('Character...'),
 FormatBulletsMenu: _('Lis~ts'),
 FormatCellDialog: _('Format ~Cells...'),
@@ -56,6 +63,7 @@ var unoCommandsArray = {
 FormattingMarkMenu: _('Formatting Mark'),
 FullScreen: _('F~ull Screen'),
 Group: _('~Group...'),
+GroupOutlineMenu: _('~Group and Outline'),
 Grow: _('Increase'),
 HelpMenu: _('~Help'),
 HideDetail: _('~Hide Details'),
@@ -144,6 +152,8 @@ var unoCommandsArray = {
 Shrink: _('Decrease'),
 SlideMenu: _('S~lide'),
 SmallCaps: _('Small capitals'),
+SortAscending: _('Sort Ascending'),
+SortDescending: _('Sort Descending'),
 SpacePara1: _('Line Spacing: 1'),
 SpacePara15: _('Line Spacing: 1.5'),
 SpacePara2: _('Line Spacing: 2'),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-12-07 Thread Pranav Kant
 loleaflet/src/control/Control.Menubar.js |   35 +--
 1 file changed, 15 insertions(+), 20 deletions(-)

New commits:
commit 446c3f64257862f3e3750fa6663a02db3b5ea121
Author: Pranav Kant 
Date:   Wed Dec 6 17:19:46 2017 +0530

Remove special type, 'dialog', from Menubar items

Treat all commands as UNO commands only. I see no advantange of keeping
a separate 'dialog' type if all dialogs are opened by UNO Commands only.
There was a need earlier before we had a separate "created" callback,
but this is unnecessary now.

(cherry-picked from 8ac82593ec19322f21a3e8118c8d8cb1c464357f)

Change-Id: Ibea8cc1f24819597ddf2c49f3b8a47072e04e637
Reviewed-on: https://gerrit.libreoffice.org/45938
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index c4ef8b41..5a77aea5 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -35,19 +35,19 @@ L.Control.Menubar = L.Control.extend({
{name: _('Paste'), type: 'unocommand', uno: 
'.uno:Paste'},
{name: _('Select all'), type: 'unocommand', 
uno: '.uno:SelectAll'},
{type: 'separator'},
-   {name: _('Find & Replace...'), id: 
'.uno:SearchDialog', type: 'dialog'},
+   {name: _('Find & Replace...'), uno: 
'.uno:SearchDialog', type: 'unocommand'},
{type: 'separator'},
{name: _('Track Changes'), type: 'menu', menu: [
{name: _('Record'), type: 'unocommand', 
uno: '.uno:TrackChanges'},
{name: _('Show'), type: 'unocommand', 
uno: '.uno:ShowTrackedChanges'},
{type: 'separator'},
-   {name: _('Manage Changes...'), id: 
'.uno:AcceptTrackedChanges', type: 'dialog'},
+   {name: _('Manage Changes...'), uno: 
'.uno:AcceptTrackedChanges', type: 'unocommand'},
{name: _('Accept All'), type: 
'unocommand', uno: '.uno:AcceptAllTrackedChanges'},
{name: _('Reject All'), type: 
'unocommand', uno: '.uno:RejectAllTrackedChanges'},
{name: _('Previous'), type: 
'unocommand', uno: '.uno:PreviousTrackedChange'},
{name: _('Next'), type: 'unocommand', 
uno: '.uno:NextTrackedChange'}
]},
-   {name: _('Edit Style...'), id: 
'.uno:EditStyle', type: 'dialog'},
+   {name: _('Edit Style...'), uno: 
'.uno:EditStyle', type: 'unocommand'},
]},
{name: _('View'), id: 'view', type: 'menu', menu: [
{name: _('Full screen'), id: 'fullscreen', 
type: 'action'},
@@ -69,7 +69,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('Page break'), type: 'unocommand', 
uno: '.uno:InsertPageBreak'},
{name: _('Column break'), type: 'unocommand', 
uno: '.uno:InsertColumnBreak'},
{type: 'separator'},
-   {name: _('Hyperlink...'), id: 
'.uno:HyperlinkDialog', type: 'dialog'},
+   {name: _('Hyperlink...'), uno: 
'.uno:HyperlinkDialog', type: 'unocommand'},
{name: _('Special character...'), id: 
'specialcharacter', type: 'action'},
{name: _('Formatting mark'), type: 'menu', 
menu: [
{name: _('Non-breaking space'), type: 
'unocommand', uno: '.uno:InsertNonBreakingSpace'},
@@ -79,7 +79,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('No-width no break'), type: 
'unocommand', uno: '.uno:InsertZWNBSP'},
{name: _('Left-to-right mark'), type: 
'unocommand', uno: '.uno:InsertLRM'},
{name: _('Right-to-left mark'), type: 
'unocommand', uno: '.uno:InsertRLM'}]},
-   {name: _('Index Entry...'), id: 
'.uno:InsertIndexesEntry', type: 'dialog'}
+   {name: _('Index Entry...'), uno: 
'.uno:InsertIndexesEntry', type: 'unocommand'}
]
},
{name: _('Format'), type: 'menu', menu: [
@@ -151,9 +151,9 @@ L.Control.Menubar = L.Control.extend({
{name: _('To previous paragraph in 
level'), type: 'unocommand', uno: 

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-12-07 Thread Pranav Kant
 loleaflet/src/control/Control.Menubar.js |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 53eab227d20970540bcd18bb204e18edc32a3da1
Author: Pranav Kant 
Date:   Wed Dec 6 17:03:55 2017 +0530

Add elipsis to dialogs in menubar

And change 'Spelling & Grammar' to 'Spelling...' to match with latest
desktop UI names.

(cherry-picked from 13144cbc8f0c543e51ee7e53b5fd7f750390d241)

Change-Id: I51000e93c7dd6e60d31b11b731d9d5427fea271b
Reviewed-on: https://gerrit.libreoffice.org/45935
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 51aeacf5..c4ef8b41 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -35,7 +35,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('Paste'), type: 'unocommand', uno: 
'.uno:Paste'},
{name: _('Select all'), type: 'unocommand', 
uno: '.uno:SelectAll'},
{type: 'separator'},
-   {name: _('Find & Replace'), id: 
'.uno:SearchDialog', type: 'dialog'},
+   {name: _('Find & Replace...'), id: 
'.uno:SearchDialog', type: 'dialog'},
{type: 'separator'},
{name: _('Track Changes'), type: 'menu', menu: [
{name: _('Record'), type: 'unocommand', 
uno: '.uno:TrackChanges'},
@@ -69,7 +69,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('Page break'), type: 'unocommand', 
uno: '.uno:InsertPageBreak'},
{name: _('Column break'), type: 'unocommand', 
uno: '.uno:InsertColumnBreak'},
{type: 'separator'},
-   {name: _('Hyperlink'), id: 
'.uno:HyperlinkDialog', type: 'dialog'},
+   {name: _('Hyperlink...'), id: 
'.uno:HyperlinkDialog', type: 'dialog'},
{name: _('Special character...'), id: 
'specialcharacter', type: 'action'},
{name: _('Formatting mark'), type: 'menu', 
menu: [
{name: _('Non-breaking space'), type: 
'unocommand', uno: '.uno:InsertNonBreakingSpace'},
@@ -184,10 +184,10 @@ L.Control.Menubar = L.Control.extend({
{name: _('Cell'), type: 'unocommand', 
uno: '.uno:EntireCell'}]},
{name: _('Merge cells'), type: 'unocommand', 
uno: '.uno:MergeCells'},
{type: 'separator'},
-   {name: _('Properties'), id: '.uno:TableDialog', 
type: 'dialog'}
+   {name: _('Properties...'), id: 
'.uno:TableDialog', type: 'dialog'}
]},
{name: _('Tools'), id: 'tools', type: 'menu', menu: [
-   {name: _('Spelling and Grammar'), id: 
'.uno:SpellingAndGrammarDialog', type: 'dialog'},
+   {name: _('Spelling...'), id: 
'.uno:SpellingAndGrammarDialog', type: 'dialog'},
{name: _('Automatic spell checking'), type: 
'unocommand', uno: '.uno:SpellOnline'},
{name: _('Language for selection'), type: 
'menu', menu: [
{name: _('None (Do not check 
spelling)'), id: 'noneselection', type: 'unocommand', uno: 
'.uno:LanguageStatus?Language:string=Current_LANGUAGE_NONE'}]},
@@ -195,7 +195,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('None (Do not check 
spelling)'), id: 'noneparagraph', type: 'unocommand', uno: 
'.uno:LanguageStatus?Language:string=Paragraph_LANGUAGE_NONE'}]},
{name: _('Language for entire document'), type: 
'menu', menu: [
{name: _('None (Do not check 
spelling)'), id: 'nonelanguage', type: 'unocommand', uno: 
'.uno:LanguageStatus?Language:string=Default_LANGUAGE_NONE'}]},
-   {name: _('Word count'), id: 
'.uno:WordCountDialog', type: 'dialog'}
+   {name: _('Word Count...'), id: 
'.uno:WordCountDialog', type: 'dialog'}
]},
{name: _('Help'), id: 'help', type: 'menu', menu: [
{name: _('Keyboard shortcuts'), id: 
'keyboard-shortcuts', type: 'action'},
@@ -226,7 +226,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('Paste'), type: 'unocommand', uno: 
'.uno:Paste'},
{name: _('Select all'), type: 'unocommand', 
uno: 

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-12-06 Thread Henry Castro
 loleaflet/src/layer/AnnotationManager.js |   25 +++---
 loleaflet/src/layer/marker/Annotation.js |   37 ---
 loleaflet/src/layer/tile/GridLayer.js|   13 +
 loleaflet/src/layer/tile/ImpressTileLayer.js |4 --
 loleaflet/src/layer/tile/WriterTileLayer.js  |   14 +-
 loleaflet/src/map/Map.js |   15 ++
 6 files changed, 74 insertions(+), 34 deletions(-)

New commits:
commit d4afb68b765489611c8a7090948b3f7a808d1838
Author: Henry Castro 
Date:   Tue Dec 5 08:04:54 2017 -0400

loleaflet: fix comments that are cut off at the bottom of the page

Change-Id: Idadaa0dfcd4f3c9f02e8878d243b5d3e34087606
Reviewed-on: https://gerrit.libreoffice.org/45874
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/loleaflet/src/layer/AnnotationManager.js 
b/loleaflet/src/layer/AnnotationManager.js
index 09601615..7b1cdf4e 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -128,7 +128,7 @@ L.AnnotationManager = L.Class.extend({
if (comment.author in this._map._viewInfoByUserName) {
comment.avatar = 
this._map._viewInfoByUserName[comment.author].userextrainfo.avatar;
}
-   
this._items.push(L.annotation(this._map.options.maxBounds.getSouthEast(), 
comment).addTo(this._map));
+   
this._items.push(L.annotation(this._map.options.docBounds.getSouthEast(), 
comment).addTo(this._map));
}
if (this._items.length > 0) {
if (!ordered) {
@@ -137,7 +137,6 @@ L.AnnotationManager = L.Class.extend({

Math.abs(a._data.anchorPos.min.x) - Math.abs(b._data.anchorPos.min.x);
});
}
-   this._map._docLayer._updateMaxBounds(true);
this.layout();
}
},
@@ -156,7 +155,7 @@ L.AnnotationManager = L.Class.extend({
if (changecomment.author in 
this._map._viewInfoByUserName) {
changecomment.avatar = 
this._map._viewInfoByUserName[changecomment.author].userextrainfo.avatar;
}
-   
this._items.push(L.annotation(this._map.options.maxBounds.getSouthEast(), 
changecomment).addTo(this._map));
+   
this._items.push(L.annotation(this._map.options.docBounds.getSouthEast(), 
changecomment).addTo(this._map));
}
if (this._items.length > 0) {
if (!ordered) {
@@ -165,7 +164,6 @@ L.AnnotationManager = L.Class.extend({

Math.abs(a._data.anchorPos.min.x) - Math.abs(b._data.anchorPos.min.x);
});
}
-   this._map._docLayer._updateMaxBounds(true);
this.layout();
}
},
@@ -250,8 +248,7 @@ L.AnnotationManager = L.Class.extend({
update: function () {
if (this._selected) {
var point;
-   var scale = this._map.getZoomScale(this._map.getZoom(), 
10);
-   var docRight = 
this._map.project(this._map.options.maxBounds.getNorthEast()).subtract(this.options.extraSize.multiplyBy(scale));
+   var docRight = 
this._map.project(this._map.options.docBounds.getNorthEast());
point = 
this._map._docLayer._twipsToPixels(this._selected._data.anchorPos.min);
this._arrow.setLatLngs([this._map.unproject(point), 
map.unproject(L.point(docRight.x, point.y))]);
this._map.addLayer(this._arrow);
@@ -261,9 +258,9 @@ L.AnnotationManager = L.Class.extend({
this.layout();
},
 
-   updateDocBounds: function (count, extraSize) {
-   if (this._items.length === count) {
-   this._map._docLayer._updateMaxBounds(true, extraSize);
+   updateDocBounds: function () {
+   if (this._items.length === 0) {
+   this._map.fire('updatemaxbounds', {sizeChanged: true});
}
},
 
@@ -338,8 +335,7 @@ L.AnnotationManager = L.Class.extend({
},
 
layout: function (zoom) {
-   var scale = this._map.getZoomScale(this._map.getZoom(), 10);
-   var docRight = 
this._map.project(this._map.options.maxBounds.getNorthEast()).subtract(this.options.extraSize.multiplyBy(scale));
+   var docRight = 
this._map.project(this._map.options.docBounds.getNorthEast());
var topRight = docRight.add(L.point(this.options.marginX, 
this.options.marginY));
   

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-12-05 Thread Pranav Kant
 loleaflet/src/control/Control.Menubar.js |   35 ++-
 1 file changed, 21 insertions(+), 14 deletions(-)

New commits:
commit 696343bd65fbba8365dadfa20a0c8856b31a200c
Author: Pranav Kant 
Date:   Mon Dec 4 18:53:40 2017 +0530

lokdialog: Add FormatCellDialog, EditStyle dialog commands to menubar

And restructure menuitems in Calc and Impress. Make them like they are
in the desktop version.

Change-Id: Id52a2946904f0031168dcffcd0ab445f1a07a5bb
(cherry picked from commit 245cb007af729260af8d4f5d33eb0a8f3bccbd13)
(cherry picked from commit 7780608e568da161ef2d4a57364ba8930b1d5494)
Reviewed-on: https://gerrit.libreoffice.org/45805
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index db3a68c2..51aeacf5 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -226,7 +226,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('Paste'), type: 'unocommand', uno: 
'.uno:Paste'},
{name: _('Select all'), type: 'unocommand', 
uno: '.uno:SelectAll'},
{type: 'separator'},
-   {name: _('Find & Replace'), id: 
'.uno:SearchDialog', type: 'dialog'}
+   {name: _('Find & Replace'), id: 
'.uno:SearchDialog', id: 'dialog'}
]},
{name: _('View'), id: 'view', type: 'menu', menu: [
{name: _('Full screen'), id: 'fullscreen', 
type: 'action'},
@@ -241,6 +241,9 @@ L.Control.Menubar = L.Control.extend({
{type: 'separator'},
{name: _('Special character...'), id: 
'specialcharacter', type: 'action'}]
},
+   {name: _('Format'), type: 'menu', menu: [
+   {name: _('Edit Style...'), id: 
'.uno:EditStyle', type: 'dialog'}
+   ]},
{name: _('Tables'), type: 'menu', menu: [
{name: _('Insert'), type: 'menu', menu: [
{name: _('Rows before'), type: 
'unocommand', uno: '.uno:InsertRowsBefore'},
@@ -282,8 +285,8 @@ L.Control.Menubar = L.Control.extend({
{name: _('PDF Document (.pdf)'), id: 
'downloadas-pdf', type: 'action'},
{name: _('ODF spreadsheet (.ods)'), id: 
'downloadas-ods', type: 'action'},
{name: _('Microsoft Excel 2003 
(.xls)'), id: 'downloadas-xls', type: 'action'},
-   {name: _('Microsoft Excel (.xlsx)'), 
id: 'downloadas-xlsx', type: 'action'}]}]
-   },
+   {name: _('Microsoft Excel (.xlsx)'), 
id: 'downloadas-xlsx', type: 'action'}]}
+   ]},
{name: _('Edit'), type: 'menu', menu: [
{name: _('Undo'), type: 'unocommand', uno: 
'.uno:Undo'},
{name: _('Redo'), type: 'unocommand', uno: 
'.uno:Redo'},
@@ -294,11 +297,11 @@ L.Control.Menubar = L.Control.extend({
{name: _('Paste'), type: 'unocommand', uno: 
'.uno:Paste'},
{name: _('Select all'), type: 'unocommand', 
uno: '.uno:SelectAll'},
{type: 'separator'},
-   {name: _('Find & Replace'), id: 
'.uno:SearchDialog', type: 'dialog'}]
-   },
+   {name: _('Find & Replace'), id: 
'.uno:SearchDialog', type: 'dialog'}
+   ]},
{name: _('View'), id: 'view', type: 'menu', menu: [
-   {name: _('Full screen'), id: 'fullscreen', 
type: 'action'}]
-   },
+   {name: _('Full screen'), id: 'fullscreen', 
type: 'action'}
+   ]},
{name: _('Insert'), type: 'menu', menu: [
{name: _('Image'), id: 'insertgraphic', type: 
'action'},
{name: _('Comment...'), id: 'insertcomment', 
type: 'action'},
@@ -306,15 +309,19 @@ L.Control.Menubar = L.Control.extend({
{name: _('Row'), type: 'unocommand', uno: 
'.uno:InsertRows'},
{name: _('Column'), type: 'unocommand', uno: 
'.uno:InsertColumns'},
{type: 'separator'},
-   {name: _('Special character...'), id: 
'specialcharacter', type: 'action'}]
-   },
-  

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-12-04 Thread Marco Cecchetti
 loleaflet/src/control/Control.ColumnHeader.js |5 ++---
 loleaflet/src/control/Control.Header.js   |   17 +
 loleaflet/src/control/Control.RowHeader.js|1 -
 3 files changed, 15 insertions(+), 8 deletions(-)

New commits:
commit a7581752a2c54c01ab51c1d5852f17eaad755220
Author: Marco Cecchetti 
Date:   Sat Dec 2 16:42:31 2017 +0100

loleaflet: calc: some small fixes

- the very last col/row (CTRL+RIGHT/DOWN) had no header
- in some cases DataImpl.getNext() didn't catch that there was no more
header ranges
- parent group of a collapsed group spanning exactly the same range
was not drawn correctly
- removed some console.log code lines
- fixed some typos

Change-Id: I083171c09288081592477d889016910e416ab5b3
Reviewed-on: https://gerrit.libreoffice.org/45788
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.ColumnHeader.js 
b/loleaflet/src/control/Control.ColumnHeader.js
index ae95f183..7b0a25ab 100644
--- a/loleaflet/src/control/Control.ColumnHeader.js
+++ b/loleaflet/src/control/Control.ColumnHeader.js
@@ -406,11 +406,11 @@ L.Control.ColumnHeader = L.Control.Header.extend({
this._data.pushBack(index, headerEntry);
}
 
-   // setup last header headerEntry
+   // setup last header entry
index = nextIndex - this._startHeaderIndex;
pos = parseInt(columns[last].size);
width = pos - prevPos;
-   this._data.pushBack(index, {pos: pos, size: pos - width});
+   this._data.pushBack(index, {pos: pos, size: width});
 
// collect group controls data
if (colGroups !== undefined && this._groups) {
@@ -652,7 +652,6 @@ L.Control.ColumnHeader = L.Control.Header.extend({
var deltaTop = height - this._canvas.height;
var rowHdrTop = parseInt(L.DomUtil.getStyle(rowHeader, 'top')) 
+ deltaTop;
var docTop = parseInt(L.DomUtil.getStyle(document, 'top')) + 
deltaTop;
-   console.log('resize: height: ' + height + ', deltaTop: ' + 
deltaTop + ', rowHdrTop: ' + rowHdrTop + ', docTop: ' + docTop);
L.DomUtil.setStyle(rowHeader, 'top', rowHdrTop + 'px');
L.DomUtil.setStyle(document, 'top', docTop + 'px');
 
diff --git a/loleaflet/src/control/Control.Header.js 
b/loleaflet/src/control/Control.Header.js
index 4bb38769..e77c7799 100644
--- a/loleaflet/src/control/Control.Header.js
+++ b/loleaflet/src/control/Control.Header.js
@@ -555,7 +555,7 @@ L.Control.Header = L.Control.extend({
var startPos = 
this._twipsToPixels(parseInt(groupData.startPos));
var endPos = 
this._twipsToPixels(parseInt(groupData.endPos));
var isHidden = !!parseInt(groupData.hidden);
-   if (isHidden) {
+   if (isHidden || startPos === endPos) {
startPos -= this._groupHeadSize / 2;
endPos = startPos + this._groupHeadSize;
}
@@ -699,7 +699,7 @@ L.Control.Header = L.Control.extend({
return null; // you need to call getFirst on 
initial step
 
this._currentIndex += 1;
-   if (this._currentIndex >= this._endIndex) {
+   if (this._currentIndex > this._endIndex) {
// we iterated over all entries, reset 
everything
this._currentIndex = undefined;
this._currentRange = undefined;
@@ -719,8 +719,17 @@ L.Control.Header = L.Control.extend({
break;
}
}
-   this._currentRange = i;
-   this._currentIndex = index;
+   if (i < len) {
+   this._currentRange = i;
+   this._currentIndex = index;
+   }
+   else {
+   // we iterated over all 
entries, reset everything
+   this._currentIndex = undefined;
+   this._currentRange = undefined;
+   this._skipZeroSize = false;
+   return null;
+   }
}
}
 
diff --git 

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-12-04 Thread Marco Cecchetti
 loleaflet/src/control/Control.Header.js |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 250eda5b800e6f4ac664976cb3e374435f63b857
Author: Marco Cecchetti 
Date:   Fri Dec 1 12:40:05 2017 +0100

loleaflet: calc: fix styles fetching in browsers different from Chrome

'font', 'border-width', 'border-color' are shortcut properties that
are available on Chrome but not on other browsers such as Firefox or
Edge.

Change-Id: I22d2a3db87b9d6f888bd345e06e605530358be51
Reviewed-on: https://gerrit.libreoffice.org/45667
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.Header.js 
b/loleaflet/src/control/Control.Header.js
index 3da83248..4bb38769 100644
--- a/loleaflet/src/control/Control.Header.js
+++ b/loleaflet/src/control/Control.Header.js
@@ -51,10 +51,14 @@ L.Control.Header = L.Control.extend({
var elem = L.DomUtil.create('div', className, baseElem);
this._textColor = L.DomUtil.getStyle(elem, 'color');
this._backgroundColor = L.DomUtil.getStyle(elem, 
'background-color');
-   this._font = L.DomUtil.getStyle(elem, 'font');
-   this._borderColor = L.DomUtil.getStyle(elem, 'border-color');
-   var borderWidth = L.DomUtil.getStyle(elem, 'border-width');
-   this._borderWidth = parseInt(borderWidth.slice(0, -2));
+   var fontFamily = L.DomUtil.getStyle(elem, 'font-family');
+   var fontSize = parseInt(L.DomUtil.getStyle(elem, 'font-size'));
+   var fontHeight = parseInt(L.DomUtil.getStyle(elem, 
'line-height'));
+   var rate = fontHeight / fontSize;
+   this._font = fontSize + 'px/' + rate + ' ' + fontFamily;
+   this._borderColor = L.DomUtil.getStyle(elem, 
'border-top-color');
+   var borderWidth = L.DomUtil.getStyle(elem, 'border-top-width');
+   this._borderWidth = parseInt(borderWidth);
this._cursor = L.DomUtil.getStyle(elem, 'cursor');
L.DomUtil.remove(elem);
},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-11-29 Thread Pranav Kant
 loleaflet/src/control/Control.ContextMenu.js |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit eab55140a698ce9b653367d1956dffe01cc8822a
Author: Pranav Kant 
Date:   Wed Nov 29 19:12:48 2017 +0530

lokdialog: Add some initial spreadsheet, presentation dialogs

Change-Id: I726601533cc8a33d912d42284d5585710036a817
Reviewed-on: https://gerrit.libreoffice.org/45503
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.ContextMenu.js 
b/loleaflet/src/control/Control.ContextMenu.js
index 70f726f9..a2e407f5 100644
--- a/loleaflet/src/control/Control.ContextMenu.js
+++ b/loleaflet/src/control/Control.ContextMenu.js
@@ -35,9 +35,9 @@ L.Control.ContextMenu = L.Control.extend({
   'UpdateCurIndex','RemoveTableOf',
   'ReplyComment', 'DeleteComment', 
'DeleteAuthor', 'DeleteAllNotes'],
 
-   spreadsheet: ['MergeCells', 'SplitCells', 
'RecalcPivotTable'],
+   spreadsheet: ['MergeCells', 'SplitCells', 
'RecalcPivotTable', 'FormatCellDialog'],
 
-   presentation: [],
+   presentation: ['EditStyle'],
drawing: []
}
},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-11-29 Thread Pranav Kant
 loleaflet/src/control/Control.LokDialog.js |   25 
 loleaflet/src/control/Control.Menubar.js   |  152 ++---
 2 files changed, 16 insertions(+), 161 deletions(-)

New commits:
commit 2bf8fc33380edbf2630f6652fc944a005142b7fc
Author: Pranav Kant 
Date:   Wed Nov 29 16:55:05 2017 +0530

lokdialog: Kill Find js code; add/remove dialogs for writer

Change-Id: I3a7bb1ffdb4f50776868fee6eade44f194d290e0
(cherry picked from commit c6a69901fa306a4f27d0319c76f9c842d63727cf)
Reviewed-on: https://gerrit.libreoffice.org/45489
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 0001aa5d..1de74937 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -79,7 +79,7 @@ L.Control.LokDialog = L.Control.extend({
this._sendDialogCommand(e.dialogId, 
this._createRectStr());
} else if (e.action === 'invalidate') {
if (this._isOpen(e.dialogId)) {
-   if (!this._isRectangleValid(e.rectangle))
+   if (e.rectangle && 
!this._isRectangleValid(e.rectangle))
return;
 
if (!e.rectangle)
@@ -269,29 +269,6 @@ L.Control.LokDialog = L.Control.extend({
if (!this._isOpen(dialogId))
return;
 
-   // FIXME: as a precaution, if we get larger width or height 
here than what we got in 'created'
-   // callback, then adjust the dialog canvas size
-   var changed = false;
-   var canvas = document.getElementById(dialogId + '-canvas');
-   if (e.width > this._width) {
-   changed = true;
-   this._width = e.width;
-   canvas.width = e.width;
-   $('#' + dialogId).dialog('option', 'width', e.width);
-   }
-
-   if (e.height > this._height) {
-   changed = true;
-   this._height = e.height;
-   canvas.height = e.height;
-   $('#' + dialogId).dialog('option', 'height', e.height);
-   }
-
-   if (changed) {
-   this._sendDialogCommand(dialogId, 
this._createRectStr());
-   return;
-   }
-
this._paintDialog(dialogId, e.title, e.rectangle, e.dialog);
},
 
diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 28d5491f..db3a68c2 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -35,7 +35,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('Paste'), type: 'unocommand', uno: 
'.uno:Paste'},
{name: _('Select all'), type: 'unocommand', 
uno: '.uno:SelectAll'},
{type: 'separator'},
-   {name: _('Find & Replace'), id: 
'findandreplace', type: 'action'},
+   {name: _('Find & Replace'), id: 
'.uno:SearchDialog', type: 'dialog'},
{type: 'separator'},
{name: _('Track Changes'), type: 'menu', menu: [
{name: _('Record'), type: 'unocommand', 
uno: '.uno:TrackChanges'},
@@ -47,7 +47,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('Previous'), type: 
'unocommand', uno: '.uno:PreviousTrackedChange'},
{name: _('Next'), type: 'unocommand', 
uno: '.uno:NextTrackedChange'}
]},
-   {name: _('ImageMap'), id: 
'.uno:ImageMapDialog', type: 'dialog'}
+   {name: _('Edit Style...'), id: 
'.uno:EditStyle', type: 'dialog'},
]},
{name: _('View'), id: 'view', type: 'menu', menu: [
{name: _('Full screen'), id: 'fullscreen', 
type: 'action'},
@@ -79,9 +79,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('No-width no break'), type: 
'unocommand', uno: '.uno:InsertZWNBSP'},
{name: _('Left-to-right mark'), type: 
'unocommand', uno: '.uno:InsertLRM'},
{name: _('Right-to-left mark'), type: 
'unocommand', uno: '.uno:InsertRLM'}]},
-   {name: _('Field...'), id: '.uno:InsertField', 
type: 'dialog'},
-   {name: _('Index Entry...'), id: 
'.uno:InsertIndexesEntry', type: 

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-11-29 Thread Marco Cecchetti
 loleaflet/src/control/Control.ColumnHeader.js |  181 +---
 loleaflet/src/control/Control.Header.js   |  294 +-
 loleaflet/src/control/Control.RowHeader.js|  166 --
 3 files changed, 435 insertions(+), 206 deletions(-)

New commits:
commit e839abf5376713fb26bf8dc47fb0d31efcabb727
Author: Marco Cecchetti 
Date:   Thu Nov 9 18:58:09 2017 +0100

loleaflet: sc: handle header data subdiveded in ranges

Change-Id: I54b8bc80af91414d8a804e54a478a2eb452510e3
Reviewed-on: https://gerrit.libreoffice.org/45417
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.ColumnHeader.js 
b/loleaflet/src/control/Control.ColumnHeader.js
index 27765ec7..264fea4d 100644
--- a/loleaflet/src/control/Control.ColumnHeader.js
+++ b/loleaflet/src/control/Control.ColumnHeader.js
@@ -57,8 +57,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({
callback: function(key, options) {
var index = 
colHeaderObj._lastMouseOverIndex;
if (index) {
-   var colAlpha = 
colHeaderObj._data[index].text;
-   
colHeaderObj.insertColumn.call(colHeaderObj, colAlpha);
+   
colHeaderObj.insertColumn.call(colHeaderObj, index);
}
}
},
@@ -67,8 +66,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({
callback: function(key, options) {
var index = 
colHeaderObj._lastMouseOverIndex;
if (index) {
-   var colAlpha = 
colHeaderObj._data[index].text;
-   
colHeaderObj.deleteColumn.call(colHeaderObj, colAlpha);
+   
colHeaderObj.deleteColumn.call(colHeaderObj, index);
}
}
},
@@ -77,8 +75,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({
callback: function(key, options) {
var index = 
colHeaderObj._lastMouseOverIndex;
if (index) {
-   var colAlpha = 
colHeaderObj._data[index].text;
-   
colHeaderObj.optimalWidth.call(colHeaderObj, colAlpha);
+   
colHeaderObj.optimalWidth.call(colHeaderObj, index);
}
}
},
@@ -87,8 +84,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({
callback: function(key, options) {
var index = 
colHeaderObj._lastMouseOverIndex;
if (index) {
-   var colAlpha = 
colHeaderObj._data[index].text;
-   
colHeaderObj.hideColumn.call(colHeaderObj, colAlpha);
+   
colHeaderObj.hideColumn.call(colHeaderObj, index);
}
}
},
@@ -97,8 +93,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({
callback: function(key, options) {
var index = 
colHeaderObj._lastMouseOverIndex;
if (index) {
-   var colAlpha = 
colHeaderObj._data[index].text;
-   
colHeaderObj.showColumn.call(colHeaderObj, colAlpha);
+   
colHeaderObj.showColumn.call(colHeaderObj, index);
}
}
}
@@ -107,50 +102,50 @@ L.Control.ColumnHeader = L.Control.Header.extend({
});
},
 
-   optimalWidth: function(colAlpha) {
+   optimalWidth: function(index) {
if (!this._dialog) {
this._dialog = 

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-11-29 Thread Henry Castro
 loleaflet/src/control/Control.Menubar.js |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 18ae59ba846e615f0bfc7503683592838aa18e22
Author: Henry Castro 
Date:   Thu Nov 16 22:22:40 2017 -0400

loleaflet: fix when the language menu item is selected

The languages are translated and ordered.

Change-Id: Id1fd8eec622f3b3ecb5e8da73a386a201b6cee9f
Reviewed-on: https://gerrit.libreoffice.org/45115
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index d94ce7c4..fda37f4b 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -494,8 +494,8 @@ L.Control.Menubar = L.Control.extend({
}
if 
(unoCommand.indexOf('.uno:LanguageStatus') !== -1) {
var lang = 
map['stateChangeHandler'].getItemValue('.uno:LanguageStatus');
-   var label = $(aItem).html();
-   if (label === lang) {
+   var data = 
decodeURIComponent($(aItem).data('uno'));
+   if (data.indexOf(lang) !== -1) {

$(aItem).addClass('lo-menu-item-checked');
} else {

$(aItem).removeClass('lo-menu-item-checked');
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2017-11-16 Thread Andras Timar
 loleaflet/src/map/handler/Map.Scroll.js |   31 ++-
 1 file changed, 2 insertions(+), 29 deletions(-)

New commits:
commit cde2a3c36dd9cad92fc34b3994f3f823b4e2e02d
Author: Andras Timar 
Date:   Thu Nov 16 17:06:39 2017 +0100

Revert "implemented zooming with Ctrl-"

This reverts commit a3c1a685cd4107f229b97619bcce9a3646fc7730.

Change-Id: I81141977d630f95683a372711effcf8d5edd9e20

diff --git a/loleaflet/src/map/handler/Map.Scroll.js 
b/loleaflet/src/map/handler/Map.Scroll.js
index 08722e02..9c584ecc 100644
--- a/loleaflet/src/map/handler/Map.Scroll.js
+++ b/loleaflet/src/map/handler/Map.Scroll.js
@@ -39,17 +39,13 @@ L.Map.Scroll = L.Handler.extend({
var left = Math.max(debounce - (+new Date() - this._startTime), 
0);
 
clearTimeout(this._timer);
-   if (e.ctrlKey) {
-   this._timer = setTimeout(L.bind(this._performZoom, 
this), left);
-   }
-   else if (e.shiftKey) {
+   if (e.shiftKey) {
this._vertical = 0;
-   this._timer = setTimeout(L.bind(this._performScroll, 
this), left);
}
else {
this._vertical = 1;
-   this._timer = setTimeout(L.bind(this._performScroll, 
this), left);
}
+   this._timer = setTimeout(L.bind(this._performScroll, this), 
left);
 
L.DomEvent.stop(e);
},
@@ -64,29 +60,6 @@ L.Map.Scroll = L.Handler.extend({
 
if (!delta) { return; }
map.fire('scrollby', {x: (1 - this._vertical) * delta * 
scrollAmount, y: this._vertical * delta * scrollAmount});
-   },
-
-   _performZoom: function () {
-   var map = this._map,
-   delta = this._delta,
-   zoom = map.getZoom();
-
-   map.stop(); // stop panning and fly animations if any
-
-   delta = delta > 0 ? Math.ceil(delta) : Math.floor(delta);
-   delta = Math.max(Math.min(delta, 4), -4);
-   delta = map._limitZoom(zoom + delta) - zoom;
-
-   this._delta = 0;
-   this._startTime = null;
-
-   if (!delta) { return; }
-
-   if (map.options.scrollWheelZoom === 'center') {
-   map.setZoom(zoom + delta);
-   } else {
-   map.setZoomAround(this._lastMousePos, zoom + delta);
-   }
}
 });
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits