Commit 78e78b4e authored by Ilya.Kirillov's avatar Ilya.Kirillov

Изменена структура объектов посылаемых в совместном редактировании. Теперь Id...

Изменена структура объектов посылаемых в совместном редактировании. Теперь Id класса, у которого произошли изменения пишется прямо в само изменение, а не в отдельное поле объекта как раньше.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59573 954022d7-b5bf-4e40-9824-e11837661b57
parent 2667f1be
...@@ -377,15 +377,9 @@ var g_oTableId = null; ...@@ -377,15 +377,9 @@ var g_oTableId = null;
function CCollaborativeChanges() function CCollaborativeChanges()
{ {
this.m_sId = null;
this.m_pData = null; this.m_pData = null;
this.m_oColor = null; this.m_oColor = null;
this.Set_Id = function(sId)
{
this.m_sId = sId;
};
this.Set_Data = function(pData) this.Set_Data = function(pData)
{ {
this.m_pData = pData; this.m_pData = pData;
...@@ -401,8 +395,6 @@ function CCollaborativeChanges() ...@@ -401,8 +395,6 @@ function CCollaborativeChanges()
if ( "undefined" === typeof(Class.Get_Id) ) if ( "undefined" === typeof(Class.Get_Id) )
return false; return false;
this.m_sId = Class.Get_Id();
// Преобразуем данные в бинарный файл // Преобразуем данные в бинарный файл
this.m_pData = this.Internal_Save_Data( Class, Data, Binary ); this.m_pData = this.Internal_Save_Data( Class, Data, Binary );
...@@ -411,21 +403,21 @@ function CCollaborativeChanges() ...@@ -411,21 +403,21 @@ function CCollaborativeChanges()
this.Apply_Data = function() this.Apply_Data = function()
{ {
var LoadData = this.Internal_Load_Data( this.m_pData ); 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 Type = LoadData.Reader.GetLong();
var Class = null; var Class = null;
if ( historyitem_type_HdrFtr === Type ) if (historyitem_type_HdrFtr === Type)
{
Class = editor.WordControl.m_oLogicDocument.HdrFtr; Class = editor.WordControl.m_oLogicDocument.HdrFtr;
}
else 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 ) if (null != Class)
return Class.Load_Changes( LoadData.Reader, LoadData.Reader2, this.m_oColor ); return Class.Load_Changes(LoadData.Reader, LoadData.Reader2, this.m_oColor);
else else
return false; return false;
}; };
...@@ -771,7 +763,6 @@ function CCollaborativeEditing() ...@@ -771,7 +763,6 @@ function CCollaborativeEditing()
oChanges.Set_FromUndoRedo( Item.Class, Item.Data, Item.Binary ); oChanges.Set_FromUndoRedo( Item.Class, Item.Data, Item.Binary );
var oChanges2 = {}; var oChanges2 = {};
oChanges2["Id"] = oChanges.m_sId;
oChanges2["Data"] = oChanges.m_pData; oChanges2["Data"] = oChanges.m_pData;
aChanges.push( oChanges2 ); aChanges.push( oChanges2 );
} }
...@@ -1321,6 +1312,7 @@ CContentChangesElement.prototype = ...@@ -1321,6 +1312,7 @@ CContentChangesElement.prototype =
this.m_pData.Data.UseArray = true; this.m_pData.Data.UseArray = true;
this.m_pData.Data.PosArray = this.m_aPositions; 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 ); this.m_pData.Class.Save_Changes( this.m_pData.Data, Binary_Writer );
var Binary_Len = Binary_Writer.GetCurPosition() - Binary_Pos; var Binary_Len = Binary_Writer.GetCurPosition() - Binary_Pos;
......
...@@ -193,6 +193,7 @@ CHistory.prototype = ...@@ -193,6 +193,7 @@ CHistory.prototype =
var Binary_Pos = this.BinaryWriter.GetCurPosition(); var Binary_Pos = this.BinaryWriter.GetCurPosition();
this.BinaryWriter.WriteString2(Class.Get_Id());
Class.Save_Changes( Data, this.BinaryWriter ); Class.Save_Changes( Data, this.BinaryWriter );
var Binary_Len = this.BinaryWriter.GetCurPosition() - Binary_Pos; var Binary_Len = this.BinaryWriter.GetCurPosition() - Binary_Pos;
......
...@@ -1442,7 +1442,6 @@ CChatMessage.prototype.get_Message = function() { return this.Message; } ...@@ -1442,7 +1442,6 @@ CChatMessage.prototype.get_Message = function() { return this.Message; }
asc_docs_api.prototype._coAuthoringSetChange = function(change, oColor) asc_docs_api.prototype._coAuthoringSetChange = function(change, oColor)
{ {
var oChange = new CCollaborativeChanges(); var oChange = new CCollaborativeChanges();
oChange.Set_Id( change["Id"] );
oChange.Set_Data( change["Data"] ); oChange.Set_Data( change["Data"] );
oChange.Set_Color( oColor ); oChange.Set_Color( oColor );
CollaborativeEditing.Add_Changes( oChange ); CollaborativeEditing.Add_Changes( oChange );
......
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