Commit b0aaff40 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

Bug 31234 - В меню остается комментарий после удаления слайда

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@67066 954022d7-b5bf-4e40-9824-e11837661b57
parent 91761edd
...@@ -3839,6 +3839,10 @@ CPresentation.prototype = ...@@ -3839,6 +3839,10 @@ CPresentation.prototype =
case historyitem_Presentation_RemoveSlide: case historyitem_Presentation_RemoveSlide:
{ {
this.Slides.splice(Data.Pos, 0, g_oTableId.Get_ById(Data.Id)); this.Slides.splice(Data.Pos, 0, g_oTableId.Get_ById(Data.Id));
if(this.Slides[Data.Pos])
{
this.Slides[Data.Pos].addAllCommentsToInterface();
}
for(var i = 0; i < this.Slides.length; ++i) for(var i = 0; i < this.Slides.length; ++i)
{ {
this.DrawingDocument.OnRecalculatePage(i, this.Slides[i]); this.DrawingDocument.OnRecalculatePage(i, this.Slides[i]);
...@@ -3887,6 +3891,10 @@ CPresentation.prototype = ...@@ -3887,6 +3891,10 @@ CPresentation.prototype =
} }
case historyitem_Presentation_RemoveSlide: case historyitem_Presentation_RemoveSlide:
{ {
if(this.Slides[Data.Pos])
{
this.Slides[Data.Pos].removeAllCommentsToInterface();
}
this.Slides.splice(Data.Pos, 1); this.Slides.splice(Data.Pos, 1);
for(var i = 0; i < this.Slides.length; ++i) for(var i = 0; i < this.Slides.length; ++i)
{ {
...@@ -4528,6 +4536,7 @@ CPresentation.prototype = ...@@ -4528,6 +4536,7 @@ CPresentation.prototype =
if(isRealNumber(pos) && pos > -1 && pos < this.Slides.length) if(isRealNumber(pos) && pos > -1 && pos < this.Slides.length)
{ {
History.Add(this, {Type: historyitem_Presentation_RemoveSlide, Pos: pos, Id: this.Slides[pos].Get_Id()}); History.Add(this, {Type: historyitem_Presentation_RemoveSlide, Pos: pos, Id: this.Slides[pos].Get_Id()});
this.Slides[pos].removeAllCommentsToInterface();
return this.Slides.splice(pos, 1)[0]; return this.Slides.splice(pos, 1)[0];
} }
return null; return null;
...@@ -4688,6 +4697,10 @@ CPresentation.prototype = ...@@ -4688,6 +4697,10 @@ CPresentation.prototype =
if ( false === ChangesPos ) if ( false === ChangesPos )
break; break;
this.slidesToUnlock.push(ChangesPos); this.slidesToUnlock.push(ChangesPos);
if(this.Slides[ChangesPos])
{
this.Slides[ChangesPos].removeAllCommentsToInterface();
}
this.Slides.splice(ChangesPos, 1); this.Slides.splice(ChangesPos, 1);
break; break;
} }
......
...@@ -1104,6 +1104,31 @@ Slide.prototype = ...@@ -1104,6 +1104,31 @@ Slide.prototype =
this.graphicObjects.drawSelect(0, this.presentation.DrawingDocument); this.graphicObjects.drawSelect(0, this.presentation.DrawingDocument);
}, },
addAllCommentsToInterface: function()
{
if(this.slideComments)
{
var aComments = this.slideComments.comments;
for(var i = aComments.length - 1; i > -1; --i )
{
editor.sync_AddComment( aComments[i].Get_Id(), aComments[i].Data);
}
}
},
removeAllCommentsToInterface: function()
{
if(this.slideComments)
{
var aComments = this.slideComments.comments;
for(var i = aComments.length - 1; i > -1; --i )
{
editor.sync_RemoveComment(aComments[i].Get_Id());
}
}
},
getDrawingObjects: function() getDrawingObjects: function()
{ {
return this.cSld.spTree; return this.cSld.spTree;
......
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