From 823662ef2f5efe554d92ec590b5a56bf0ae2ca97 Mon Sep 17 00:00:00 2001 From: "Julia.Radzhabova" Date: Fri, 24 Oct 2025 21:38:49 +0300 Subject: [PATCH] Fix Bug 77079 --- .../main/app/controller/LeftMenu.js | 44 ++++++++++++++----- apps/spreadsheeteditor/main/locale/en.json | 1 + apps/spreadsheeteditor/mobile/locale/en.json | 3 +- .../src/controller/settings/Download.jsx | 16 +++++++ 4 files changed, 53 insertions(+), 11 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index 8d171a00d5..7b78451782 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -355,9 +355,27 @@ define([ }); }, + showLostDataWarningOds: function(callback) { + Common.UI.warning({ + title: this.textWarning, + msg: this.warnDownloadOds, + buttons: ['ok', 'cancel'], + maxwidth: 600, + callback: _.bind(function (btn) { + if (btn == 'ok') { + callback.call(); + } + }, this) + }); + }, + clickSaveAsFormat: function(menu, format) { + var me = this, + callback = function () { + me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format)); + menu.hide(); + }; if (format == Asc.c_oAscFileType.CSV) { - var me = this; this.showLostDataWarning(function () { Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.CSV, me.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format)); menu.hide(); @@ -365,15 +383,24 @@ define([ } else if (format == Asc.c_oAscFileType.PDF || format == Asc.c_oAscFileType.PDFA) { menu.hide(); Common.NotificationCenter.trigger('download:settings', this.leftMenu, format); + } else if (format == Asc.c_oAscFileType.ODS) { + this.showLostDataWarningOds(callback); } else { - this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format)); - menu.hide(); + callback(); } }, clickSaveCopyAsFormat: function(menu, format, ext, wopiPath) { + var me = this, + callback = function() { + me.isFromFileDownloadAs = ext; + var options = new Asc.asc_CDownloadOptions(format, true); + options.asc_setIsSaveAs(true); + wopiPath && options.asc_setWopiSaveAsPath(wopiPath); + me.api.asc_DownloadAs(options); + menu.hide(); + }; if (format == Asc.c_oAscFileType.CSV) { - var me = this; me.showLostDataWarning(function () { me.isFromFileDownloadAs = ext; var options = new Asc.asc_CDownloadOptions(format, true); @@ -386,13 +413,10 @@ define([ this.isFromFileDownloadAs = ext; menu.hide(); Common.NotificationCenter.trigger('download:settings', this.leftMenu, format, true, wopiPath); + } else if (format == Asc.c_oAscFileType.ODS) { + this.showLostDataWarningOds(callback); } else { - this.isFromFileDownloadAs = ext; - var options = new Asc.asc_CDownloadOptions(format, true); - options.asc_setIsSaveAs(true); - wopiPath && options.asc_setWopiSaveAsPath(wopiPath); - this.api.asc_DownloadAs(options); - menu.hide(); + callback(); } }, diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 7ac0bc309b..267dbc7404 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1483,6 +1483,7 @@ "SSE.Controllers.LeftMenu.warnDownloadAs": "If you continue saving in this format all features except the text will be lost.
Are you sure you want to continue?", "SSE.Controllers.LeftMenu.warnDownloadCsv": "The CSV format does not support saving a multi-sheet file and all elements, except text.
To save only the active sheet to CSV, press OK.
To save the whole spreadsheet and all features, click Cancel and select another format.", "SSE.Controllers.LeftMenu.warnDownloadCsvSheets": "The CSV format does not support saving a multi-sheet file.
To keep the selected format and save only the current sheet, press Save.
To save the current spreadsheet, click Cancel and save it in a different format.", + "SSE.Controllers.LeftMenu.warnDownloadOds": "Saving this file may result in the loss of some formulas, cell formatting, or embedded objects due to limited format support.
Are you sure you want to continue?", "SSE.Controllers.Main.confirmAddCellWatches": "This action will add {0} cell watches.
Do you want to continue?", "SSE.Controllers.Main.confirmAddCellWatchesMax": "This action will add only {0} cell watches by memory save reason.
Do you want to continue?", "SSE.Controllers.Main.confirmMaxChangesSize": "The size of actions exceeds the limitation set for your server.
Press \"Undo\" to cancel your last action or press \"Continue\" to keep action locally (you need to download the file or copy its content to make sure nothing is lost).", diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json index e7852fe9ca..9ba1301868 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -890,7 +890,8 @@ "txtZh": "Chinese (Simplified)", "txtZhtw": "Chinese (Traditional)", "warnDownloadAs": "If you continue saving in this format all features except the text will be lost.
Are you sure you want to continue?", - "warnDownloadCsv": "The CSV format does not support saving a multi-sheet file and all elements, except text.
To save only the active sheet to CSV, press OK.
To save the whole spreadsheet and all features, click Cancel and select another format." + "warnDownloadCsv": "The CSV format does not support saving a multi-sheet file and all elements, except text.
To save only the active sheet to CSV, press OK.
To save the whole spreadsheet and all features, click Cancel and select another format.", + "warnDownloadOds": "Saving this file may result in the loss of some formulas, cell formatting, or embedded objects due to limited format support.
Are you sure you want to continue?" } } } \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/src/controller/settings/Download.jsx b/apps/spreadsheeteditor/mobile/src/controller/settings/Download.jsx index 4f6886ff95..277b1d1554 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/settings/Download.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/settings/Download.jsx @@ -44,6 +44,22 @@ class DownloadController extends Component { } ] }).open(); + } else if (format == Asc.c_oAscFileType.ODS) { + f7.dialog.create({ + title: _t.notcriticalErrorTitle, + text: _t.warnDownloadOds, + buttons: [ + { + text: _t.textCancel + }, + { + text: _t.textOk, + onClick: () => { + api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format)); + } + } + ] + }).open(); } else { api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format)); }