[Libreoffice-commits] online.git: 3 commits - loleaflet/build loleaflet/dist loleaflet/src loolwsd/bundled loolwsd/LOOLSession.cpp
Andras Timar
andras.timar at collabora.com
Wed Dec 2 07:46:52 PST 2015
loleaflet/build/deps.js | 2
loleaflet/dist/leaflet.css | 7 -
loleaflet/src/control/Control.ColRowHeader.js | 69 ----------------
loleaflet/src/control/Control.ColumnHeader.js | 13 +--
loleaflet/src/control/Control.RowHeader.js | 12 +-
loleaflet/src/layer/tile/TileLayer.js | 12 --
loolwsd/LOOLSession.cpp | 12 --
loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKit.h | 3
8 files changed, 17 insertions(+), 113 deletions(-)
New commits:
commit 84de61f3b4d71ea46d1e3990e8f28bf4ba1e536d
Author: Andras Timar <andras.timar at collabora.com>
Date: Wed Dec 2 16:46:30 2015 +0100
Revert "loolwsd: update bundled headers"
This reverts commit 9bcde92f5084c35f0800df5b40ccd6ef5630aa59.
diff --git a/loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKit.h
index 016caf4..a78c0aa 100644
--- a/loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKit.h
@@ -148,8 +148,7 @@ struct _LibreOfficeKitDocumentClass
int nY,
int nCount,
int nButtons,
- int nModifier,
- const char* pTargetWindow);
+ int nModifier);
/// @see lok::Document::postUnoCommand
void (*postUnoCommand) (LibreOfficeKitDocument* pThis,
commit 4f2d9b02e5946cc278fc5c0cd4140f4d50389a85
Author: Andras Timar <andras.timar at collabora.com>
Date: Wed Dec 2 16:46:25 2015 +0100
Revert "loolwsd: add support for postMouseEvent's targetwindow"
This reverts commit d1b39e39e86c4e5bc58dfffdceed2ac6b4d95606.
diff --git a/loolwsd/LOOLSession.cpp b/loolwsd/LOOLSession.cpp
index 17bac85..9708131 100644
--- a/loolwsd/LOOLSession.cpp
+++ b/loolwsd/LOOLSession.cpp
@@ -1372,9 +1372,8 @@ bool ChildProcessSession::keyEvent(const char* /*buffer*/, int /*length*/, Strin
bool ChildProcessSession::mouseEvent(const char* /*buffer*/, int /*length*/, StringTokenizer& tokens)
{
int type, x, y, count, buttons, modifier;
- std::string targetwindow;
- if (((tokens.count() != 7 && tokens.count() != 8)) ||
+ if (tokens.count() != 7 ||
!getTokenKeyword(tokens[1], "type",
{{"buttondown", LOK_MOUSEEVENT_MOUSEBUTTONDOWN},
{"buttonup", LOK_MOUSEEVENT_MOUSEBUTTONUP},
@@ -1390,14 +1389,7 @@ bool ChildProcessSession::mouseEvent(const char* /*buffer*/, int /*length*/, Str
return false;
}
- // target window parameter is optional - LOK assumes
- // document if not specified.
- if (tokens.count() == 8)
- {
- getTokenString(tokens[7], "targetwindow", targetwindow);
- }
-
- _loKitDocument->pClass->postMouseEvent(_loKitDocument, type, x, y, count, buttons, modifier, targetwindow.c_str());
+ _loKitDocument->pClass->postMouseEvent(_loKitDocument, type, x, y, count, buttons, modifier);
return true;
}
commit 19c31873717ca00406d63ae1697cb46a182f0e2f
Author: Andras Timar <andras.timar at collabora.com>
Date: Wed Dec 2 16:46:17 2015 +0100
Revert "loleaflet: add column/row-header selection support"
This reverts commit db02f8795b346c76a3ddbdfc55016a92207a0e98.
diff --git a/loleaflet/build/deps.js b/loleaflet/build/deps.js
index 657ad69..9f433ac 100644
--- a/loleaflet/build/deps.js
+++ b/loleaflet/build/deps.js
@@ -284,7 +284,6 @@ var deps = {
ControlColumnHeader: {
src: ['control/Control.js',
- 'control/Control.ColRowHeader.js',
'control/Control.ColumnHeader.js'],
heading: 'Controls',
desc: 'Column Header bar'
@@ -292,7 +291,6 @@ var deps = {
ControlRowHeader: {
src: ['control/Control.js',
- 'control/Control.ColRowHeader.js',
'control/Control.RowHeader.js'],
heading: 'Controls',
desc: 'Row Header bar'
diff --git a/loleaflet/dist/leaflet.css b/loleaflet/dist/leaflet.css
index 1c44072..d31be8a 100644
--- a/loleaflet/dist/leaflet.css
+++ b/loleaflet/dist/leaflet.css
@@ -785,13 +785,6 @@ a.leaflet-control-buttons:hover:first-child {
overflow: hidden;
}
-.spreadsheet-table-noselect {
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
- -webkit-user-drag: none;
- }
-
.spreadsheet-table-column {
table-layout: fixed;
left: 0px;
diff --git a/loleaflet/src/control/Control.ColRowHeader.js b/loleaflet/src/control/Control.ColRowHeader.js
deleted file mode 100644
index 2068d69..0000000
--- a/loleaflet/src/control/Control.ColRowHeader.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * L.Control.ColRowHeader
- *
- * Provides common methods for the column and row headers.
- */
-
-L.Control.ColRowHeader = L.Control.extend({
-
- LOButtons: {
- left: 1,
- middle: 2,
- right: 4
- },
-
- JSButtons: {
- left: 0,
- middle: 1,
- right: 2
- },
-
- _initializeColRowBar: function(type) {
- this._type = type;
- L.DomEvent.on(this._table, 'mousedown', this._onMouseEvent, this);
- L.DomEvent.on(this._table, 'mouseup', this._onMouseEvent, this);
- },
-
- // Avoid sending mouse move events when we don't have a button down (they are just
- // ignored client side).
- _enableMouseMove: function(enable) {
- if (enable === false) {
- L.DomEvent.off(this._table, 'mousemove', this._onMouseEvent, this);
- } else {
- L.DomEvent.on(this._table, 'mousemove', this._onMouseEvent, this);
- }
- },
-
- _onMouseEvent: function(e) {
- var docLayer = this._map._docLayer;
- if (!docLayer) {
- return;
- }
-
- var mousePos = docLayer._latLngToTwips(this._map.containerPointToLatLng(this._map.mouseEventToContainerPoint(e)));
- var modifier = this._map.keyboard.modifier;
- if (e.type === 'mousemove') {
- docLayer._postMouseEvent('move', mousePos.x, mousePos.y, 1, this._cachedButtons, modifier, this._type);
- return;
- }
-
- var buttons = 0;
- buttons |= e.button === this.JSButtons.left ? this.LOButtons.left : 0;
- buttons |= e.button === this.JSButtons.middle ? this.LOButtons.middle : 0;
- buttons |= e.button === this.JSButtons.right ? this.LOButtons.right : 0;
-
- if (e.type === 'mousedown') {
- this._enableMouseMove(true);
- this._cachedButtons = buttons;
- docLayer._postMouseEvent('buttondown', mousePos.x, mousePos.y, 1, buttons, modifier, this._type);
- } else if (e.type === 'mouseup') {
- this._enableMouseMove(false);
- docLayer._postMouseEvent('buttonup', mousePos.x, mousePos.y, 1, buttons, modifier, this._type);
- }
- },
-
-});
-
-L.colrowheader = function (options) {
- return new L.ColRowHeader(options);
-};
\ No newline at end of file
diff --git a/loleaflet/src/control/Control.ColumnHeader.js b/loleaflet/src/control/Control.ColumnHeader.js
index a6746b9..17d9082 100644
--- a/loleaflet/src/control/Control.ColumnHeader.js
+++ b/loleaflet/src/control/Control.ColumnHeader.js
@@ -2,8 +2,7 @@
* Control.ColumnHeader
*/
-L.Control.ColumnHeader = L.Control.ColRowHeader.extend({
-
+L.Control.ColumnHeader = L.Control.extend({
onAdd: function () {
var docContainer = L.DomUtil.get('document-container');
var divHeader = L.DomUtil.create('div', 'spreadsheet-container-column', docContainer.parentElement);
@@ -23,10 +22,8 @@ L.Control.ColumnHeader = L.Control.ColRowHeader.extend({
this._viewPort = 0;
// dummy initial header
- var dummy = L.DomUtil.create('th', 'spreadsheet-table-column-cell spreadsheet-table-noselect', this._columns);
- L.DomUtil.create('div', 'spreadsheet-table-column-cell-text spreadsheet-table-noselect', dummy);
-
- this._initializeColRowBar('colbar');
+ var dummy = L.DomUtil.create('th', 'spreadsheet-table-column-cell', this._columns);
+ L.DomUtil.create('div', 'spreadsheet-table-column-cell-text', dummy);
return document.createElement('div');
},
@@ -60,8 +57,8 @@ L.Control.ColumnHeader = L.Control.ColRowHeader.extend({
for (iterator = 0; iterator < columns.length; iterator++) {
width = columns[iterator].size - (iterator > 0 ? columns[iterator - 1].size : 0);
twip = new L.Point(width, width);
- column = L.DomUtil.create('th', 'spreadsheet-table-column-cell spreadsheet-table-noselect', this._columns);
- text = L.DomUtil.create('div', 'spreadsheet-table-column-cell-text spreadsheet-table-noselect', column);
+ column = L.DomUtil.create('th', 'spreadsheet-table-column-cell', this._columns);
+ text = L.DomUtil.create('div', 'spreadsheet-table-column-cell-text', column);
text.innerHTML = columns[iterator].text;
column.width = Math.round(converter.call(context, twip).x) - 1 + 'px';
}
diff --git a/loleaflet/src/control/Control.RowHeader.js b/loleaflet/src/control/Control.RowHeader.js
index 8700c65..c4fab2a 100644
--- a/loleaflet/src/control/Control.RowHeader.js
+++ b/loleaflet/src/control/Control.RowHeader.js
@@ -2,7 +2,7 @@
* L.Control.RowHeader
*/
-L.Control.RowHeader = L.Control.ColRowHeader.extend({
+L.Control.RowHeader = L.Control.extend({
onAdd: function () {
var docContainer = L.DomUtil.get('document-container');
var divRowHeader = L.DomUtil.create('div', 'spreadsheet-container-row', docContainer.parentElement);
@@ -15,10 +15,8 @@ L.Control.RowHeader = L.Control.ColRowHeader.extend({
// dummy initial row header
var trRow = L.DomUtil.create('tr', '', this._rows);
- var thRow = L.DomUtil.create('th', 'spreadsheet-table-row-cell spreadsheet-table-noselect', trRow);
- L.DomUtil.create('div', 'spreadsheet-table-row-cell-text spreadsheet-table-noselect', thRow);
-
- this._initializeColRowBar('rowbar');
+ var thRow = L.DomUtil.create('th', 'spreadsheet-table-row-cell', trRow);
+ L.DomUtil.create('div', 'spreadsheet-table-row-cell-text', thRow);
return document.createElement('div');
},
@@ -53,8 +51,8 @@ L.Control.RowHeader = L.Control.ColRowHeader.extend({
height = rows[iterator].size - (iterator > 0 ? rows[iterator - 1].size : 0);
twip = new L.Point(height, height);
row = L.DomUtil.create('tr', '', this._rows);
- cell = L.DomUtil.create('th', 'spreadsheet-table-row-cell spreadsheet-table-noselect', row);
- text = L.DomUtil.create('div', 'spreadsheet-table-row-cell-text spreadsheet-table-noselect', cell);
+ cell = L.DomUtil.create('th', 'spreadsheet-table-row-cell', row);
+ text = L.DomUtil.create('div', 'spreadsheet-table-row-cell-text', cell);
text.innerHTML = rows[iterator].text;
height = Math.round(converter.call(context, twip).y) - (iterator > 0 ? 1 : 0) + 'px';
L.DomUtil.setStyle(text, 'line-height', height);
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 6f05a2f..1810ca3 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -660,19 +660,15 @@ L.TileLayer = L.GridLayer.extend({
this._onUpdateCellCursor();
},
- _postMouseEvent: function(type, x, y, count, buttons, modifier, targetwindow) {
+ _postMouseEvent: function(type, x, y, count, buttons, modifier) {
if (this._clientZoom) {
// the zoom level has changed
L.Socket.sendMessage('clientzoom ' + this._clientZoom);
this._clientZoom = null;
}
- var message = 'mouse type=' + type +
- ' x=' + x + ' y=' + y + ' count=' + count +
- ' buttons=' + buttons + ' modifier=' + modifier;
- if (targetwindow) {
- message += ' targetwindow=' + targetwindow;
- }
- L.Socket.sendMessage(message);
+ L.Socket.sendMessage('mouse type=' + type +
+ ' x=' + x + ' y=' + y + ' count=' + count +
+ ' buttons=' + buttons + ' modifier=' + modifier);
},
_postKeyboardEvent: function(type, charcode, keycode) {
More information about the Libreoffice-commits
mailing list