loleaflet/src/control/Control.Toolbar.js | 10 +++++++++- loleaflet/src/map/Map.js | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-)
New commits: commit 5570787c708e08388314608631498324a49d1d38 Author: merttumer <mert.tu...@collabora.com> AuthorDate: Mon Jun 10 11:36:15 2019 +0300 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Fri Oct 4 15:06:57 2019 +0200 Save document before rename for keeping changes Change-Id: Iadd5a93f902f916e1db14c0cafe39b125b531f02 Signed-off-by: merttumer <mert.tu...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/80136 Reviewed-by: Michael Meeks <michael.me...@collabora.com> Tested-by: Michael Meeks <michael.me...@collabora.com> diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index c38f57045..3c96c905a 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -1193,7 +1193,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); @@ -1958,6 +1960,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 8048889d3..366c62453 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -231,7 +231,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 libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits