Commit e05801a1 authored by Alexander.Trofimov's avatar Alexander.Trofimov

History constants to closure

parent 06962dfe
......@@ -2998,7 +2998,7 @@ var editor;
}
History.Create_NewPoint();
//не делаем Duplicate потому что предполагаем что схема не будет менять частями, а только обьектом целиком.
History.Add(AscCommonExcel.g_oUndoRedoWorkbook, historyitem_Workbook_ChangeColorScheme, null, null, new AscCommonExcel.UndoRedoData_ClrScheme(oldClrScheme, theme.themeElements.clrScheme));
History.Add(AscCommonExcel.g_oUndoRedoWorkbook, AscCH.historyitem_Workbook_ChangeColorScheme, null, null, new AscCommonExcel.UndoRedoData_ClrScheme(oldClrScheme, theme.themeElements.clrScheme));
t.asc_AfterChangeColorScheme();
}
};
......
......@@ -450,7 +450,7 @@ CCellCommentator.prototype.moveRangeComments = function(rangeFrom, rangeTo) {
compositeComment.commentAfter = commentAfter;
History.Create_NewPoint();
History.Add(AscCommonExcel.g_oUndoRedoComment, historyitem_Comment_Change, this.worksheet.model.getId(), null, compositeComment);
History.Add(AscCommonExcel.g_oUndoRedoComment, AscCH.historyitem_Comment_Change, this.worksheet.model.getId(), null, compositeComment);
}
}
}
......@@ -1124,7 +1124,7 @@ CCellCommentator.prototype.changeComment = function(id, oComment, bChangeCoords,
compositeComment.commentAfter = commentAfter;
History.Create_NewPoint();
History.Add(AscCommonExcel.g_oUndoRedoComment, historyitem_Comment_Change, t.worksheet.model.getId(), null, compositeComment);
History.Add(AscCommonExcel.g_oUndoRedoComment, AscCH.historyitem_Comment_Change, t.worksheet.model.getId(), null, compositeComment);
}
if (!bNoDraw)
......@@ -1231,7 +1231,7 @@ CCellCommentator.prototype._addComment = function (oComment, bChange, bIsNotUpda
// Add new comment
if (!bChange) {
History.Create_NewPoint();
History.Add(AscCommonExcel.g_oUndoRedoComment, historyitem_Comment_Add, this.worksheet.model.getId(), null, new asc_CCommentData(oComment));
History.Add(AscCommonExcel.g_oUndoRedoComment, AscCH.historyitem_Comment_Add, this.worksheet.model.getId(), null, new asc_CCommentData(oComment));
this.aComments.push(oComment);
......@@ -1252,7 +1252,7 @@ CCellCommentator.prototype._removeComment = function (comment, bNoEvent, isDraw)
if (this.bSaveHistory) {
History.Create_NewPoint();
History.Add(AscCommonExcel.g_oUndoRedoComment, historyitem_Comment_Remove, this.worksheet.model.getId(), null, new asc_CCommentData(comment.oParent.aReplies[i]));
History.Add(AscCommonExcel.g_oUndoRedoComment, AscCH.historyitem_Comment_Remove, this.worksheet.model.getId(), null, new asc_CCommentData(comment.oParent.aReplies[i]));
}
comment.oParent.aReplies.splice(i, 1);
......@@ -1265,7 +1265,7 @@ CCellCommentator.prototype._removeComment = function (comment, bNoEvent, isDraw)
if (this.bSaveHistory) {
History.Create_NewPoint();
History.Add(AscCommonExcel.g_oUndoRedoComment, historyitem_Comment_Remove, this.worksheet.model.getId(), null, new asc_CCommentData(this.aComments[i]));
History.Add(AscCommonExcel.g_oUndoRedoComment, AscCH.historyitem_Comment_Remove, this.worksheet.model.getId(), null, new asc_CCommentData(this.aComments[i]));
}
this.aComments.splice(i, 1);
......@@ -1334,7 +1334,7 @@ CCellCommentator.prototype.Undo = function(type, data) {
var i, parentComment;
switch (type) {
case historyitem_Comment_Add:
case AscCH.historyitem_Comment_Add:
if (data.oParent) {
parentComment = this.findComment(data.oParent.asc_getId());
for (i = 0; i < parentComment.aReplies.length; i++) {
......@@ -1354,7 +1354,7 @@ CCellCommentator.prototype.Undo = function(type, data) {
}
break;
case historyitem_Comment_Remove:
case AscCH.historyitem_Comment_Remove:
if (data.oParent) {
parentComment = this.findComment(data.oParent.asc_getId());
parentComment.aReplies.push(data);
......@@ -1364,7 +1364,7 @@ CCellCommentator.prototype.Undo = function(type, data) {
}
break;
case historyitem_Comment_Change:
case AscCH.historyitem_Comment_Change:
if (data.commentAfter.oParent) {
parentComment = this.findComment(data.commentAfter.oParent.asc_getId());
for (i = 0; i < parentComment.aReplies.length; i++) {
......@@ -1393,7 +1393,7 @@ CCellCommentator.prototype.Redo = function(type, data) {
var parentComment, i;
switch (type) {
case historyitem_Comment_Add:
case AscCH.historyitem_Comment_Add:
if (data.oParent) {
parentComment = this.findComment(data.oParent.asc_getId());
parentComment.aReplies.push(data);
......@@ -1403,7 +1403,7 @@ CCellCommentator.prototype.Redo = function(type, data) {
}
break;
case historyitem_Comment_Remove:
case AscCH.historyitem_Comment_Remove:
if (data.oParent) {
parentComment = this.findComment(data.oParent.asc_getId());
for (i = 0; i < parentComment.aReplies.length; i++) {
......@@ -1423,7 +1423,7 @@ CCellCommentator.prototype.Redo = function(type, data) {
}
break;
case historyitem_Comment_Change:
case AscCH.historyitem_Comment_Change:
if (data.commentBefore.oParent) {
parentComment = this.findComment(data.commentBefore.oParent.asc_getId());
for (i = 0; i < parentComment.aReplies.length; i++) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -26,6 +26,12 @@ var Asc = window["Asc"];
window["AscCommon"] = {};
var AscCommon = window["AscCommon"];
window["AscDFH"] = {};
var AscDFH = window["AscDFH"];
window["AscCH"] = {};
var AscCH = window["AscCH"];
window["AscCommonExcel"] = {};
var AscCommonExcel = window["AscCommonExcel"];
......
......@@ -644,30 +644,30 @@
});
this.model.handlers.add("undoRedoAddRemoveRowCols", function(sheetId, type, range, bUndo) {
if (true === bUndo) {
if (historyitem_Worksheet_AddRows === type) {
if (AscCH.historyitem_Worksheet_AddRows === type) {
self.collaborativeEditing.removeRowsRange(sheetId, range.clone(true));
self.collaborativeEditing.undoRows(sheetId, range.r2 - range.r1 + 1);
} else if (historyitem_Worksheet_RemoveRows === type) {
} else if (AscCH.historyitem_Worksheet_RemoveRows === type) {
self.collaborativeEditing.addRowsRange(sheetId, range.clone(true));
self.collaborativeEditing.undoRows(sheetId, range.r2 - range.r1 + 1);
} else if (historyitem_Worksheet_AddCols === type) {
} else if (AscCH.historyitem_Worksheet_AddCols === type) {
self.collaborativeEditing.removeColsRange(sheetId, range.clone(true));
self.collaborativeEditing.undoCols(sheetId, range.c2 - range.c1 + 1);
} else if (historyitem_Worksheet_RemoveCols === type) {
} else if (AscCH.historyitem_Worksheet_RemoveCols === type) {
self.collaborativeEditing.addColsRange(sheetId, range.clone(true));
self.collaborativeEditing.undoCols(sheetId, range.c2 - range.c1 + 1);
}
} else {
if (historyitem_Worksheet_AddRows === type) {
if (AscCH.historyitem_Worksheet_AddRows === type) {
self.collaborativeEditing.addRowsRange(sheetId, range.clone(true));
self.collaborativeEditing.addRows(sheetId, range.r1, range.r2 - range.r1 + 1);
} else if (historyitem_Worksheet_RemoveRows === type) {
} else if (AscCH.historyitem_Worksheet_RemoveRows === type) {
self.collaborativeEditing.removeRowsRange(sheetId, range.clone(true));
self.collaborativeEditing.removeRows(sheetId, range.r1, range.r2 - range.r1 + 1);
} else if (historyitem_Worksheet_AddCols === type) {
} else if (AscCH.historyitem_Worksheet_AddCols === type) {
self.collaborativeEditing.addColsRange(sheetId, range.clone(true));
self.collaborativeEditing.addCols(sheetId, range.c1, range.c2 - range.c1 + 1);
} else if (historyitem_Worksheet_RemoveCols === type) {
} else if (AscCH.historyitem_Worksheet_RemoveCols === type) {
self.collaborativeEditing.removeColsRange(sheetId, range.clone(true));
self.collaborativeEditing.removeCols(sheetId, range.c1, range.c2 - range.c1 + 1);
}
......
......@@ -3485,7 +3485,7 @@
}
History.Create_NewPoint();
var oData = new AscCommonExcel.UndoRedoData_FromTo( new AscCommonExcel.UndoRedoData_BBox( new asc_Range( lastCol, lastRow, lastCol, lastRow ) ), new AscCommonExcel.UndoRedoData_BBox( new asc_Range( col, row, col, row ) ), null );
History.Add( AscCommonExcel.g_oUndoRedoWorksheet, historyitem_Worksheet_ChangeFrozenCell, this.model.getId(), null, oData );
History.Add( AscCommonExcel.g_oUndoRedoWorksheet, AscCH.historyitem_Worksheet_ChangeFrozenCell, this.model.getId(), null, oData );
var isUpdate = false;
if ( 0 === col && 0 === row ) { // Очистка
......
......@@ -22,6 +22,12 @@ var Asc = window["Asc"];
window["AscCommon"] = {};
var AscCommon = window["AscCommon"];
window["AscDFH"] = {};
var AscDFH = window["AscDFH"];
window["AscCH"] = {};
var AscCH = window["AscCH"];
window["AscCommonExcel"] = {};
var AscCommonExcel = window["AscCommonExcel"];
......
......@@ -2338,7 +2338,7 @@ CTableId.prototype.Load_Changes = function(Reader, Reader2)
// console.log("----------------------------");
// console.log("FileCheckSum " + FileCheckSum);
// console.log("FileSize " + FileSize);
// console.log("Description " + Description + " " + Get_HistoryPointStringDescription(Description));
// console.log("Description " + Description + " " + AscDFH.Get_HistoryPointStringDescription(Description));
// console.log("PointIndex " + PointIndex);
// console.log("StartPoint " + StartPoint);
// console.log("LastPoint " + LastPoint);
......
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