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
...@@ -6793,27 +6793,55 @@ CPresentation.prototype = ...@@ -6793,27 +6793,55 @@ CPresentation.prototype =
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
Add_Comment : function(CommentData) Add_Comment : function(CommentData)
{ {
History.Create_NewPoint(); if(this.Slides[this.CurPage])
var Comment = new CComment( this.Comments, CommentData );
Comment.selected = true;
Comment.setPosition(this.Slides[this.CurPage].commentX, this.Slides[this.CurPage].commentY);
if(this.Document_Is_SelectionLocked(changestype_AddComment, Comment) === false)
{ {
for(var i = this.Slides[this.CurPage].slideComments.comments.length - 1; i > -1; --i) 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)
{ {
this.Slides[this.CurPage].slideComments.comments[i].selected = false; var last_object = selected_objects[selected_objects.length - 1];
Comment.setPosition(last_object.x + last_object.extX, last_object.y);
} }
this.Slides[this.CurPage].commentX += COMMENT_WIDTH; else
this.Slides[this.CurPage].commentY += COMMENT_HEIGHT; {
this.Slides[this.CurPage].addComment(Comment); 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;
this.DrawingDocument.OnRecalculatePage(this.CurPage, this.Slides[this.CurPage]); if(this.Document_Is_SelectionLocked(changestype_AddComment, Comment) === false)
this.DrawingDocument.OnEndRecalculate(); {
return Comment; for(var i = this.Slides[this.CurPage].slideComments.comments.length - 1; i > -1; --i)
} {
else this.Slides[this.CurPage].slideComments.comments[i].selected = false;
{ }
this.Document_Undo(); this.Slides[this.CurPage].addComment(Comment);
this.DrawingDocument.OnRecalculatePage(this.CurPage, this.Slides[this.CurPage]);
this.DrawingDocument.OnEndRecalculate();
return Comment;
}
else
{
this.Document_Undo();
}
} }
}, },
......
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