loleaflet/src/layer/tile/TileLayer.js | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-)
New commits: commit e61d8aaa5f3baa27651338b1074ccda3ecbaa8fb Author: Marco Cecchetti <marco.cecche...@collabora.com> Date: Mon Oct 17 12:36:50 2016 +0200 loleaflet: handle EMPTY invalid tiles msg with part in the payload Change-Id: I73e363f51101c8e4e258131ea1692a7709d6a544 Reviewed-on: https://gerrit.libreoffice.org/29964 Reviewed-by: Marco Cecchetti <mrcek...@gmail.com> Tested-by: Marco Cecchetti <mrcek...@gmail.com> diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index dfe8b7a..d8836d5 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -304,21 +304,24 @@ L.TileLayer = L.GridLayer.extend({ else if (textMsg.startsWith('invalidatecursor:')) { this._onInvalidateCursorMsg(textMsg); } - else if (textMsg.startsWith('invalidatetiles:') && !textMsg.startsWith('EMPTY')) { - this._onInvalidateTilesMsg(textMsg); - } - else if (textMsg.startsWith('invalidatetiles:') && textMsg.startsWith('EMPTY')) { - var msg = 'invalidatetiles: '; - if (this._docType === 'text') { - msg += 'part=0 '; - } else { - var partNumber = parseInt(textMsg.substring(6)); - msg += 'part=' + (isNaN(partNumber) ? this._selectedPart : partNumber) + ' '; + else if (textMsg.startsWith('invalidatetiles:')) { + var payload = textMsg.substring('invalidatetiles:'.length + 1); + if (!payload.startsWith('EMPTY')) { + this._onInvalidateTilesMsg(textMsg); + } + else { + var msg = 'invalidatetiles: '; + if (this._docType === 'text') { + msg += 'part=0 '; + } else { + var partNumber = parseInt(payload.substring('EMPTY'.length + 1)); + msg += 'part=' + (isNaN(partNumber) ? this._selectedPart : partNumber) + ' '; + } + msg += 'x=0 y=0 '; + msg += 'width=' + this._docWidthTwips + ' '; + msg += 'height=' + this._docHeightTwips; + this._onInvalidateTilesMsg(msg); } - msg += 'x=0 y=0 '; - msg += 'width=' + this._docWidthTwips + ' '; - msg += 'height=' + this._docHeightTwips; - this._onInvalidateTilesMsg(msg); } else if (textMsg.startsWith('mousepointer:')) { this._onMousePointerMsg(textMsg); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits