Fix Bug 77079

This commit is contained in:
Julia.Radzhabova
2025-10-24 21:38:49 +03:00
parent 81440216c1
commit 823662ef2f
4 changed files with 53 additions and 11 deletions

View File

@ -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();
}
},

View File

@ -1483,6 +1483,7 @@
"SSE.Controllers.LeftMenu.warnDownloadAs": "If you continue saving in this format all features except the text will be lost.<br>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.<br>To save only the active sheet to CSV, press OK.<br>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.<br>To keep the selected format and save only the current sheet, press Save.<br>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.<br>Are you sure you want to continue?",
"SSE.Controllers.Main.confirmAddCellWatches": "This action will add {0} cell watches.<br>Do you want to continue?",
"SSE.Controllers.Main.confirmAddCellWatchesMax": "This action will add only {0} cell watches by memory save reason.<br>Do you want to continue?",
"SSE.Controllers.Main.confirmMaxChangesSize": "The size of actions exceeds the limitation set for your server.<br>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).",

View File

@ -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.<br>Are you sure you want to continue?",
"warnDownloadCsv": "The CSV format does not support saving a multi-sheet file and all elements, except text.<br>To save only the active sheet to CSV, press OK.<br>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.<br>To save only the active sheet to CSV, press OK.<br>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.<br>Are you sure you want to continue?"
}
}
}

View File

@ -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));
}