Commit 80a0e4bc authored by Sergey Luzyanin's avatar Sergey Luzyanin

fix Bug 34362

parent 7508211e
......@@ -950,7 +950,9 @@ CCollaborativeEditingBase.prototype.private_RestoreDocumentState = function(DocS
var mapGrObjects = {};
var mapSlides = {};
var mapLayouts = {};
var bChangedLayout = false;
var bChangedLayout = false;
var bAddSlides = false;
var mapAddedSlides = {};
for (var nIndex = 0, nCount = arrReverseChanges.length; nIndex < nCount; ++nIndex)
{
var oChange = arrReverseChanges[nIndex];
......@@ -981,6 +983,14 @@ CCollaborativeEditingBase.prototype.private_RestoreDocumentState = function(DocS
mapLayouts[oClass.Get_Id()] = oClass;
bChangedLayout = true;
}
else if(typeof CPresentation !== "undefined" && oClass instanceof CPresentation){
if(oChange.Type === AscDFH.historyitem_Presentation_RemoveSlide || oChange.Type === AscDFH.historyitem_Presentation_AddSlide){
bAddSlides = true;
for(var i = 0; i < oChange.Items.length; ++i){
mapAddedSlides[oChange.Items[i].Get_Id()] = oChange.Items[i];
}
}
}
}
}
......@@ -988,6 +998,20 @@ CCollaborativeEditingBase.prototype.private_RestoreDocumentState = function(DocS
// историю. Сохраняем список изменений в новой точке, удаляем данную точку.
var oHistory = AscCommon.History;
oHistory.CreateNewPointForCollectChanges();
if(bAddSlides){
for(var i = oLogicDocument.Slides.length - 1; i > -1; --i){
if(mapAddedSlides[oLogicDocument.Slides[i].Get_Id()] && !oLogicDocument.Slides[i].Layout){
oLogicDocument.removeSlide(i);
}
}
}
for(var sId in mapSlides){
if(mapSlides.hasOwnProperty(sId)){
mapSlides[sId].correctContent();
}
}
for(var sId in mapSlides){
if(mapSlides.hasOwnProperty(sId)){
mapSlides[sId].correctContent();
......@@ -1005,6 +1029,7 @@ CCollaborativeEditingBase.prototype.private_RestoreDocumentState = function(DocS
}
}
for(var sId in mapGrObjects){
var oShape = mapGrObjects[sId];
if(!oShape.checkCorrect()){
......
......@@ -701,12 +701,16 @@ Slide.prototype =
correctContent: function(){
for(var i = this.cSld.spTree.length - 1; i > -1 ; --i){
if(this.cSld.spTree[i].bDeleted){
if(this.cSld.spTree[i].CheckCorrect && !this.cSld.spTree[i].CheckCorrect() || this.cSld.spTree[i].bDeleted){
if(this.cSld.spTree[i].setBDeleted){
this.cSld.spTree[i].setBDeleted(true);
}
this.removeFromSpTreeById(this.cSld.spTree[i].Get_Id());
}
else{
for(var j = i - 1; j > -1; --j){
if(this.cSld.spTree[i] === this.cSld.spTree[j]){
this.cSld.spTree[i].setBDeleted(true);
this.removeFromSpTreeByPos(i);
break;
}
......
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