From e4ceba55af74ebde99ad58676e7c0ad460dd7e0e Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 13 Dec 2022 20:07:24 +0300 Subject: [PATCH] [SSE] For Bug 47036 --- .../spreadsheeteditor/main/app/controller/DataTab.js | 2 ++ apps/spreadsheeteditor/main/app/controller/Main.js | 7 +++++-- apps/spreadsheeteditor/main/app/view/DataTab.js | 12 ++++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/DataTab.js b/apps/spreadsheeteditor/main/app/controller/DataTab.js index 070045995..ebe933563 100644 --- a/apps/spreadsheeteditor/main/app/controller/DataTab.js +++ b/apps/spreadsheeteditor/main/app/controller/DataTab.js @@ -267,6 +267,7 @@ define([ } else if (type === 'storage') { // Common.NotificationCenter.trigger('storage:data-load', 'add'); } else if (type === 'xml') { + Common.Utils.InternalSettings.set('import-xml-start', true); this.api && this.api.asc_ImportXmlStart(_.bind(this.onDataFromXMLCallback, this)); } }, @@ -290,6 +291,7 @@ define([ }, onDataFromXMLCallback: function(fileContent) { + Common.Utils.InternalSettings.set('import-xml-start', false); if (!fileContent) return; var me = this; diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 42d6165d5..b634ac63f 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -2009,7 +2009,9 @@ define([ case Asc.c_oAscError.ID.ConvertationOpenFormat: config.maxwidth = 600; - if (errData === 'pdf') + if (Common.Utils.InternalSettings.get('import-xml-start')) + config.msg = this.errorConvertXml; + else if (errData === 'pdf') config.msg = this.errorInconsistentExtPdf.replace('%1', this.appOptions.spreadsheet.fileType || ''); else if (errData === 'docx') config.msg = this.errorInconsistentExtDocx.replace('%1', this.appOptions.spreadsheet.fileType || ''); @@ -3763,7 +3765,8 @@ define([ errorInconsistentExtPdf: 'An error has occurred while opening the file.
The file content corresponds to one of the following formats: pdf/djvu/xps/oxps, but the file has the inconsistent extension: %1.', errorInconsistentExt: 'An error has occurred while opening the file.
The file content does not match the file extension.', errorCannotPasteImg: 'We can\'t paste this image from the Clipboard, but you can save it to your device and \ninsert it from there, or you can copy the image without text and paste it into the spreadsheet.', - textTryQuickPrint: 'You have selected Quick print: the entire document will be printed on the last selected or default printer.
Do you want to continue?' + textTryQuickPrint: 'You have selected Quick print: the entire document will be printed on the last selected or default printer.
Do you want to continue?', + errorConvertXml: 'An error has occurred while opening the file.
Only Spreadsheet Xml 2003 format is supported.' } })(), SSE.Controllers.Main || {})) }); diff --git a/apps/spreadsheeteditor/main/app/view/DataTab.js b/apps/spreadsheeteditor/main/app/view/DataTab.js index 4bec61b70..0cb9b9e1d 100644 --- a/apps/spreadsheeteditor/main/app/view/DataTab.js +++ b/apps/spreadsheeteditor/main/app/view/DataTab.js @@ -310,10 +310,17 @@ define([ me.btnDataFromText.updateHint(me.tipDataFromText); me.btnDataFromText.menu && me.btnDataFromText.setMenu(new Common.UI.Menu({ + style: 'max-width: 300px;', items: [ { caption: me.mniFromFile, value: 'file' }, { caption: me.mniFromUrl, value: 'url' }, - { caption: me.mniFromXMLFile, value: 'xml' } + { caption: '--'}, + { caption: me.mniFromXMLFile, + value: 'xml', + description: me.mniFromXMLFileDesc, + template:_.template('
<%= caption %>
' + + '
') + } // { caption: me.mniImageFromStorage, value: 'storage'} ] })); @@ -402,7 +409,8 @@ define([ mniFromUrl: 'Get Data from URL', capDataExternalLinks: 'External Links', tipExternalLinks: 'View other files this spreadsheet is linked to', - mniFromXMLFile: 'From Local XML' + mniFromXMLFile: 'From Local XML', + mniFromXMLFileDesc: 'Only Spreadsheet Xml 2003 format is supported' } }()), SSE.Views.DataTab || {})); });