Commit ca221c82 authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug #33827. Added a correction of paragraph content after performing of collaboration undo.

parent 7c7aaab1
......@@ -748,7 +748,7 @@ CWordCollaborativeEditing.prototype.Undo = function()
mapDocumentContents[oClass.Get_Id()] = oClass;
else if (oClass instanceof AscCommonWord.Paragraph)
mapParagraphs[oClass.Get_Id()] = oClass;
else if (oClass instanceof AscCommonWord.ParaRun && true === oChange.IsContentChange() && oClass.Get_Paragraph())
else if (oClass.IsParagraphContentElement && true === oClass.IsParagraphContentElement() && true === oChange.IsContentChange() && oClass.Get_Paragraph())
mapParagraphs[oClass.Get_Paragraph().Get_Id()] = oClass.Get_Paragraph();
}
......@@ -768,6 +768,7 @@ CWordCollaborativeEditing.prototype.Undo = function()
for (var sId in mapParagraphs)
{
var oParagraph = mapParagraphs[sId];
oParagraph.Correct_Content();
oParagraph.CheckParaEnd();
}
var oHistoryPoint = oHistory.Points[oHistory.Points.length - 1];
......
......@@ -38,6 +38,10 @@ CParagraphContentBase.prototype.CanSplit = function()
{
return false;
};
CParagraphContentBase.prototype.IsParagraphContentElement = function()
{
return true;
};
/**
* Это базовый класс для элементов содержимого(контент) параграфа, у которых есть свое содержимое.
......@@ -1898,6 +1902,9 @@ CParagraphContentWithParagraphLikeContent.prototype.Get_EndPos = function(Behind
//----------------------------------------------------------------------------------------------------------------------
CParagraphContentWithParagraphLikeContent.prototype.Set_SelectionContentPos = function(StartContentPos, EndContentPos, Depth, StartFlag, EndFlag)
{
if (this.Content.length <= 0)
return;
var Selection = this.Selection;
var OldStartPos = Selection.StartPos;
......@@ -1980,6 +1987,9 @@ CParagraphContentWithParagraphLikeContent.prototype.Set_SelectionContentPos = fu
};
CParagraphContentWithParagraphLikeContent.prototype.Set_ContentSelection = function(StartDocPos, EndDocPos, Depth, StartFlag, EndFlag)
{
if (this.Content.length <= 0)
return;
if ((0 === StartFlag && (!StartDocPos[Depth] || this !== StartDocPos[Depth].Class)) || (0 === EndFlag && (!EndDocPos[Depth] || this !== EndDocPos[Depth].Class)))
return;
......@@ -2076,6 +2086,9 @@ CParagraphContentWithParagraphLikeContent.prototype.Set_ContentSelection = funct
};
CParagraphContentWithParagraphLikeContent.prototype.Set_ContentPosition = function(DocPos, Depth, Flag)
{
if (this.Content.length <= 0)
return;
if (0 === Flag && (!DocPos[Depth] || this !== DocPos[Depth].Class))
return;
......
......@@ -1877,7 +1877,7 @@ background-repeat: no-repeat;\
{
this.IsUserSave = !isAutoSave;
if (true === this.canSave && !this.isLongAction() && (this.asc_isDocumentCanSave() || History.Have_Changes() ||
AscCommon.CollaborativeEditing.Have_OtherChanges()))
AscCommon.CollaborativeEditing.Have_OtherChanges() || true === isUndoRequest))
{
this.canSave = false;
......
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