[Libreoffice-commits] online.git: loleaflet/src
Andras Timar (via logerrit)
logerrit at kemper.freedesktop.org
Tue Feb 11 08:10:57 UTC 2020
loleaflet/src/layer/tile/TileLayer.js | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
New commits:
commit 36eed0c6f07cef512ec83fb8c22d2c6200e7ce5c
Author: Andras Timar <andras.timar at collabora.com>
AuthorDate: Mon Feb 10 23:22:41 2020 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Feb 11 09:10:39 2020 +0100
tdf#123892 deduplicate entries in Get_Export_Formats_Resp
Change-Id: I6eaa3f0c1529b968b8eaa7ea67356dd5bf54d3f1
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88418
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 8748b4012..86471ef82 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -462,7 +462,17 @@ L.TileLayer = L.GridLayer.extend({
this._exportFormats = [];
}
- this._exportFormats.push({label: label, format: format});
+ var duplicate = false;
+ for (var i = 0; i < this._exportFormats.length; i++) {
+ if (this._exportFormats[i].label == label && this._exportFormats[i].format == format) {
+ duplicate = true;
+ break;
+ }
+ }
+
+ if (duplicate == false) {
+ this._exportFormats.push({label: label, format: format});
+ }
},
setUrl: function (url, noRedraw) {
More information about the Libreoffice-commits
mailing list