Merge pull request #2137 from ONLYOFFICE/fix/bug-47036

Fix/bug 47036
This commit is contained in:
Julia Radzhabova 2022-12-15 15:17:21 +03:00 committed by GitHub
commit ebc9f0f332
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 3 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,10 @@ define([
},
onDataFromXMLCallback: function(fileContent) {
setTimeout(function() {
Common.Utils.InternalSettings.set('import-xml-start', false);
}, 500);
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: 'The file has an unsupported format.<br>Only XML Spreadsheet 2003 format can be used.'
}
})(), SSE.Controllers.Main || {}))
});

View file

@ -313,7 +313,10 @@ define([
items: [
{ caption: me.mniFromFile, value: 'file' },
{ caption: me.mniFromUrl, value: 'url' },
{ caption: me.mniFromXMLFile, value: 'xml' }
{ caption: '--'},
{ caption: me.mniFromXMLFile,
value: 'xml'
}
// { caption: me.mniImageFromStorage, value: 'storage'}
]
}));

View file

@ -1030,6 +1030,7 @@
"SSE.Controllers.Main.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?",
"SSE.Controllers.Main.textTryUndoRedo": "The Undo/Redo functions are disabled for the Fast co-editing mode.<br>Click the 'Strict mode' button to switch to the Strict co-editing mode to edit the file without other users interference and send your changes only after you save them. You can switch between the co-editing modes using the editor Advanced settings.",
"SSE.Controllers.Main.textTryUndoRedoWarn": "The Undo/Redo functions are disabled for the Fast co-editing mode.",
"SSE.Controllers.Main.errorConvertXml": "The file has an unsupported format.<br>Only XML Spreadsheet 2003 format can be used.",
"SSE.Controllers.Main.textUndo": "Undo",
"SSE.Controllers.Main.textYes": "Yes",
"SSE.Controllers.Main.titleLicenseExp": "License expired",