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

добавлен пересчет Vertex с флагом isDefinedName

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@61684 954022d7-b5bf-4e40-9824-e11837661b57
parent 37f57926
......@@ -562,7 +562,7 @@ DependencyGraph.prototype = {
nodesSheetCell.removeAll();
this.changeNodeEnd();
},
getNodeDependence:function ( aElems ) {
getNodeDependence:function ( aElems, aDefinedNames ) {
var oRes = { oMasterNodes: {}, oMasterAreaNodes: {}, oMasterAreaNodesRestricted: {}, oWeightMap: {}, oNodeToArea: {}, nCounter: 0 };
var aWeightMapMasters = [];
var aWeightMapMastersNodes = [];
......@@ -570,7 +570,8 @@ DependencyGraph.prototype = {
var elem;
var oSheetRanges = {};
var oSheetWithArea = {};//все sheet на которых есть area для пересчета
while ( null != aElems ) {
while ( null != aElems || null != aDefinedNames ) {
if(null != aElems){
for ( var i in aElems ) {
elem = aElems[i];
var sheetId = elem[0];
......@@ -589,7 +590,22 @@ DependencyGraph.prototype = {
this._getNodeDependence( oRes, oSheetRanges, node );
}
}
}
if(null != aDefinedNames){
for(var i = 0; i < aDefinedNames.length; ++i){
var node = aDefinedNames[i];
if ( node && null == oRes.oWeightMap[node.nodeId] ) {
//все node из aDefinedNames записываем в master
var oWeightMapElem = { id: oRes.nCounter++, cur: 0, max: 0, gray: false, bad: false, master: true, area: false };
aWeightMapMasters.push( oWeightMapElem );
aWeightMapMastersNodes.push( node );
oRes.oWeightMap[node.nodeId] = oWeightMapElem;
this._getNodeDependence( oRes, oSheetRanges, node );
}
}
}
aElems = null;
aDefinedNames = null;
//расширяем за счет area nodes
for ( var i in oSheetRanges ) {
var oSheetRange = oSheetRanges[i];
......@@ -720,6 +736,9 @@ DependencyGraph.prototype = {
var bStop = false;
var oWeightMapElem = oRes.oWeightMap[node.nodeId];
if ( null == oWeightMapElem ) {
if(node.isDefinedName)
oWeightMapElem = { id: oRes.nCounter++, cur: 0, max: 1, gray: false, bad: false, master: false, area: false };
else
oWeightMapElem = { id: oRes.nCounter++, cur: 0, max: 1, gray: false, bad: false, master: false, area: node.isArea };
oRes.oWeightMap[node.nodeId] = oWeightMapElem;
}
......@@ -740,7 +759,7 @@ DependencyGraph.prototype = {
oWeightMapElem.max--;
}
}
if (!bStop && 1 == oWeightMapElem.max )
if (!bStop && 1 == oWeightMapElem.max && !node.isDefinedName )
this._getNodeDependenceNodeToRange( node.sheetId, node.getBBox(), oSheetRanges );
if (!bStop && oWeightMapElem.max <= 1) {
oWeightMapElem.gray = true;
......@@ -813,6 +832,8 @@ function Vertex(sheetId, cellId, wb){
this.slaveEdges = null;
this.refCount = 0;
this.isDefinedName = false;
}
Vertex.prototype = {
......@@ -1134,6 +1155,10 @@ function _sortDependency(wb, node, oNodeDependence, oNewMasterAreaNodes, bBad, o
}
}
var bCurBad = oWeightMapElem.bad || bBad;
if(node.isDefinedName){
//todo
}
else{
//пересчитываем функцию
var ws = wb.getWorksheetById( node.sheetId );
ws._RecalculatedFunctions(node.cellId, bCurBad, setCellFormat);
......@@ -1145,6 +1170,7 @@ function _sortDependency(wb, node, oNodeDependence, oNewMasterAreaNodes, bBad, o
}
if(!node.isArea)
sheetArea[node.cellId] = node.getBBox();
}
//обрабатываем child
oWeightMapElem.gray = true;
var oSlaveNodes = node.getSlaveEdges();
......
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