[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4-0' - loleaflet/src

Andras Timar (via logerrit) logerrit at kemper.freedesktop.org
Thu Mar 12 07:53:29 UTC 2020


 loleaflet/src/layer/tile/TileLayer.js |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 222407deb08898399a9ee8cec7f40c1417c50bd1
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: Thu Mar 12 08:53:09 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>
    (cherry picked from commit 36eed0c6f07cef512ec83fb8c22d2c6200e7ce5c)
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89909

diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 2fb2cb859..b940567dc 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -320,7 +320,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