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

правка бага 21439 - Создавать комментарий рядом с выделенным объектом

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50801 954022d7-b5bf-4e40-9824-e11837661b57
parent 8ebe48c6
......@@ -6792,19 +6792,46 @@ CPresentation.prototype =
// Функции для работы с комментариями
//-----------------------------------------------------------------------------------
Add_Comment : function(CommentData)
{
if(this.Slides[this.CurPage])
{
History.Create_NewPoint();
var Comment = new CComment( this.Comments, CommentData );
Comment.selected = true;
var positionX, positionY;
var slide = this.Slides[this.CurPage];
var selected_objects;
if(slide.graphicObjects.State.group)
{
selected_objects = slide.graphicObjects.State.group.selectedObjects;
}
else
{
selected_objects = slide.graphicObjects.selectedObjects;
}
if(selected_objects.length > 0)
{
var last_object = selected_objects[selected_objects.length - 1];
Comment.setPosition(last_object.x + last_object.extX, last_object.y);
}
else
{
Comment.setPosition(this.Slides[this.CurPage].commentX, this.Slides[this.CurPage].commentY);
}
var Flags = 0;
var dd = editor.WordControl.m_oDrawingDocument;
var W = dd.GetCommentWidth(Flags);
var H = dd.GetCommentHeight(Flags);
this.Slides[this.CurPage].commentX += W;
this.Slides[this.CurPage].commentY += H;
if(this.Document_Is_SelectionLocked(changestype_AddComment, Comment) === false)
{
for(var i = this.Slides[this.CurPage].slideComments.comments.length - 1; i > -1; --i)
{
this.Slides[this.CurPage].slideComments.comments[i].selected = false;
}
this.Slides[this.CurPage].commentX += COMMENT_WIDTH;
this.Slides[this.CurPage].commentY += COMMENT_HEIGHT;
this.Slides[this.CurPage].addComment(Comment);
this.DrawingDocument.OnRecalculatePage(this.CurPage, this.Slides[this.CurPage]);
......@@ -6815,6 +6842,7 @@ CPresentation.prototype =
{
this.Document_Undo();
}
}
},
Change_Comment : function(Id, CommentData)
......
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