Commit 2d22ee46 authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

ошибки в минимизации при обработке ответов от сервера.

Bug 21493 - [Print] Создается PPTX без расширения вместо PDF

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50868 954022d7-b5bf-4e40-9824-e11837661b57
parent a35046e9
......@@ -519,8 +519,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
// Меняем тип состояния (на сохранение)
this.advancedOptionsAction = c_oAscAdvancedOptionsAction.Save;
this._asc_downloadAs(typeFile, function(incomeObject){
if(null != incomeObject && "save" == incomeObject.type)
that.asc_processSavedFile(incomeObject.data, false);
if(null != incomeObject && "save" == incomeObject["type"])
that.asc_processSavedFile(incomeObject["data"], false);
// Меняем тип состояния (на никакое)
that.advancedOptionsAction = c_oAscAdvancedOptionsAction.None;
that.asc_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.DownloadAs);
......@@ -696,8 +696,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
this._asc_sendCommand(function (response) {t._startOpenDocument(response);}, JSON.stringify(v));
} else if (this.advancedOptionsAction === c_oAscAdvancedOptionsAction.Save)
this._asc_downloadAs(c_oAscFileType.CSV, function(incomeObject){
if(null != incomeObject && "save" == incomeObject.type)
t.asc_processSavedFile(incomeObject.data, false);
if(null != incomeObject && "save" == incomeObject["type"])
t.asc_processSavedFile(incomeObject["data"], false);
// Меняем тип состояния (на никакое)
t.advancedOptionsAction = c_oAscAdvancedOptionsAction.None;
t.asc_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.DownloadAs);
......@@ -751,9 +751,9 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
}
else{
var incomeObject = JSON.parse(msg);
switch( incomeObject.type ){
switch( incomeObject["type"] ){
case "open":
var sJsonUrl = g_sResourceServiceLocalUrl + incomeObject.data;
var sJsonUrl = g_sResourceServiceLocalUrl + incomeObject["data"];
asc_ajax({
url: sJsonUrl,
dataType: "text",
......@@ -800,7 +800,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
}
}
asc_ajax({
url: incomeObject.data,
url: incomeObject["data"],
dataType: "text",
success: function(result, textStatus) {
var cp = JSON.parse(result);
......@@ -828,7 +828,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
break;
}
}
var cp = JSON.parse(incomeObject.data);
var cp = JSON.parse(incomeObject["data"]);
oThis.handlers.trigger("asc_onAdvancedOptions", new asc.asc_CAdvancedOptions(c_oAscAdvancedOptionsID.CSV,cp), oThis.advancedOptionsAction);
//var value = {url: oThis.documentUrl, delimiter: c_oAscCsvDelimiter.Comma, codepage: 65001}; //65001 - utf8
//oThis._asc_sendCommand(callback, "opencsv", oThis.documentTitle, JSON.stringify(value));
......@@ -842,20 +842,20 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
setTimeout(function(){oThis._asc_sendCommand(callback, JSON.stringify(rData));}, 3000);
break;
case "waitsave":
var rData = {"id": oThis.documentId, "vkey": oThis.documentVKey, "title": oThis.documentTitleWithoutExtention, "c": "chsave", "data": incomeObject.data};
var rData = {"id": oThis.documentId, "vkey": oThis.documentVKey, "title": oThis.documentTitleWithoutExtention, "c": "chsave", "data": incomeObject["data"]};
setTimeout(function(){oThis._asc_sendCommand(callback, JSON.stringify(rData));}, 3000);
break;
case "savepart":
var outputData = JSON.parse(incomeObject.data);
oThis._asc_downloadAs(outputData.format, callback, false, null, outputData.savekey);
var outputData = JSON.parse(incomeObject["data"]);
oThis._asc_downloadAs(outputData["format"], callback, false, null, outputData["savekey"]);
break;
case "getsettings":
if(callback)
callback(incomeObject);
break;
case "err":
result = {returnCode: c_oAscError.Level.Critical, val:parseInt(incomeObject.data)};
oThis.handlers.trigger("asc_onError", asc_mapAscServerErrorToAscError(parseInt(incomeObject.data)), c_oAscError.Level.Critical);
result = {returnCode: c_oAscError.Level.Critical, val:parseInt(incomeObject["data"])};
oThis.handlers.trigger("asc_onError", asc_mapAscServerErrorToAscError(parseInt(incomeObject["data"])), c_oAscError.Level.Critical);
if(callback)
callback(result);
break;
......@@ -943,8 +943,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
oAdditionalData["innersave"] = true;
oAdditionalData["savetype"] = "completeall";
this._asc_sendCommand (/*callback*/ function(incomeObject){
if(null != incomeObject && "save" == incomeObject.type)
that.asc_processSavedFile(incomeObject.data, true);
if(null != incomeObject && "save" == incomeObject["type"])
that.asc_processSavedFile(incomeObject["data"], true);
}, "mnuSaveAs" + this.cCharDelimiter + JSON.stringify(oAdditionalData) + this.cCharDelimiter + data);
},
......@@ -2253,10 +2253,10 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
var oThis = this;
this.handlers.trigger("asc_onStartAction", c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadImage);
this._asc_sendCommand( function(incomeObject){
if(null != incomeObject && "imgurl" == incomeObject.type)
if(null != incomeObject && "imgurl" == incomeObject["type"])
{
var ws = oThis.wb.getWorksheet();
return ws.objectRender.addImageDrawingObject(incomeObject.data, null);
return ws.objectRender.addImageDrawingObject(incomeObject["data"], null);
}
oThis.handlers.trigger("asc_onEndAction", c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadImage);
}, JSON.stringify(rData) );
......
......@@ -723,8 +723,8 @@ asc_docs_api.prototype.asc_getEditorPermissions = function()
asc_docs_api.prototype.asc_getEditorPermissionsCallback = function(incomeObject)
{
if(null != incomeObject && "getsettings" == incomeObject.type){
var oSettings = JSON.parse(incomeObject.data);
if(null != incomeObject && "getsettings" == incomeObject["type"]){
var oSettings = JSON.parse(incomeObject["data"]);
//Set up coauthoring and spellcheker service
window.g_cAscCoAuthoringUrl = oSettings['g_cAscCoAuthoringUrl'];
......@@ -1309,8 +1309,8 @@ asc_docs_api.prototype.asc_Print = function(){
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Print);
var editor = this;
_downloadAs(this, c_oAscFileType.PDF, function(incomeObject){
if(null != incomeObject && "save" == incomeObject.type)
editor.processSavedFile(incomeObject.data, false);
if(null != incomeObject && "save" == incomeObject["type"])
editor.processSavedFile(incomeObject["data"], false);
editor.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Print);}, true);
}
asc_docs_api.prototype.Undo = function(){
......@@ -1390,8 +1390,8 @@ asc_docs_api.prototype.asc_DownloadAs = function(typeFile){//передаем ч
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.DownloadAs);
var editor = this;
_downloadAs(this, typeFile, function(incomeObject){
if(null != incomeObject && "save" == incomeObject.type)
editor.processSavedFile(incomeObject.data, false);
if(null != incomeObject && "save" == incomeObject["type"])
editor.processSavedFile(incomeObject["data"], false);
editor.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.DownloadAs);}, true);
}
asc_docs_api.prototype.Resize = function(){
......@@ -1715,8 +1715,8 @@ asc_docs_api.prototype.onSaveCallback = function (e) {
oAdditionalData["savetype"] = "completeall";
var sData = "mnuSaveAs" + cCharDelimiter + JSON.stringify(oAdditionalData) + cCharDelimiter + data;
sendCommand(editor, function(incomeObject){
if(null != incomeObject && "save" == incomeObject.type)
editor.processSavedFile(incomeObject.data, true);
if(null != incomeObject && "save" == incomeObject["type"])
editor.processSavedFile(incomeObject["data"], true);
}, sData);
// Пересылаем свои изменения (ToDo)
......@@ -2893,8 +2893,8 @@ asc_docs_api.prototype.AddImageUrl = function(url){
var oThis = this;
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
sendCommand(this, function(incomeObject){
if(null != incomeObject && "imgurl" == incomeObject.type)
oThis.AddImageUrlAction(incomeObject.data);
if(null != incomeObject && "imgurl" == incomeObject["type"])
oThis.AddImageUrlAction(incomeObject["data"]);
oThis.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
}, JSON.stringify(rData) );
}
......@@ -4793,9 +4793,9 @@ function sendCommand(editor, fCallback, rdata){
},
success: function(msg){
var incomeObject = JSON.parse(msg);
switch(incomeObject.type){
switch(incomeObject["type"]){
case "open":
var sJsonUrl = g_sResourceServiceLocalUrl + incomeObject.data;
var sJsonUrl = g_sResourceServiceLocalUrl + incomeObject["data"];
asc_ajax({
url: sJsonUrl,
dataType: "text",
......@@ -4832,9 +4832,9 @@ function sendCommand(editor, fCallback, rdata){
});
break;
case "waitopen":
if (incomeObject.data)
if (incomeObject["data"])
{
editor._lastConvertProgress = incomeObject.data / 2;
editor._lastConvertProgress = incomeObject["data"] / 2;
editor.sync_SendProgress(editor._lastConvertProgress);
}
var rData = {"id":documentId, "format": documentFormat, "vkey": documentVKey, "editorid": c_oEditorId.Presentation, "c":"chopen"};
......@@ -4845,19 +4845,19 @@ function sendCommand(editor, fCallback, rdata){
fCallback(incomeObject);
break;
case "waitsave":
var rData = {"id":documentId, "vkey": documentVKey, "title": documentTitleWithoutExtention, "c":"chsave", "data": incomeObject.data};
var rData = {"id":documentId, "vkey": documentVKey, "title": documentTitleWithoutExtention, "c":"chsave", "data": incomeObject["data"]};
setTimeout( function(){sendCommand(editor, fCallback, JSON.stringify(rData))}, 3000);
break;
case "savepart":
var outputData = JSON.parse(incomeObject.data);
_downloadAs(editor, outputData.format, fCallback, false, outputData.savekey);
var outputData = JSON.parse(incomeObject["data"]);
_downloadAs(editor, outputData["format"], fCallback, false, outputData["savekey"]);
break;
case "getsettings":
if(fCallback)
fCallback(incomeObject);
break;
case "err":
editor.asc_fireCallback("asc_onError",_mapAscServerErrorToAscError(parseInt(incomeObject.data)),c_oAscError.Level.Critical);
editor.asc_fireCallback("asc_onError",_mapAscServerErrorToAscError(parseInt(incomeObject["data"])),c_oAscError.Level.Critical);
if(fCallback)
fCallback(incomeObject);
break;
......
......@@ -842,8 +842,8 @@ asc_docs_api.prototype.asc_getEditorPermissions = function()
asc_docs_api.prototype.asc_getEditorPermissionsCallback = function(incomeObject)
{
if(null != incomeObject && "getsettings" == incomeObject.type){
var oSettings = JSON.parse(incomeObject.data);
if(null != incomeObject && "getsettings" == incomeObject["type"]){
var oSettings = JSON.parse(incomeObject["data"]);
//Set up coauthoring and spellcheker service
window.g_cAscCoAuthoringUrl = oSettings['g_cAscCoAuthoringUrl'];
......@@ -2464,8 +2464,8 @@ asc_docs_api.prototype.asc_Print = function()
}
else
_downloadAs(this, c_oAscFileType.PDF, function(incomeObject){
if(null != incomeObject && "save" == incomeObject.type)
editor.processSavedFile(incomeObject.data, false);
if(null != incomeObject && "save" == incomeObject["type"])
editor.processSavedFile(incomeObject["data"], false);
editor.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Print);}, true);
}
}
......@@ -2574,8 +2574,8 @@ function OnSave_Callback(e)
var sData = "mnuSaveAs" + cCharDelimiter + JSON.stringify(oAdditionalData) + cCharDelimiter + data;
sendCommand(editor, function(incomeObject){
if(null != incomeObject && "save" == incomeObject.type)
editor.processSavedFile(incomeObject.data, true);
if(null != incomeObject && "save" == incomeObject["type"])
editor.processSavedFile(incomeObject["data"], true);
}, sData);
}
......@@ -2615,8 +2615,8 @@ asc_docs_api.prototype.asc_DownloadAs = function(typeFile){//передаем ч
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.DownloadAs);
var editor = this;
_downloadAs(this, typeFile, function(incomeObject){
if(null != incomeObject && "save" == incomeObject.type)
editor.processSavedFile(incomeObject.data, false);
if(null != incomeObject && "save" == incomeObject["type"])
editor.processSavedFile(incomeObject["data"], false);
editor.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.DownloadAs);}, true);
}
asc_docs_api.prototype.Resize = function(){
......@@ -4833,8 +4833,8 @@ asc_docs_api.prototype.AddImageUrl = function(url, imgProp)
var oThis = this;
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
sendCommand( oThis, function(incomeObject){
if(null != incomeObject && "imgurl" ==incomeObject.type)
oThis.AddImageUrlAction(incomeObject.data, imgProp);
if(null != incomeObject && "imgurl" ==incomeObject["type"])
oThis.AddImageUrlAction(incomeObject["data"], imgProp);
oThis.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
}, JSON.stringify(rData) );
}
......@@ -6773,9 +6773,9 @@ function sendCommand(editor, fCallback, rdata){
},
success: function(msg){
var incomeObject = JSON.parse(msg);
switch(incomeObject.type){
switch(incomeObject["type"]){
case "open":
var sJsonUrl = g_sResourceServiceLocalUrl + incomeObject.data;
var sJsonUrl = g_sResourceServiceLocalUrl + incomeObject["data"];
asc_ajax({
url: sJsonUrl,
dataType: "text",
......@@ -6812,9 +6812,9 @@ function sendCommand(editor, fCallback, rdata){
sendCommand(editor, fCallback, JSON.stringify(rData))
break;
case "waitopen":
if (incomeObject.data)
if (incomeObject["data"])
{
editor._lastConvertProgress = incomeObject.data / 2;
editor._lastConvertProgress = incomeObject["data"] / 2;
editor.sync_SendProgress(editor._lastConvertProgress);
}
var rData = {"id":documentId, "format": documentFormat, "vkey": documentVKey, "editorid": c_oEditorId.Word, "c":"chopen"};
......@@ -6835,20 +6835,20 @@ function sendCommand(editor, fCallback, rdata){
break;
case "waitsave":
{
var rData = {"id":documentId, "vkey": documentVKey, "title": documentTitleWithoutExtention, "c":"chsave", "data": incomeObject.data};
var rData = {"id":documentId, "vkey": documentVKey, "title": documentTitleWithoutExtention, "c":"chsave", "data": incomeObject["data"]};
setTimeout( function(){sendCommand(editor, fCallback, JSON.stringify(rData))}, 3000);
}
break;
case "savepart":
var outputData = JSON.parse(incomeObject.data);
_downloadAs(editor, outputData.format, fCallback, false, outputData.savekey);
var outputData = JSON.parse(incomeObject["data"]);
_downloadAs(editor, outputData["format"], fCallback, false, outputData["savekey"]);
break;
case "getsettings":
if(fCallback)
fCallback(incomeObject);
break;
case "err":
editor.asc_fireCallback("asc_onError", _mapAscServerErrorToAscError(parseInt(incomeObject.data)), c_oAscError.Level.Critical);
editor.asc_fireCallback("asc_onError", _mapAscServerErrorToAscError(parseInt(incomeObject["data"])), c_oAscError.Level.Critical);
if(fCallback)
fCallback(incomeObject);
break;
......
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