Skip to content

Commit

Permalink
[bug] fix bug 72858
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyLuzyanin committed Jan 28, 2025
1 parent cfc6baf commit c601944
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions cell/model/WorkbookElems.js
Original file line number Diff line number Diff line change
Expand Up @@ -7743,7 +7743,12 @@ function RangeDataManagerElem(bbox, data)
this.colorLow = new RgbColor(defaultOtherColor);
};
sparklineGroup.prototype.setWorksheet = function (worksheet, oldWorksheet) {

let sOldId = this.worksheet ? this.worksheet.Id : null;
let sNewId = worksheet ? worksheet.Id : null;
AscCommon.History.Add(new AscDFH.CChangesDrawingsString(this, AscDFH.historyitem_Sparkline_Worksheet, sOldId, sNewId));
this.worksheet = worksheet;

if (oldWorksheet) {
var oldSparklines = [];
var newSparklines = [];
Expand Down Expand Up @@ -14740,6 +14745,14 @@ function RangeDataManagerElem(bbox, data)
oClass.applyRange(value);
oClass.addPointToLocalHistory(true);
};

AscDFH.changesFactory[AscDFH.historyitem_Sparkline_Worksheet] = AscDFH.CChangesDrawingsString;
AscDFH.drawingsChangesMap[AscDFH.historyitem_Sparkline_Worksheet] = function (oClass, value) {
let oWB = Asc.editor.wbModel;
if(!oWB) return;
let oWS = oWB.getWorksheetById(value);
oClass.worksheet = oWS;
};
/**
*
* @param ws
Expand Down
2 changes: 1 addition & 1 deletion cell/view/WorksheetView.js
Original file line number Diff line number Diff line change
Expand Up @@ -8852,7 +8852,7 @@
ws.removeSparklines(locationRange);

var modelSparkline = new AscCommonExcel.sparklineGroup(true);
modelSparkline.worksheet = ws;
modelSparkline.setWorksheet(ws);
modelSparkline.set(newSparkLine);
modelSparkline.setSparklinesFromRange(dataRange, locationRange, true);
ws.addSparklineGroups(modelSparkline);
Expand Down
1 change: 1 addition & 0 deletions common/HistoryCommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -3269,6 +3269,7 @@
window['AscDFH'].historyitem_Sparkline_ChangeData = window['AscDFH'].historyitem_type_Sparkline | 27;
window['AscDFH'].historyitem_Sparkline_RemoveData = window['AscDFH'].historyitem_type_Sparkline | 28;
window['AscDFH'].historyitem_Sparkline_RemoveSparkline = window['AscDFH'].historyitem_type_Sparkline | 29;
window['AscDFH'].historyitem_Sparkline_Worksheet = window['AscDFH'].historyitem_type_Sparkline | 30;


window['AscDFH'].historyitem_NotesMasterSetHF = window['AscDFH'].historyitem_type_NotesMaster | 1;
Expand Down

0 comments on commit c601944

Please sign in to comment.