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

Jan Holesovsky kendy at collabora.com
Thu Dec 10 12:43:10 PST 2015


 loleaflet/src/layer/tile/TileLayer.js |    2 +-
 loolwsd/TileCache.cpp                 |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 00d7ab35195b437c54cc9359dac8f830f5b98471
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Thu Dec 10 21:41:26 2015 +0100

    loleaflet: Change !(... >= 0) to ... < 0 for readability.

diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index d68df14..30afa3e 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -949,7 +949,7 @@ L.TileLayer = L.GridLayer.extend({
 
 	_onCurrentPageUpdate: function () {
 		var mapCenter = this._map.project(this._map.getCenter());
-		if (!this._partPageRectanglesPixels || !(this._currentPage >= 0) || this._currentPage >= this._partPageRectanglesPixels.length ||
+		if (!this._partPageRectanglesPixels || this._currentPage < 0 || this._currentPage >= this._partPageRectanglesPixels.length ||
 				this._partPageRectanglesPixels[this._currentPage].contains(mapCenter)) {
 			// page number has not changed
 			return;
commit 50e6272440beded0529d9bfddfcd5cbbcfddfe94
Author: Ashod Nakashian <ashodnakashian at yahoo.com>
Date:   Wed Dec 9 23:51:11 2015 -0500

    Fixes to get a consistently working state
    
    Fixed a javascript error and a more serious referencing
    of the memory of a temp string, which resulted in
    random behavior.
    
    When the memory was null, it failed to load any
    documents in the browser. Otherwise, accidentally,
    when it wasn't, it would load the document (rarely).

diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 1810ca3..d68df14 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -949,7 +949,7 @@ L.TileLayer = L.GridLayer.extend({
 
 	_onCurrentPageUpdate: function () {
 		var mapCenter = this._map.project(this._map.getCenter());
-		if (!this._partPageRectanglesPixels || !(this._currentPage >= 0) ||
+		if (!this._partPageRectanglesPixels || !(this._currentPage >= 0) || this._currentPage >= this._partPageRectanglesPixels.length ||
 				this._partPageRectanglesPixels[this._currentPage].contains(mapCenter)) {
 			// page number has not changed
 			return;
diff --git a/loolwsd/TileCache.cpp b/loolwsd/TileCache.cpp
index d978bd2..3bd5939 100644
--- a/loolwsd/TileCache.cpp
+++ b/loolwsd/TileCache.cpp
@@ -108,7 +108,7 @@ void TileCache::saveTile(int part, int width, int height, int tilePosX, int tile
 
 std::string TileCache::getTextFile(std::string fileName)
 {
-    const char *textFile = std::string("/" + fileName).c_str();
+    const auto textFile = std::string("/" + fileName);
 
     std::string dirName = cacheDirName(false);
     if (_hasUnsavedChanges)


More information about the Libreoffice-commits mailing list