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

fix Bug 34362

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