loleaflet/js/toolbar.js | 10 +++++++++- loleaflet/src/map/Map.js | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-)
New commits: commit 966840daa90ba5f80e9bb8cee840cefd0e5dbf23 Author: merttumer <[email protected]> AuthorDate: Mon Jun 10 11:36:15 2019 +0300 Commit: Aron Budea <[email protected]> CommitDate: Wed Oct 9 14:28:18 2019 +0200 Save document before rename for keeping changes Change-Id: Iadd5a93f902f916e1db14c0cafe39b125b531f02 Signed-off-by: merttumer <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/80124 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Aron Budea <[email protected]> diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js index 2dd653d92..620091e9c 100644 --- a/loleaflet/js/toolbar.js +++ b/loleaflet/js/toolbar.js @@ -1342,7 +1342,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); @@ -2130,6 +2132,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 774dab848..8720f3c1e 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -218,7 +218,10 @@ L.Map = L.Evented.extend({ // This becomes true if document was ever modified by the user this._everModified = false; - // Document is completely loaded or not. + // 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; // Unlike _docLoaded, this is flagged only once, _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
