Commit 79fb282c authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug #33824. Improved performance of an undo in fast collaboration.

parent 2a6e4a08
...@@ -902,27 +902,27 @@ CCollaborativeEditingBase.prototype.private_RestoreDocumentState = function(DocS ...@@ -902,27 +902,27 @@ CCollaborativeEditingBase.prototype.private_RestoreDocumentState = function(DocS
var _oChange = oChange.Copy(); var _oChange = oChange.Copy();
if (this.private_CommutateContentChanges(oContentChangesMap, oClass, _oChange, nPosition + nCount)) if (this.private_CommutateContentChanges(oContentChangesMap, oClass, _oChange, nPosition + nCount))
arrChanges.splice(0, 0, _oChange); arrChanges.push(_oChange);
} }
else else
{ {
var _oChange = oChange; // TODO: Тут надо бы сделать копирование var _oChange = oChange; // TODO: Тут надо бы сделать копирование
if (this.private_CommutatePropertyChanges(oClass, _oChange, nPosition + nCount)) if (this.private_CommutatePropertyChanges(oClass, _oChange, nPosition + nCount))
arrChanges.splice(0, 0, _oChange); arrChanges.push(_oChange);
} }
} }
// Удаляем запись о последнем изменении // Удаляем запись о последнем изменении
this.m_aOwnChangesIndexes.length = this.m_aOwnChangesIndexes.length - 1; this.m_aOwnChangesIndexes.length = this.m_aOwnChangesIndexes.length - 1;
var arrReverseChanges = []; var arrReverseChanges = [];
for (var nIndex = 0, nCount = arrChanges.length; nIndex < nCount; ++nIndex) for (var nIndex = 0, nCount = arrChanges.length; nIndex < nCount; ++nIndex)
{ {
var oReverseChange = arrChanges[nIndex].CreateReverseChange(); var oReverseChange = arrChanges[nIndex].CreateReverseChange();
if (oReverseChange) if (oReverseChange)
arrReverseChanges.splice(0, 0, oReverseChange); arrReverseChanges.push(oReverseChange);
} }
// Накатываем изменения в данном клиенте // Накатываем изменения в данном клиенте
var oLogicDocument = this.m_oLogicDocument; var oLogicDocument = this.m_oLogicDocument;
......
...@@ -11782,7 +11782,7 @@ CTable.prototype.Set_ContentPosition = function(DocPos, Depth, Flag) ...@@ -11782,7 +11782,7 @@ CTable.prototype.Set_ContentPosition = function(DocPos, Depth, Flag)
_DocPos = null; _DocPos = null;
_Flag = 1; _Flag = 1;
} }
else if (CurRowRow > 0) else if (CurRow > 0)
{ {
CurRow--; CurRow--;
_DocPos = null; _DocPos = null;
......
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