Commit 5a8475c5 authored by Dmitry.Vikulov's avatar Dmitry.Vikulov Committed by Alexander.Trofimov

- Fix Bug 20098 - Не происходит перемещение комментария при "перетаскивании"...

- Fix Bug 20098 - Не происходит перемещение комментария при "перетаскивании" ячейки содержащей комментарий
- asc_showComment(id, bNew)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49564 954022d7-b5bf-4e40-9824-e11837661b57
parent 53e7f531
......@@ -2218,9 +2218,9 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
ws.cellCommentator.asc_selectComment(id);
},
asc_showComment: function(id) {
asc_showComment: function(id, bNew) {
var ws = this.wb.getWorksheet();
ws.cellCommentator.asc_showComment(id);
ws.cellCommentator.asc_showComment(id, bNew);
},
asc_findComment: function(id) {
......
......@@ -627,6 +627,34 @@ function asc_CCellCommentator(currentSheet) {
}
}
_this.moveRangeComments = function(rangeFrom, rangeTo) {
if ( rangeFrom && rangeTo ) {
var colOffset = rangeTo.c1 - rangeFrom.c1;
var rowOffset = rangeTo.r1 - rangeFrom.r1;
for (var i = 0; i < _this.aComments.length; i++) {
var comment = _this.aComments[i];
if ( (comment.nCol >= rangeFrom.c1) && (comment.nCol <= rangeFrom.c2) && (comment.nRow >= rangeFrom.r1) && (comment.nRow <= rangeFrom.r2) ) {
var commentBefore = new asc_CCommentData(comment);
comment.nCol += colOffset;
comment.nRow += rowOffset;
var commentAfter = new asc_CCommentData(comment);
var compositeComment = new CompositeCommentData();
compositeComment.commentBefore = commentBefore;
compositeComment.commentAfter = commentAfter;
History.Create_NewPoint();
History.Add(g_oUndoRedoComment, historyitem_Comment_Change, _this.worksheet.model.getId(), null, compositeComment);
}
}
}
}
_this.addCommentSerialize = function(oComment) {
var _this = this;
......@@ -1234,7 +1262,7 @@ asc_CCellCommentator.prototype = {
// Main
asc_showComment: function(id) {
asc_showComment: function(id, bNew) {
var _this = this;
var comment = _this.asc_findComment(id);
......@@ -1261,7 +1289,7 @@ asc_CCellCommentator.prototype = {
if ( _this.lastSelectedId != id )
_this.worksheet.model.workbook.handlers.trigger("asc_onHideComment");
_this.worksheet.model.workbook.handlers.trigger("asc_onShowComment", indexes, coords.asc_getLeftPX(), coords.asc_getTopPX(), coords.asc_getReverseLeftPX());
_this.worksheet.model.workbook.handlers.trigger("asc_onShowComment", indexes, coords.asc_getLeftPX(), coords.asc_getTopPX(), coords.asc_getReverseLeftPX(), bNew);
_this.drawCommentCells();
}
_this.lastSelectedId = id;
......
......@@ -6890,6 +6890,7 @@
t.activeRange = arnTo.clone(true);
t.activeRange.startRow = t.activeRange.r1;
t.activeRange.startCol = t.activeRange.c1;
t.cellCommentator.moveRangeComments(arnFrom, arnTo);
t.objectRender.moveRangeDrawingObject(arnFrom, arnTo, false);
// Вызываем функцию пересчета для заголовков форматированной таблицы
t.autoFilters._renameTableColumn(t, arnFrom);
......
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