[SSE] For Bug 47036

This commit is contained in:
Julia Radzhabova 2022-12-13 20:07:24 +03:00
parent d90da06528
commit e4ceba55af
3 changed files with 17 additions and 4 deletions

View file

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

View file

@ -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.<br>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.<br>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.<br>Do you want to continue?'
textTryQuickPrint: 'You have selected Quick print: the entire document will be printed on the last selected or default printer.<br>Do you want to continue?',
errorConvertXml: 'An error has occurred while opening the file.<br>Only Spreadsheet Xml 2003 format is supported.'
}
})(), SSE.Controllers.Main || {}))
});

View file

@ -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('<a id="<%= id %>" tabindex="-1" type="menuitem"><div><%= caption %></div>' +
'<label style="display: block;color: #a5a5a5;cursor: pointer;white-space: normal;"><%= options.description %></label></a>')
}
// { 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 || {}));
});