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

Pranav Kant pranavk at collabora.co.uk
Thu Apr 20 10:17:15 UTC 2017


 loleaflet/src/layer/AnnotationManager.js |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

New commits:
commit a3850d67b9b7d36566fdb02e8141303e2ce008ff
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Thu Apr 20 12:42:16 2017 +0530

    loleaflet: Fix incorrect variable usage in this loop
    
    Change-Id: I586ad59874b901d31b6e138a74577ecf3e1920c3
    (cherry picked from commit ee683c106cd8421600b2141cb43c25e5e8dd1af0)
    Reviewed-on: https://gerrit.libreoffice.org/36724
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js
index e739930d..88fbcaba 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -280,7 +280,7 @@ L.AnnotationManager = L.Class.extend({
 		var scale = this._map.getZoomScale(this._map.getZoom(), 10);
 		var docRight = this._map.project(this._map.options.maxBounds.getNorthEast()).subtract(this.options.extraSize.multiplyBy(scale));
 		var topRight = docRight.add(L.point(this.options.marginX, this.options.marginY));
-		var latlng, layoutBounds, point, index;
+		var latlng, layoutBounds, point, idx;
 		if (this._selected) {
 			var selectIndexFirst = this.getRootIndexOf(this._selected._data.id);
 			var selectIndexLast = this.getLastChildIndexOf(this._selected._data.id);
@@ -293,7 +293,7 @@ L.AnnotationManager = L.Class.extend({
 			layoutBounds = this._items[selectIndexFirst].getBounds();
 
 			// Adjust child comments too, if any
-			for (var idx = selectIndexFirst + 1; idx <= selectIndexLast; idx++) {
+			for (idx = selectIndexFirst + 1; idx <= selectIndexLast; idx++) {
 				if (zoom) {
 					this._items[idx]._data.anchorPix = this._map._docLayer._twipsToPixels(this._items[idx]._data.anchorPos.min);
 				}
@@ -310,9 +310,9 @@ L.AnnotationManager = L.Class.extend({
 			layoutBounds.max = layoutBounds.max.add([this.options.marginX, 0]);
 			layoutBounds.extend(layoutBounds.min.subtract([0, this.options.marginY]));
 			layoutBounds.extend(layoutBounds.max.add([0, this.options.marginY]));
-			for (index = selectIndexFirst - 1; index >= 0;) {
+			for (idx = selectIndexFirst - 1; idx >= 0;) {
 				var commentThread = [];
-				var tmpIdx = index;
+				var tmpIdx = idx;
 				do {
 					if (zoom) {
 						this._items[idx]._data.anchorPix = this._map._docLayer._twipsToPixels(this._items[idx]._data.anchorPos.min);
@@ -324,11 +324,11 @@ L.AnnotationManager = L.Class.extend({
 				commentThread.reverse();
 				// All will have some anchor position
 				this.layoutUp(commentThread, this._map.unproject(L.point(topRight.x, commentThread[0]._data.anchorPix.y)), layoutBounds);
-				index = index - commentThread.length;
+				idx = idx - commentThread.length;
 			}
-			for (index = selectIndexLast + 1; index < this._items.length;) {
+			for (idx = selectIndexLast + 1; idx < this._items.length;) {
 				commentThread = [];
-				tmpIdx = index;
+				tmpIdx = idx;
 				do {
 					if (zoom) {
 						this._items[idx]._data.anchorPix = this._map._docLayer._twipsToPixels(this._items[idx]._data.anchorPos.min);
@@ -339,7 +339,7 @@ L.AnnotationManager = L.Class.extend({
 
 				// All will have some anchor position
 				this.layoutDown(commentThread, this._map.unproject(L.point(topRight.x, commentThread[0]._data.anchorPix.y)), layoutBounds);
-				index = index + commentThread.length;
+				idx = idx + commentThread.length;
 			}
 			if (!this._selected.isEdit()) {
 				this._selected.show();
@@ -347,9 +347,9 @@ L.AnnotationManager = L.Class.extend({
 		} else {
 			point = this._map.latLngToLayerPoint(this._map.unproject(topRight));
 			layoutBounds = L.bounds(point, point);
-			for (index = 0; index < this._items.length;) {
+			for (idx = 0; idx < this._items.length;) {
 				commentThread = [];
-				tmpIdx = index;
+				tmpIdx = idx;
 				do {
 					if (zoom) {
 						this._items[tmpIdx]._data.anchorPix = this._map._docLayer._twipsToPixels(this._items[tmpIdx]._data.anchorPos.min);
@@ -359,7 +359,7 @@ L.AnnotationManager = L.Class.extend({
 				} while (tmpIdx < this._items.length && this._items[tmpIdx]._data.parent === this._items[tmpIdx - 1]._data.id);
 
 				this.layoutDown(commentThread, this._map.unproject(L.point(topRight.x, commentThread[0]._data.anchorPix.y)), layoutBounds);
-				index = index + commentThread.length;
+				idx = idx + commentThread.length;
 			}
 		}
 	},


More information about the Libreoffice-commits mailing list