Commit 19dc71fc authored by Sergey.Konovalov's avatar Sergey.Konovalov

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