Commit 8ddb8401 authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix bug 32850

parent 33332d26
This diff is collapsed.
......@@ -2460,8 +2460,14 @@
if(oThis.isCopyPaste)
window["Asc"]["editor"].wb._initCommentsToSave();
if(ws.aComments.length > 0 && ws.aCommentsCoords.length > 0)
this.bs.WriteItem(c_oSerWorksheetsTypes.Comments, function(){oThis.WriteComments(ws.aComments, ws.aCommentsCoords);});
var aComments = (0 === index) ? this.wb.aComments.concat(ws.aComments) : ws.aComments;
var aCommentsCoords = (0 === index) ? this.wb.aCommentsCoords.concat(ws.aCommentsCoords) :
ws.aCommentsCoords;
if (aComments.length > 0 && aCommentsCoords.length > 0) {
this.bs.WriteItem(c_oSerWorksheetsTypes.Comments, function () {
oThis.WriteComments(aComments, aCommentsCoords);
});
}
var oBinaryTableWriter;
if(null != ws.AutoFilter && !this.isCopyPaste)
......
......@@ -1983,6 +1983,7 @@ function Workbook(eventsHandlers, oApi){
this.oStyleManager = new AscCommonExcel.StyleManager();
this.calcChain = [];
this.aComments = []; // Комментарии к документу
this.aCommentsCoords = [];
this.aWorksheets = [];
this.aWorksheetsById = {};
this.cwf = {};
......
......@@ -2397,21 +2397,20 @@
};
WorkbookView.prototype._initCommentsToSave = function() {
var isFirst = true;
var isFirst = true, wsView, wsModel, tmpWs;
for (var wsKey in this.wsViews) {
var wsView = this.wsViews[wsKey];
var wsModel = wsView.model;
wsView.cellCommentator.prepareCommentsToSave();
wsModel.aCommentsCoords = wsView.cellCommentator.aCommentCoords;
wsView = this.wsViews[wsKey];
wsModel = wsView.model;
wsModel.aCommentsCoords = wsView.cellCommentator.getCoordsToSave();
if (isFirst) {
isFirst = false;
tmpWs = this.cellCommentator.worksheet;
this.cellCommentator.worksheet = wsView;
this.cellCommentator.overlayCtx = wsView.overlayCtx;
this.cellCommentator.drawingCtx = wsView.drawingCtx;
this.cellCommentator.prepareCommentsToSave();
wsModel.aComments = wsModel.aComments.concat(this.model.aComments);
wsModel.aCommentsCoords = wsModel.aCommentsCoords.concat(this.cellCommentator.aCommentCoords);
this.model.aCommentsCoords = this.cellCommentator.getCoordsToSave();
this.cellCommentator.worksheet = tmpWs;
}
}
};
......
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