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

merttumer (via logerrit) logerrit at kemper.freedesktop.org
Wed Oct 9 12:28:05 UTC 2019


 loleaflet/js/toolbar.js  |   10 +++++++++-
 loleaflet/src/map/Map.js |    3 +++
 2 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 11607909fe37af81775d54f20561dfc49be25b2c
Author:     merttumer <mert.tumer at collabora.com>
AuthorDate: Mon Jun 10 11:36:15 2019 +0300
Commit:     Aron Budea <aron.budea at collabora.com>
CommitDate: Wed Oct 9 14:27:47 2019 +0200

    Save document before rename for keeping changes
    
    Change-Id: Iadd5a93f902f916e1db14c0cafe39b125b531f02
    Signed-off-by: merttumer <mert.tumer at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/80096
    Reviewed-by: Aron Budea <aron.budea at collabora.com>
    Tested-by: Aron Budea <aron.budea at collabora.com>

diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 3cc701119..e990b5a80 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -1335,7 +1335,9 @@ function documentNameConfirm() {
 			// file name must be without the extension
 			if (value.lastIndexOf('.') > 0)
 				value = value.substr(0, value.lastIndexOf('.'));
-			map.renameFile(value);
+			
+			map.sendUnoCommand('.uno:Save');
+			map._RenameFile = value;
 		} else {
 			// saveAs for rename
 			map.saveAs(value);
@@ -2122,6 +2124,12 @@ function onCommandResult(e) {
 		if (e.success) {
 			// Saved a new version; the document is modified.
 			map._everModified = true;
+			
+			// document is saved for rename
+			if (map._RenameFile) {
+				map.renameFile(map._RenameFile);
+				map._RenameFile = '';
+			}
 		}
 		var postMessageObj = {
 			success: e.success
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 2c802d5e9..0e7642925 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -204,6 +204,9 @@ 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 = '';
+
 		// Document is completely loaded or not
 		this._docLoaded = false;
 


More information about the Libreoffice-commits mailing list