Commit a9e0042f authored by Sergey.Konovalov's avatar Sergey.Konovalov

для Bug 30427 - Ошибка "Conversion failed" при попытке экспорта в HTML

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64885 954022d7-b5bf-4e40-9824-e11837661b57
parent 973aab6c
......@@ -6866,6 +6866,22 @@ function _downloadAs(editor, command, oDocumentMailMerge, oMailMergeSendData, tx
var cp = {'codepage': c_oAscCodePageUtf8, 'encodings': getEncodingParams()};
editor.asc_fireCallback("asc_onAdvancedOptions", new asc.asc_CAdvancedOptions(c_oAscAdvancedOptionsID.TXT, cp), editor.advancedOptionsAction);
return;
} else if (c_oAscFileType.HTML === filetype) {
var htmlUTF16 = window["asc_docs_api"].prototype["asc_nativeGetHtml"].call(editor);
var oZBase32Encoder = new ZBase32Encoder();
var htmlUTF8 = oZBase32Encoder.GetUTF8_fromUTF16(htmlUTF16);
var memory = new CMemory();
memory.WriteByte(0xef);
memory.WriteByte(0xbb);
memory.WriteByte(0xbf);
memory.WriteBuffer(htmlUTF8, 0, htmlUTF8.length);
var urlHtml = "data:application/octet-stream;charset=utf-8;base64," + memory.GetBase64Memory();
editor.processSavedFile(urlHtml, false);
//Меняем тип состояния (на никакое)
editor.advancedOptionsAction = c_oAscAdvancedOptionsAction.None;
editor.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.DownloadAs);
//todo чтобы поддержать имя файла похоже придется делать через <a/> или saveAs
return;
} else {
if (txtOptions instanceof asc.asc_CTXTAdvancedOptions) {
oAdditionalData["codepage"] = txtOptions.asc_getCodePage();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment