Commit 9a1b5c3f 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@63254 954022d7-b5bf-4e40-9824-e11837661b57
parent c7896441
...@@ -874,7 +874,7 @@ DependencyGraph.prototype = { ...@@ -874,7 +874,7 @@ DependencyGraph.prototype = {
var nodeId = getDefNameVertexId( sheetId, defName ), var nodeId = getDefNameVertexId( sheetId, defName ),
oRes = this.defNameList[nodeId], dfv, defNameSheetsList; oRes = this.defNameList[nodeId], dfv, defNameSheetsList;
if ( null == oRes || null == oRes.Ref ) { if ( null == oRes || ( null == oRes.Ref && null == defRef ) ) {
dfv = new DefNameVertex( sheetId, defName, defRef, this.wb ); dfv = new DefNameVertex( sheetId, defName, defRef, this.wb );
oRes = (this.defNameList[dfv.nodeId] = dfv); oRes = (this.defNameList[dfv.nodeId] = dfv);
defNameSheetsList = this.defNameSheets[dfv.sheetId]; defNameSheetsList = this.defNameSheets[dfv.sheetId];
...@@ -884,6 +884,14 @@ DependencyGraph.prototype = { ...@@ -884,6 +884,14 @@ DependencyGraph.prototype = {
} }
defNameSheetsList[dfv.nodeId] = dfv; defNameSheetsList[dfv.nodeId] = dfv;
} }
else if( null == oRes.Ref && null != defRef ){
oRes.Ref = defRef;
oRes.parsedRef = new parserFormula(oRes.Ref, "", oRes.wb.getWorksheet(0));
oRes.parsedRef.parse();
// oRes.sheetId = sheetId;
}
if ( bUndo ) { if ( bUndo ) {
oRes.Ref = defRef; oRes.Ref = defRef;
...@@ -2394,7 +2402,7 @@ Workbook.prototype.delDefinesNames = function ( defName ) { ...@@ -2394,7 +2402,7 @@ Workbook.prototype.delDefinesNames = function ( defName ) {
for ( var id in nSE ) { for ( var id in nSE ) {
seUndoRedo.push( id ); seUndoRedo.push( id );
se = nSE[id]; se = nSE[id];
se.deleteMasterEdge( retRes ); // se.deleteMasterEdge( retRes );
this.needRecalc.nodes[se.nodeId] = [se.sheetId, se.cellId ]; this.needRecalc.nodes[se.nodeId] = [se.sheetId, se.cellId ];
this.needRecalc.length++; this.needRecalc.length++;
...@@ -2473,7 +2481,7 @@ Workbook.prototype.editDefinesNames = function ( oldName, newName, bUndo ) { ...@@ -2473,7 +2481,7 @@ Workbook.prototype.editDefinesNames = function ( oldName, newName, bUndo ) {
se.setFormula( se.formulaParsed.assemble() ); se.setFormula( se.formulaParsed.assemble() );
if ( !rename ) { if ( !rename ) {
se.formulaParsed.setFormula(se.sFormula) se.formulaParsed.setFormula(se.sFormula);
se.formulaParsed.parse(); se.formulaParsed.parse();
} }
...@@ -2483,7 +2491,7 @@ Workbook.prototype.editDefinesNames = function ( oldName, newName, bUndo ) { ...@@ -2483,7 +2491,7 @@ Workbook.prototype.editDefinesNames = function ( oldName, newName, bUndo ) {
} }
if(retRes){ if(retRes){
retRes.deleteAllSlaveEdges(); // retRes.deleteAllSlaveEdges();
retRes = retRes.getAscCDefName(); retRes = retRes.getAscCDefName();
} }
......
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