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 =
case historyitem_Presentation_RemoveSlide:
{
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)
{
this.DrawingDocument.OnRecalculatePage(i, this.Slides[i]);
......@@ -3887,6 +3891,10 @@ CPresentation.prototype =
}
case historyitem_Presentation_RemoveSlide:
{
if(this.Slides[Data.Pos])
{
this.Slides[Data.Pos].removeAllCommentsToInterface();
}
this.Slides.splice(Data.Pos, 1);
for(var i = 0; i < this.Slides.length; ++i)
{
......@@ -4528,6 +4536,7 @@ CPresentation.prototype =
if(isRealNumber(pos) && pos > -1 && pos < this.Slides.length)
{
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 null;
......@@ -4688,6 +4697,10 @@ CPresentation.prototype =
if ( false === ChangesPos )
break;
this.slidesToUnlock.push(ChangesPos);
if(this.Slides[ChangesPos])
{
this.Slides[ChangesPos].removeAllCommentsToInterface();
}
this.Slides.splice(ChangesPos, 1);
break;
}
......
......@@ -1104,6 +1104,31 @@ Slide.prototype =
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()
{
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