Commit 23fc824b authored by Sergey Luzyanin's avatar Sergey Luzyanin

remove redundant shape after Undo

parent d12953ba
...@@ -1012,12 +1012,6 @@ CCollaborativeEditingBase.prototype.private_RestoreDocumentState = function(DocS ...@@ -1012,12 +1012,6 @@ CCollaborativeEditingBase.prototype.private_RestoreDocumentState = function(DocS
} }
} }
for(var sId in mapSlides){
if(mapSlides.hasOwnProperty(sId)){
mapSlides[sId].correctContent();
}
}
if(bChangedLayout){ if(bChangedLayout){
for(var i = oLogicDocument.Slides.length - 1; i > -1 ; --i){ for(var i = oLogicDocument.Slides.length - 1; i > -1 ; --i){
var Layout = oLogicDocument.Slides[i].Layout; var Layout = oLogicDocument.Slides[i].Layout;
......
...@@ -700,6 +700,8 @@ Slide.prototype = ...@@ -700,6 +700,8 @@ 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].CheckCorrect && !this.cSld.spTree[i].CheckCorrect() || 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){ if(this.cSld.spTree[i].setBDeleted){
...@@ -707,13 +709,12 @@ Slide.prototype = ...@@ -707,13 +709,12 @@ Slide.prototype =
} }
this.removeFromSpTreeById(this.cSld.spTree[i].Get_Id()); this.removeFromSpTreeById(this.cSld.spTree[i].Get_Id());
} }
else{ }
for(var j = i - 1; j > -1; --j){ for(var i = this.cSld.spTree.length - 1; i > -1 ; --i){
if(this.cSld.spTree[i] === this.cSld.spTree[j]){ for(var j = i - 1; j > -1; --j){
this.cSld.spTree[i].setBDeleted(true); if(this.cSld.spTree[i] === this.cSld.spTree[j]){
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