Commit 291e0770 authored by Alexander.Trofimov's avatar Alexander.Trofimov

History constants to closure

parent ea6b2f1f
......@@ -3022,7 +3022,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();
}
};
......
......@@ -474,7 +474,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);
}
}
}
......@@ -1148,7 +1148,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)
......@@ -1255,7 +1255,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);
......@@ -1276,7 +1276,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);
......@@ -1289,7 +1289,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);
......@@ -1358,7 +1358,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++) {
......@@ -1378,7 +1378,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);
......@@ -1388,7 +1388,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++) {
......@@ -1417,7 +1417,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);
......@@ -1427,7 +1427,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++) {
......@@ -1447,7 +1447,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.
......@@ -50,6 +50,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"];
......
......@@ -668,30 +668,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);
}
......
......@@ -3509,7 +3509,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 ) { // Очистка
......
......@@ -46,6 +46,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"];
......
......@@ -2362,7 +2362,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