Commit 77f2d91b authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug #33962. Fixed issue with undo in fast collaborative.

parent 2c1964a9
...@@ -762,19 +762,23 @@ CWordCollaborativeEditing.prototype.Undo = function() ...@@ -762,19 +762,23 @@ CWordCollaborativeEditing.prototype.Undo = function()
var oHistory = AscCommon.History; var oHistory = AscCommon.History;
oHistory.CreateNewPointForCollectChanges(); oHistory.CreateNewPointForCollectChanges();
var oDrawing; var oDrawing;
for(var sId in mapDrawings){ for (var sId in mapDrawings)
if(mapDrawings.hasOwnProperty(sId)){ {
oDrawing = mapDrawings[sId]; if (mapDrawings.hasOwnProperty(sId))
if(!oDrawing.CheckCorrect()){ {
var oParentParagraph = oDrawing.Get_ParentParagraph(); oDrawing = mapDrawings[sId];
oDrawing.Remove_FromDocument(false); if (!oDrawing.CheckCorrect())
if(oParentParagraph){ {
mapParagraphs[oParentParagraph.Get_Id()] = oParentParagraph; var oParentParagraph = oDrawing.Get_ParentParagraph();
} oDrawing.Remove_FromDocument(false);
} if (oParentParagraph)
} {
mapParagraphs[oParentParagraph.Get_Id()] = oParentParagraph;
}
}
}
}
}
for (var sId in mapDocumentContents) for (var sId in mapDocumentContents)
{ {
var oDocumentContent = mapDocumentContents[sId]; var oDocumentContent = mapDocumentContents[sId];
...@@ -798,6 +802,7 @@ CWordCollaborativeEditing.prototype.Undo = function() ...@@ -798,6 +802,7 @@ CWordCollaborativeEditing.prototype.Undo = function()
arrReverseChanges.push(oHistoryPoint.Items[nIndex].Data); arrReverseChanges.push(oHistoryPoint.Items[nIndex].Data);
} }
oHistory.Remove_LastPoint(); oHistory.Remove_LastPoint();
this.Clear_DCChanges();
var oBinaryWriter = AscCommon.History.BinaryWriter; var oBinaryWriter = AscCommon.History.BinaryWriter;
var aSendingChanges = []; var aSendingChanges = [];
......
...@@ -5334,7 +5334,6 @@ Paragraph.prototype = ...@@ -5334,7 +5334,6 @@ Paragraph.prototype =
if ((para_Hyperlink === CurElement.Type || para_Math === CurElement.Type || para_Field === CurElement.Type) && true === CurElement.Is_Empty() && true !== CurElement.Is_CheckingNearestPos()) if ((para_Hyperlink === CurElement.Type || para_Math === CurElement.Type || para_Field === CurElement.Type) && true === CurElement.Is_Empty() && true !== CurElement.Is_CheckingNearestPos())
{ {
this.Internal_Content_Remove(CurPos); this.Internal_Content_Remove(CurPos);
CurPos++;
} }
else if (para_Comment === CurElement.Type && false === CurElement.Start) else if (para_Comment === CurElement.Type && false === CurElement.Start)
{ {
......
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