Commit d4adee71 authored by Sergey Luzyanin's avatar Sergey Luzyanin

Checking run's content after undo

parent 0bae0db6
......@@ -945,6 +945,7 @@ CCollaborativeEditingBase.prototype.private_RestoreDocumentState = function(DocS
var mapDocumentContents = {};
var mapParagraphs = {};
var mapDrawings = {};
var mapRuns = {};
for (var nIndex = 0, nCount = arrReverseChanges.length; nIndex < nCount; ++nIndex)
{
var oChange = arrReverseChanges[nIndex];
......@@ -958,6 +959,9 @@ CCollaborativeEditingBase.prototype.private_RestoreDocumentState = function(DocS
else if(oClass instanceof AscCommonWord.ParaDrawing){
mapDrawings[oClass.Get_Id()] = oClass;
}
else if(oClass instanceof AscCommonWord.ParaRun){
mapRuns[oClass.Get_Id()] = oClass;
}
}
// Создаем точку в истории. Делаем действия через обычные функции (с отключенным пересчетом), которые пишут в
......@@ -982,6 +986,23 @@ CCollaborativeEditingBase.prototype.private_RestoreDocumentState = function(DocS
}
}
for(var sId in mapRuns){
if (mapRuns.hasOwnProperty(sId))
{
var oRun = mapRuns[sId];
for(var nIndex = oRun.Content.length - 1; nIndex > - 1; --nIndex){
if(oRun.Content[nIndex] instanceof AscCommonWord.ParaDrawing){
if(!oRun.Content[nIndex].CheckCorrect()){
oRun.Remove_FromContent(nIndex, 1, false);
if(oRun.Paragraph){
mapParagraphs[oRun.Paragraph.Get_Id()] = oRun.Paragraph;
}
}
}
}
}
}
for (var sId in mapDocumentContents)
{
var oDocumentContent = mapDocumentContents[sId];
......
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