Commit 9968b1f8 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

(1.0.0.100): FileConverterUtils2

Добавил поддержку параметра fileType для mailMerge (чтобы отличать csv)
Поправил константы SaveTypes.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@61244 954022d7-b5bf-4e40-9824-e11837661b57
parent 6199cba0
......@@ -2,6 +2,11 @@
var g_bDate1904 = false;
var c_oAscAsyncActionType = {
Information : 0,
BlockInteraction : 1
};
var CellValueType =
{
Number:0,
......@@ -422,4 +427,11 @@ var c_oAscFormatPainterState = {
kOff : 0,
kOn : 1,
kMultiple : 2
};
var c_oAscSaveTypes = {
PartStart : 0,
Part : 1,
Complete : 2,
CompleteAll : 3
};
\ No newline at end of file
......@@ -1058,7 +1058,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
var data;
this.wb._initCommentsToSave();
var oBinaryFileWriter = new Asc.BinaryFileWriter(this.wbModel);
oAdditionalData["savetype"] = "completeall";
oAdditionalData["savetype"] = c_oAscSaveTypes.CompleteAll;
data = oBinaryFileWriter.Write();
oAdditionalData["data"] = data;
......@@ -1086,7 +1086,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
oAdditionalData["delimiter"] = this.documentFormatSaveCsvDelimiter;
}
oAdditionalData["innersave"] = true;
oAdditionalData["savetype"] = "completeall";
oAdditionalData["savetype"] = c_oAscSaveTypes.CompleteAll;
oAdditionalData["data"] = data;
this._asc_sendCommand (/*callback*/ function(incomeObject){
if(null != incomeObject && "save" == incomeObject["type"])
......@@ -1121,10 +1121,10 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
// Закончили печатить
if (bStart) {
// Первый раз отправляем данные
oAdditionalData["savetype"] = "completeall";
oAdditionalData["savetype"] = c_oAscSaveTypes.CompleteAll;
} else {
// Не в первый раз отправляем данные
oAdditionalData["savetype"] = "complete";
oAdditionalData["savetype"] = c_oAscSaveTypes.Complete;
}
// Очищаем данные о печати
this.printPagesData = null;
......@@ -1132,10 +1132,10 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
// Продолжаем печать
if (bStart) {
// Первый раз отправляем данные
oAdditionalData["savetype"] = "partstart";
oAdditionalData["savetype"] = c_oAscSaveTypes.PartStart;
} else {
// Не в первый раз отправляем данные
oAdditionalData["savetype"] = "part";
oAdditionalData["savetype"] = c_oAscSaveTypes.Part;
}
}
} else if (c_oAscFileType.CSV === sFormat && !options) {
......@@ -1151,7 +1151,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
} else {
this.wb._initCommentsToSave();
var oBinaryFileWriter = new Asc.BinaryFileWriter(this.wbModel);
oAdditionalData["savetype"] = "completeall";
oAdditionalData["savetype"] = c_oAscSaveTypes.CompleteAll;
if (c_oAscFileType.CSV === sFormat) {
if (options instanceof asc.asc_CCSVAdvancedOptions) {
oAdditionalData["codepage"] = options.asc_getCodePage();
......@@ -3324,7 +3324,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
t.wb._initCommentsToSave();
var oBinaryFileWriter = new Asc.BinaryFileWriter(t.wbModel);
oAdditionalData["savetype"] = "completeall";
oAdditionalData["savetype"] = c_oAscSaveTypes.CompleteAll;
var data = oBinaryFileWriter.Write();
return data;
......
......@@ -72,11 +72,6 @@ var c_oAscFileType = {
XLSY : 0x1002
};
var c_oAscAsyncActionType = {
Information : 0,
BlockInteraction : 1
};
var c_oAscAsyncAction = {
Open : 0, // открытие документа
Save : 1,
......
......@@ -5154,23 +5154,23 @@ function _downloadAs(editor, filetype, fCallback, bStart, sSaveKey)
if(dd.isComleteRenderer2())
{
if(false == bStart)
oAdditionalData["savetype"] = "complete";
oAdditionalData["savetype"] = c_oAscSaveTypes.Complete;
else
oAdditionalData["savetype"] = "completeall";
oAdditionalData["savetype"] = c_oAscSaveTypes.CompleteAll;
}
else
{
if(false == bStart)
oAdditionalData["savetype"] = "part";
oAdditionalData["savetype"] = c_oAscSaveTypes.Part;
else
oAdditionalData["savetype"] = "partstart";
oAdditionalData["savetype"] = c_oAscSaveTypes.PartStart;
}
oAdditionalData["data"] = dd.ToRendererPart();
sendCommand(editor, fCallback, oAdditionalData);
}
else
{
oAdditionalData["savetype"] = "completeall";
oAdditionalData["savetype"] = c_oAscSaveTypes.CompleteAll;
oAdditionalData["data"] = editor.WordControl.SaveDocument();
sendCommand(editor, fCallback, oAdditionalData);
}
......
......@@ -11,11 +11,6 @@ var c_oAscCollaborativeMarksShowType = {
LastChanges : 1
};
var c_oAscAsyncActionType = {
Information : 0,
BlockInteraction : 1
};
var c_oAscHAnchor = {
Margin : 0x00,
Page : 0x01,
......
......@@ -562,7 +562,7 @@ function asc_docs_api(name)
this.isApplyChangesOnOpen = false;
this.isApplyChangesOnOpenEnabled = true;
this.mailMergeFileUrl = null;
this.mailMergeFileData = null;
// CoAuthoring and Chat
this.User = undefined;
......@@ -2823,7 +2823,7 @@ asc_docs_api.prototype.asc_Save = function ()
};
asc_docs_api.prototype.asc_DownloadAs = function(typeFile) {//передаем число соответствующее своему формату.
var actionType = this.mailMergeFileUrl ? c_oAscAsyncAction.MailMergeLoadFile : c_oAscAsyncAction.DownloadAs;
var actionType = this.mailMergeFileData ? c_oAscAsyncAction.MailMergeLoadFile : c_oAscAsyncAction.DownloadAs;
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, actionType);
var t = this;
_downloadAs(this, typeFile, function (incomeObject) {
......@@ -2880,8 +2880,8 @@ asc_docs_api.prototype.SetFontRenderingMode = function(mode)
};
asc_docs_api.prototype.processSavedFile = function(url, bInner) {
var t = this;
if (this.mailMergeFileUrl) {
this.mailMergeFileUrl = null;
if (this.mailMergeFileData) {
this.mailMergeFileData = null;
asc_ajax({
url: url,
dataType: "text",
......@@ -7551,23 +7551,20 @@ function _downloadAs(editor, filetype, fCallback, bStart, sSaveKey) {
if (c_oAscFileType.PDF === filetype) {
var dd = editor.WordControl.m_oDrawingDocument;
if (dd.isComleteRenderer2()) {
if (false == bStart)
oAdditionalData["savetype"] = "complete";
else
oAdditionalData["savetype"] = "completeall";
oAdditionalData["savetype"] = bStart ? c_oAscSaveTypes.Complete : c_oAscSaveTypes.CompleteAll;
} else {
if (false == bStart)
oAdditionalData["savetype"] = "part";
else
oAdditionalData["savetype"] = "partstart";
}
oAdditionalData["data"] = dd.ToRendererPart();
} else if (c_oAscFileType.JSON === filetype) {
oAdditionalData["savetype"] = "completeall";
oAdditionalData["url"] = editor.mailMergeFileUrl;
oAdditionalData['savetype'] = c_oAscSaveTypes.CompleteAll;
oAdditionalData['url'] = editor.mailMergeFileData['url'];
oAdditionalData['format'] = editor.mailMergeFileData['fileType'];
// ToDo select csv params
oAdditionalData['codepage'] = 65001;
oAdditionalData['delimiter'] = 4; // c_oAscCsvDelimiter.Comma
} else {
var oBinaryFileWriter = new BinaryFileWriter(editor.WordControl.m_oLogicDocument);
oAdditionalData["savetype"] = "completeall";
oAdditionalData["savetype"] = c_oAscSaveTypes.CompleteAll;
oAdditionalData["data"] = oBinaryFileWriter.Write();
}
sendCommand(editor, fCallback, oAdditionalData);
......@@ -7829,7 +7826,7 @@ asc_docs_api.prototype.asc_AddMath2 = function(Type)
//----------------------------------------------------------------------------------------------------------------------
asc_docs_api.prototype.asc_StartMailMerge = function(oData)
{
this.mailMergeFileUrl = oData["url"];
this.mailMergeFileData = oData;
this.asc_DownloadAs(c_oAscFileType.JSON);
};
asc_docs_api.prototype.asc_StartMailMergeByList = function(aList)
......
......@@ -6,11 +6,6 @@ var c_oAscZoomType = {
FitPage :2
};
var c_oAscAsyncActionType = {
Information : 0,
BlockInteraction : 1
};
var c_oAscAsyncAction = {
Open : 0, // открытие документа
Save : 1,
......
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