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 c56bf54193af8e4bb23aa57b11bdf532228560ae Author: Marco Cecchetti <marco.cecche...@collabora.com> 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/45787 Reviewed-by: Marco Cecchetti <mrcek...@gmail.com> Tested-by: Marco Cecchetti <mrcek...@gmail.com> 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 a/loleaflet/src/control/Control.RowHeader.js b/loleaflet/src/control/Control.RowHeader.js index 1eed7cd0..be49ecf0 100644 --- a/loleaflet/src/control/Control.RowHeader.js +++ b/loleaflet/src/control/Control.RowHeader.js @@ -619,7 +619,6 @@ L.Control.RowHeader = L.Control.Header.extend({ var deltaLeft = width - this._canvas.width; var colHdrLeft = parseInt(L.DomUtil.getStyle(columnHeader, 'left')) + deltaLeft; var docLeft = parseInt(L.DomUtil.getStyle(document, 'left')) + deltaLeft; - console.log('resize: width: ' + width + ', deltaLeft: ' + deltaLeft + ', colHdrLeft: ' + colHdrLeft + ', docLeft: ' + docLeft); L.DomUtil.setStyle(columnHeader, 'left', colHdrLeft + 'px'); L.DomUtil.setStyle(document, 'left', docLeft + 'px'); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits