[Libreoffice-commits] online.git: 2 commits - loleaflet/src

Pranav Kant pranavk at collabora.co.uk
Thu Apr 20 07:14:18 UTC 2017


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

New commits:
commit ee683c106cd8421600b2141cb43c25e5e8dd1af0
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

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;
 			}
 		}
 	},
commit 702bcdcf8d178fd8e82dafbcc6e9c41b5a55d4c9
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Thu Apr 20 12:39:43 2017 +0530

    Surely, it is supposed to be update, not upate
    
    Change-Id: I5d576ec0ae6976cb915b1c458546bbf82bf9fe8f

diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js
index 05ad8416..e739930d 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -116,7 +116,7 @@ L.AnnotationManager = L.Class.extend({
 			this._items.push(L.annotation(this._map.options.maxBounds.getSouthEast(), changecomment).addTo(this._map));
 		}
 		if (this._items.length > 0) {
-			this._map._docLayer._upateMaxBounds(true);
+			this._map._docLayer._updateMaxBounds(true);
 			this.layout();
 		}
 	},


More information about the Libreoffice-commits mailing list