Commit 56992df3 authored by Dmitry.Shahtanov's avatar Dmitry.Shahtanov Committed by Alexander.Trofimov

пересчет по кнопке.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53725 954022d7-b5bf-4e40-9824-e11837661b57
parent ef2da5bd
......@@ -2888,9 +2888,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
return getFormulasInfo();
},
asc_recalc : function(){
this.wbModel.recalcWB();
// this.wb.getWorksheet().changeWorksheet("update");
asc_recalc : function(isRecalcWB){
this.wbModel.recalcWB(isRecalcWB);
},
asc_setFontRenderingMode: function (mode) {
......
......@@ -150,6 +150,24 @@ DependencyGraph.prototype = {
}
}
return arr;
},
getNodeBySheetIdAll:function ( sheetId ) {
var arr = [];
var nodesSheetCell = this.nodesCell[sheetId];
if ( nodesSheetCell ) {
var aNodes = nodesSheetCell.getAll();
for ( var i = 0, length = aNodes.length; i < length; i++ ) {
arr.push( aNodes[i].data );
}
}
var nodesSheetArea = this.nodesArea[sheetId];
if ( nodesSheetArea ) {
var aNodes = nodesSheetArea.getAll();
for ( var i = 0, length = aNodes.length; i < length; i++ ) {
arr.push( aNodes[i].data );
}
}
return arr;
},
deleteNode : function(node){
if ( node.isArea ) {
......@@ -218,7 +236,7 @@ DependencyGraph.prototype = {
var toDelete = offset.offsetCol < 0 || offset.offsetRow < 0;
var bSetRefErrorOld = this.bSetRefError;
this.bSetRefError = true;
var oShiftGetBBox = shiftGetBBox(BBox, bHor);
var oShiftGetBBox = shiftGetBBox(BBox, bHor);
var sShiftGetBBoxName = oShiftGetBBox.getName();
this.wb.needRecalc.nodes[getVertexId(wsId, sShiftGetBBoxName)] = [wsId, sShiftGetBBoxName];
this.wb.needRecalc.length++;
......@@ -284,13 +302,13 @@ DependencyGraph.prototype = {
}
}
},
getCellInRange : function(sheetId, bbox){
var res = [], oGetRes, nodesSheetCell = this.nodesCell[sheetId];
getCellInRange : function(sheetId, bbox){
var res = [], oGetRes, nodesSheetCell = this.nodesCell[sheetId];
if ( nodesSheetCell ) {
oGetRes = nodesSheetCell.get(bbox);
oGetRes = nodesSheetCell.get(bbox);
for ( var i = 0, length = oGetRes.length; i < length; i++ ) {
elem = oGetRes[i];
res.push(elem.data);
res.push(elem.data);
}
}
return res;
......@@ -302,8 +320,8 @@ DependencyGraph.prototype = {
oGetRes = nodesSheetArea.get(bbox);
for(var i = 0, length = oGetRes.all.length; i < length; i++)
{
elem = oGetRes.all[i];
res.push(elem.data);
elem = oGetRes.all[i];
res.push(elem.data);
}
}
return res;
......@@ -588,10 +606,10 @@ DependencyGraph.prototype = {
bBad = oWeightMapElem.bad = true;
else {
if ( oWeightMapElem.master && oWeightMapElem.max > 1 )
{
{
//если повторно пришли в master node, то не считаем ее master
oWeightMapElem.master = false;
oWeightMapElem.max--;
oWeightMapElem.master = false;
oWeightMapElem.max--;
}
}
}
......@@ -863,9 +881,9 @@ function buildRecalc(_wb,notrec){
_rec[cellId] = cellId;
_wb.needRecalc.nodes[getVertexId(id, cellId)] = [id, cellId ];
_wb.needRecalc.length++;
}
ws._BuildDependencies(_rec);
}
ws._BuildDependencies(_rec);
}
}
if(!notrec)
sortDependency(_wb)
......@@ -1449,24 +1467,21 @@ Workbook.prototype.generateFontMap2=function(){
aRes.push(new CFont(i, 0, "", 0));
return aRes;
};
Workbook.prototype.recalcWB = function(is3D){
Workbook.prototype.recalcWB = function(isRecalcWB){
//todo
var dep1, thas = this, sr, sr1, sr2;
if( this.dependencyFormulas.getNodesLength() > 0){
var aNodes = this.dependencyFormulas.getAll();
var nR = this.needRecalc;
for(var i in aNodes)
{
var node = aNodes[i];
if(!node.isArea)
{
nR[node.nodeId] = [node.sheetId, node.cellId];
nR.length++;
}
}
sortDependency(this);
}
}
if ( this.dependencyFormulas.getNodesLength() > 0 ) {
var aNodes = isRecalcWB ? this.dependencyFormulas.getAll() : this.dependencyFormulas.getNodeBySheetIdAll(this.getWorksheet(this.getActive()).getId());
var nR = this.needRecalc;
for ( var i in aNodes ) {
var node = aNodes[i];
if ( !node.isArea ) {
nR.nodes[node.nodeId] = [node.sheetId, node.cellId];
nR.length++;
}
}
sortDependency( this );
}
}
Workbook.prototype.isDefinedNamesExists = function(name, sheetId){
if(null != sheetId)
{
......@@ -2791,7 +2806,7 @@ Woorksheet.prototype._removeCell=function(nRow, nCol, cell){
oUndoRedoData_CellData.style = cell.xfs.clone();
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RemoveCell, this.getId(), new Asc.Range(0, nRow, gc_nMaxCol0, nRow), new UndoRedoData_CellSimpleData(nRow, nCol, oUndoRedoData_CellData, null));
}
if(cell.formulaParsed)
if(cell.formulaParsed)
this.wb.dependencyFormulas.deleteMasterNodes2( this.getId(), cell.getName() );
// addToArrRecalc(this.workbook, this.getId(), cell.getName());
......@@ -3124,11 +3139,11 @@ Woorksheet.prototype._moveRange=function(oBBoxFrom, oBBoxTo, copyRange){
if(oBBoxTo.c2 > this.nColsCount)
this.nColsCount = oBBoxTo.c2 + 1;
if(!copyRange){
if(!copyRange){
var sBBoxFromName = oBBoxFrom.getName();
this.workbook.needRecalc.nodes[getVertexId(this.getId(), sBBoxFromName)] = [this.getId(), sBBoxFromName];
this.workbook.needRecalc.length++;
}
}
var sBBoxToName = oBBoxTo.getName();
this.workbook.needRecalc.nodes[getVertexId(this.getId(), sBBoxToName)] = [this.getId(), sBBoxToName];
this.workbook.needRecalc.length++;
......
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