Commit 59d0ee6a authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

для Bug 29044 - Теряется содержимое формулы в ячейке при открытии документа XLSX (s29_5.xlsx)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@61959 954022d7-b5bf-4e40-9824-e11837661b57
parent 3403fa46
......@@ -5173,7 +5173,6 @@
this.bcr = new Binary_CommonReader(this.stream);
this.aMerged = [];
this.aHyperlinks = [];
this.aFormulaExt = [];
this.copyPasteObj = copyPasteObj;
this.curWorksheet = null;
this.Read = function()
......@@ -5191,8 +5190,8 @@
{
this.aMerged = [];
this.aHyperlinks = [];
this.aFormulaExt = [];
var oNewWorksheet = new Woorksheet(this.wb, wb.aWorksheets.length);
oNewWorksheet.aFormulaExt = [];
//TODO при copy/paste в word из excel необходимо подменить DrawingDocument из word - пересмотреть правку!
if(typeof editor != "undefined" && editor && editor.WordControl && editor.WordControl.m_oLogicDocument && editor.WordControl.m_oLogicDocument.DrawingDocument)
......@@ -5227,7 +5226,6 @@
if (null !== hyperlink.Ref)
hyperlink.Ref.setHyperlinkOpen(hyperlink);
}
oNewWorksheet.init(this.aFormulaExt);
this.wb.aWorksheets.push(oNewWorksheet);
this.wb.aWorksheetsById[oNewWorksheet.getId()] = oNewWorksheet;
}
......@@ -5736,7 +5734,7 @@
res = this.bcr.Read2Spreadsheet(length, function(t,l){
return oThis.ReadFormula(t,l, oFormulaExt);
});
this.aFormulaExt.push({cell: oCell, ext: oFormulaExt});
ws.aFormulaExt.push({cell: oCell, ext: oFormulaExt});
}
else if( c_oSerCellTypes.Value == type )
oCell.oValue.number = this.stream.GetDoubleLE();
......
......@@ -1364,7 +1364,6 @@ Workbook.prototype.createWorksheet=function(indexBefore, sName, sId){
if(true == this.checkValidSheetName(sName))
oNewWorksheet.sName = sName;
}
oNewWorksheet.init();
oNewWorksheet.initPostOpen();
if(null != indexBefore && indexBefore >= 0 && indexBefore < this.aWorksheets.length)
this.aWorksheets.splice(indexBefore, 0, oNewWorksheet);
......@@ -1395,7 +1394,6 @@ Workbook.prototype.copyWorksheet=function(index, insertBefore, sName, sId, bFrom
if(true == this.checkValidSheetName(sName))
newSheet.sName = sName;
}
newSheet.init();
newSheet.initPostOpen();
if(null != insertBefore && insertBefore >= 0 && insertBefore < this.aWorksheets.length){
//помещаем новый sheet перед insertBefore
......@@ -2105,6 +2103,7 @@ function Woorksheet(wb, _index, sId){
this.sheetViews = [];
this.aConditionalFormatting = [];
this.sheetPr = null;
this.aFormulaExt = null;
this.oDrawingOjectsManager = new DrawingObjectsManager(this);
this.contentChanges = new CContentChanges();
......@@ -2252,12 +2251,12 @@ Woorksheet.prototype.copyDrawingObjects=function(oNewWs, wsFrom)
drawingObjects.updateChartReferences2(parserHelp.getEscapeSheetName(wsFrom.sName), parserHelp.getEscapeSheetName(oNewWs.sName));
}
};
Woorksheet.prototype.init=function(aFormulaExt){
Woorksheet.prototype.initPostOpen = function(){
this.workbook.cwf[this.Id]={ cells:{} };
if(aFormulaExt){
if(this.aFormulaExt){
var formulaShared = {};
for(var i = 0; i < aFormulaExt.length; ++i){
var elem = aFormulaExt[i];
for(var i = 0; i < this.aFormulaExt.length; ++i){
var elem = this.aFormulaExt[i];
var oCell = elem.cell;
var sCellId = g_oCellAddressUtils.getCellId(oCell.nRow, oCell.nCol);
var oFormulaExt = elem.ext;
......@@ -2314,9 +2313,9 @@ Woorksheet.prototype.init=function(aFormulaExt){
this.workbook.needRecalc.length++;
}
}
this.aFormulaExt = null;
}
};
Woorksheet.prototype.initPostOpen = function(){
if (!this.PagePrintOptions) {
// Даже если не было, создадим
this.PagePrintOptions = new Asc.asc_CPageOptions();
......
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