Commit 67a000bd authored by Alexander.Trofimov's avatar Alexander.Trofimov

add clean data to undo/redo

parent e94ee286
......@@ -171,6 +171,8 @@ function (window, undefined) {
window['AscCH'].historyitem_Sparkline_ColorLow = 25;
window['AscCH'].historyitem_Sparkline_F = 26;
window['AscCH'].historyitem_Sparkline_Clone_Sparklines = 27;
window['AscCH'].historyitem_Sparkline_Remove_Data = 28;
window['AscCH'].historyitem_Sparkline_Remove_Sparkline = 29;
function CHistory()
{
......
......@@ -4583,7 +4583,7 @@ Woorksheet.prototype.setRowHidden=function(bHidden, start, stop){
{
updateRange = new Asc.Range(0, startIndex, gc_nMaxCol0, endIndex);
History.Add(AscCommonExcel.g_oUndoRedoWorksheet, AscCH.historyitem_Worksheet_RowHide, oThis.getId(), updateRange, new UndoRedoData_FromToRowCol(bHidden, startIndex, endIndex));
}
}
startIndex = row.index;
endIndex = row.index;
......@@ -5709,6 +5709,7 @@ Woorksheet.prototype.updateSparklineCache = function(sheet, ranges) {
Woorksheet.prototype.removeSparkline = function (range) {
for (var i = 0; i < this.aSparklineGroups.length; ++i) {
if (this.aSparklineGroups[i].remove(range)) {
History.Add(this.aSparklineGroups[i], AscCH.historyitem_Sparkline_Remove_Sparkline, this.getId(), null, null);
this.aSparklineGroups.splice(i--, 1);
}
}
......
......@@ -5004,6 +5004,14 @@ CellArea.prototype = {
case AscCH.historyitem_Sparkline_F:
this.f = data.oldPr;
break;
case AscCH.historyitem_Sparkline_Remove_Data:
this.arrSparklines.push(data.oldPr);
break;
case AscCH.historyitem_Sparkline_Remove_Sparkline:
if (this.worksheet) {
this.worksheet.insertSparklineGroup(this);
}
break;
}
this.cleanCache();
......@@ -5088,6 +5096,14 @@ CellArea.prototype = {
case AscCH.historyitem_Sparkline_F:
this.f = data.newPr;
break;
case AscCH.historyitem_Sparkline_Remove_Data:
this.remove(data.oldPr.sqref);
break;
case AscCH.historyitem_Sparkline_Remove_Sparkline:
if (this.worksheet) {
this.worksheet.removeSparklineGroup(this.Get_Id());
}
break;
}
this.cleanCache();
};
......@@ -5227,12 +5243,17 @@ CellArea.prototype = {
sparklineGroup.prototype.remove = function (range) {
for (var i = 0; i < this.arrSparklines.length; ++i) {
if (this.arrSparklines[i].checkInRange(range)) {
History.Add(this, {Type: AscCH.historyitem_Sparkline_Remove_Data, oldPr: this.arrSparklines[i], newPr: null});
this.arrSparklines.splice(i, 1);
--i;
}
}
return 0 === this.arrSparklines.length;
var bRemove = 0 === this.arrSparklines.length;
if (bRemove) {
History.Add(this, {Type: AscCH.historyitem_Sparkline_Remove_Sparkline, oldPr: this, newPr: null});
}
return bRemove;
};
sparklineGroup.prototype.asc_getId = function () {
return this.Id;
......
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