loleaflet/src/control/Control.ColumnHeader.js | 5 +++++ loleaflet/src/control/Control.Header.js | 22 ++++++++++++++++++++++ loleaflet/src/control/Control.RowHeader.js | 5 +++++ loleaflet/src/layer/tile/CalcTileLayer.js | 9 +++++++++ loolwsd/LOOLWSD.cpp | 8 ++++++-- 5 files changed, 47 insertions(+), 2 deletions(-)
New commits: commit 72ed29ae32cd027023db51b9e3d9708720e9c7b0 Author: Pranav Kant <pran...@collabora.co.uk> Date: Tue Nov 1 10:25:29 2016 +0100 loolwsd: Tentative fix for 'Address already in use' (cherry picked from commit 86383d40db00931243c9c2c85655aaee30558de3) diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp index 3956e29..1eb68e3 100644 --- a/loolwsd/LOOLWSD.cpp +++ b/loolwsd/LOOLWSD.cpp @@ -65,6 +65,7 @@ #include <Poco/Net/HTTPServerRequest.h> #include <Poco/Net/HTTPServerResponse.h> #include <Poco/Net/InvalidCertificateHandler.h> +#include <Poco/Net/IPAddress.h> #include <Poco/Net/KeyConsoleHandler.h> #include <Poco/Net/MessageHeader.h> #include <Poco/Net/NameValueCollection.h> @@ -1317,8 +1318,11 @@ static inline ServerSocket* getServerSocket(int nClientPortNumber) try { ServerSocket* socket = LOOLWSD::isSSLEnabled() ? new SecureServerSocket() : new ServerSocket(); - socket->bind(nClientPortNumber, false); - + Poco::Net::IPAddress wildcardAddr; + SocketAddress address(wildcardAddr, nClientPortNumber); + socket->init(address.af()); + socket->setReuseAddress(true); + socket->bind(address, false); // 64 is the default value for the backlog parameter in Poco // when creating a ServerSocket, so use it here, too. socket->listen(64); commit 1e9ea4de8d5d07298c921d6ac6e5b8815cf62739 Author: Henry Castro <hcas...@collabora.com> Date: Mon Oct 31 21:37:27 2016 -0400 loleaflet: row/column highlighting to reflect the cell cursor (cherry picked from commit 2c5cbe6555a1e195b55d21baf39bb7625c5c7366) diff --git a/loleaflet/src/control/Control.ColumnHeader.js b/loleaflet/src/control/Control.ColumnHeader.js index e6e1351..4629de7 100644 --- a/loleaflet/src/control/Control.ColumnHeader.js +++ b/loleaflet/src/control/Control.ColumnHeader.js @@ -21,6 +21,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({ this._map.on('viewrowcolumnheaders', this.viewRowColumnHeaders, this); this._map.on('updateselectionheader', this._onUpdateSelection, this); this._map.on('clearselectionheader', this._onClearSelection, this); + this._map.on('updatecurrentheader', this._onUpdateCurrentColumn, this); var docContainer = this._map.options.documentContainer; var cornerHeader = L.DomUtil.create('div', 'spreadsheet-header-corner', docContainer.parentElement); L.DomEvent.addListener(cornerHeader, 'click', this._onCornerHeaderClick, this); @@ -154,6 +155,10 @@ L.Control.ColumnHeader = L.Control.Header.extend({ this.updateSelection(this._columns, e.start.x, e.end.x); }, + _onUpdateCurrentColumn: function (e) { + this.updateCurrent(this._columns, e.x); + }, + viewRowColumnHeaders: function (e) { this.fillColumns(e.data.columns, e.converter, e.context); }, diff --git a/loleaflet/src/control/Control.Header.js b/loleaflet/src/control/Control.Header.js index c56e554..7c33148 100644 --- a/loleaflet/src/control/Control.Header.js +++ b/loleaflet/src/control/Control.Header.js @@ -9,6 +9,7 @@ L.Control.Header = L.Control.extend({ initialize: function () { this._clicks = 0; + this._current = -1; this._selection = {start: -1, end: -1}; }, @@ -71,6 +72,27 @@ L.Control.Header = L.Control.extend({ this._selection.end = itEnd; }, + updateCurrent: function (element, start) { + var childs = element.children; + if (start < 0) { + this.unselect(childs[this._current]); + this._current = -1; + return; + } + + var x0 = 0, x1 = 0; + for (var iterator = 0, len = childs.length; iterator < len; iterator++) { + x0 = (iterator > 0 ? childs[iterator - 1].size : 0); + x1 = childs[iterator].size; + if (x0 <= start && start <= x1) { + this.unselect(childs[this._current]); + this.select(childs[iterator]); + this._current = iterator; + break; + } + } + }, + _onMouseDown: function (e) { var target = e.target || e.srcElement; diff --git a/loleaflet/src/control/Control.RowHeader.js b/loleaflet/src/control/Control.RowHeader.js index 8575a24..d14e45c 100644 --- a/loleaflet/src/control/Control.RowHeader.js +++ b/loleaflet/src/control/Control.RowHeader.js @@ -21,6 +21,7 @@ L.Control.RowHeader = L.Control.Header.extend({ this._map.on('viewrowcolumnheaders', this.viewRowColumnHeaders, this); this._map.on('updateselectionheader', this._onUpdateSelection, this); this._map.on('clearselectionheader', this._onClearSelection, this); + this._map.on('updatecurrentheader', this._onUpdateCurrentRow, this); var docContainer = this._map.options.documentContainer; var headersContainer = L.DomUtil.create('div', 'spreadsheet-header-rows-container', docContainer.parentElement); this._rows = L.DomUtil.create('div', 'spreadsheet-header-rows', headersContainer); @@ -150,6 +151,10 @@ L.Control.RowHeader = L.Control.Header.extend({ this.updateSelection(this._rows, e.start.y, e.end.y); }, + _onUpdateCurrentRow: function (e) { + this.updateCurrent(this._rows, e.y); + }, + viewRowColumnHeaders: function (e) { this.fillRows(e.data.rows, e.converter, e.context); }, diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index 237fb92..b66a657 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -233,5 +233,14 @@ L.CalcTileLayer = L.TileLayer.extend({ _onTextSelectionMsg: function (textMsg) { L.TileLayer.prototype._onTextSelectionMsg.call(this, textMsg); this._onUpdateSelectionHeader(); + }, + + _onCellCursorMsg: function (textMsg) { + var pos = new L.Point(-1, -1); + L.TileLayer.prototype._onCellCursorMsg.call(this, textMsg); + if (this._cellCursor && !this._isEmptyRectangle(this._cellCursor)) { + pos = this._cellCursorTwips.min.add([1, 1]); + } + this._map.fire('updatecurrentheader', pos); } }); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits