Commit 467fe125 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin

Новый формат изменений для совместного редактирования.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59585 954022d7-b5bf-4e40-9824-e11837661b57
parent a205f6eb
......@@ -386,15 +386,9 @@ var g_oTableId = null;
function CCollaborativeChanges()
{
this.m_sId = null;
this.m_pData = null;
this.m_oColor = null;
this.Set_Id = function(sId)
{
this.m_sId = sId;
};
this.Set_Data = function(pData)
{
this.m_pData = pData;
......@@ -410,7 +404,6 @@ function CCollaborativeChanges()
if ( "undefined" === typeof(Class.Get_Id) )
return false;
this.m_sId = Class.Get_Id();
// Преобразуем данные в бинарный файл
this.m_pData = this.Internal_Save_Data( Class, Data, Binary );
......@@ -418,23 +411,21 @@ function CCollaborativeChanges()
return true;
};
this.Apply_Data = function()
{
var LoadData = this.Internal_Load_Data( this.m_pData );
var Type = LoadData.Reader.GetLong();
var Class = null;
var LoadData = this.Internal_Load_Data(this.m_pData);
var ClassId = LoadData.Reader.GetString2();
var ReaderPos = LoadData.Reader.GetCurPos();
var Type = LoadData.Reader.GetLong();
var Class = null;
if ( historyitem_type_HdrFtr === Type )
{
Class = editor.WordControl.m_oLogicDocument.HdrFtr;
}
else
Class = g_oTableId.Get_ById( this.m_sId );
Class = g_oTableId.Get_ById(ClassId);
LoadData.Reader.Seek2(0);
LoadData.Reader.Seek2(ReaderPos);
if ( null != Class )
return Class.Load_Changes( LoadData.Reader, LoadData.Reader2, this.m_oColor );
if (null != Class)
return Class.Load_Changes(LoadData.Reader, LoadData.Reader2, this.m_oColor);
else
return false;
};
......@@ -783,11 +774,7 @@ function CCollaborativeEditing()
var Item = Point.Items[Index];
var oChanges = new CCollaborativeChanges();
oChanges.Set_FromUndoRedo( Item.Class, Item.Data, Item.Binary );
var oChanges2 = {};
oChanges2["Id"] = oChanges.m_sId;
oChanges2["Data"] = oChanges.m_pData;
aChanges.push( oChanges2 );
aChanges.push( oChanges.m_pData );
}
}
......@@ -1449,6 +1436,7 @@ function CContentChangesElement(Type, Pos, Count, Data)
this.m_pData.Data.UseArray = true;
this.m_pData.Data.PosArray = this.m_aPositions;
Binary_Writer.WriteString2(this.m_pData.Class.Get_Id());
this.m_pData.Class.Save_Changes( this.m_pData.Data, Binary_Writer );
var Binary_Len = Binary_Writer.GetCurPosition() - Binary_Pos;
......
......@@ -464,8 +464,7 @@ asc_docs_api.prototype._coAuthoringInit = function () {
this.CoAuthoringApi.onSaveChanges = function (e, userId, bFirstLoad) {
// bSendEvent = false - это означает, что мы загружаем имеющиеся изменения при открытии
var Changes = new CCollaborativeChanges();
Changes.Set_Id(e["Id"]);
Changes.Set_Data(e["Data"]);
Changes.Set_Data(e);
CollaborativeEditing.Add_Changes(Changes);
// т.е. если bSendEvent не задан, то посылаем сообщение + когда загрузился документ
......@@ -5215,8 +5214,7 @@ window["asc_docs_api"].prototype["asc_nativeApplyChanges"] = function(changes)
for (var i = 0; i < _len; i++)
{
var Changes = new CCollaborativeChanges();
Changes.Set_Id( changes[i]["Id"] );
Changes.Set_Data( changes[i]["Data"] );
Changes.Set_Data( changes[i]);
CollaborativeEditing.Add_Changes( Changes );
}
CollaborativeEditing.Apply_OtherChanges();
......
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