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

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 2 00:44:48 UTC 2020


 loleaflet/src/control/Control.DocumentNameInput.js |    2 +-
 loleaflet/src/control/Control.Toolbar.js           |    7 ++++---
 loleaflet/src/map/Map.js                           |    4 ++--
 3 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 0b80c4b3270f004278521e06afcf3dec6ff99cd9
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Thu Jun 25 21:53:26 2020 -0400
Commit:     Ashod Nakashian <ashnakash at gmail.com>
CommitDate: Thu Jul 2 02:44:29 2020 +0200

    leaflet: set renameFilename before saving
    
    There is a race between the time we set the
    renameFilename value and the uno:Save response
    arrives. If renameFilename is not set by then
    we miss the opportunity to rename and instead
    simply end up saving the file.
    
    Change-Id: I8d7acbc95cef264de4385d506bfa34458ba80283
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97189
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Tested-by: Jenkins
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loleaflet/src/control/Control.DocumentNameInput.js b/loleaflet/src/control/Control.DocumentNameInput.js
index cfc4e5998..3ad053094 100644
--- a/loleaflet/src/control/Control.DocumentNameInput.js
+++ b/loleaflet/src/control/Control.DocumentNameInput.js
@@ -27,8 +27,8 @@ L.Control.DocumentNameInput = L.Control.extend({
 						// same extension, just rename the file
 						// file name must be without the extension for rename
 						value = value.substr(0, value.lastIndexOf('.'));
+						this.map._renameFilename = value;
 						this.map.sendUnoCommand('.uno:Save');
-						this.map._RenameFile = value;
 					}
 				}
 			} else {
diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js
index 1eccdce82..e8dce9bc3 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -924,9 +924,10 @@ function onCommandResult(e) {
 			map._everModified = true;
 
 			// document is saved for rename
-			if (map._RenameFile) {
-				map.renameFile(map._RenameFile);
-				map._RenameFile = '';
+			if (map._renameFilename) {
+				var renameFilename = map._renameFilename;
+				map._renameFilename = '';
+				map.renameFile(renameFilename);
 			}
 		}
 		var postMessageObj = {
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 5f9882a53..285e4954d 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -259,8 +259,8 @@ L.Map = L.Evented.extend({
 		// This becomes true if document was ever modified by the user
 		this._everModified = false;
 
-		// This becomes new file name if document is renamed which used later on uno:Save result
-		this._RenameFile = '';
+		// This is the new file name, if the document is renamed, which is used on uno:Save's result.
+		this._renameFilename = '';
 
 		// Document is completely loaded or not
 		this._docLoaded = false;


More information about the Libreoffice-commits mailing list