Commit 4c2b7427 authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix bug 32346

parent bc3fd305
...@@ -1074,11 +1074,11 @@ DependencyGraph.prototype = { ...@@ -1074,11 +1074,11 @@ DependencyGraph.prototype = {
}, },
changeDefName:function ( oldDefName, newDefName ) { changeDefName:function ( oldDefName, newDefName ) {
var ws = this.wb.getWorksheet( oldDefName.LocalSheetId ), sheetId = null; var ws = this.wb.getWorksheet( oldDefName.LocalSheetId );
ws ? sheetId = ws.getId() : null; var sheetId = ws ? ws.getId() : null;
var oldN = this.getDefNameNodeByName( oldDefName.Name, sheetId ), var oldN = this.getDefNameNodeByName( oldDefName.Name, sheetId ),
res = null, sheetNodeList, nodeId, sheetNodeList, nodeId,
name = oldDefName.Name; name = oldDefName.Name;
sheetNodeList = this.defNameSheets[sheetId || "WB"]; sheetNodeList = this.defNameSheets[sheetId || "WB"];
...@@ -1097,17 +1097,22 @@ DependencyGraph.prototype = { ...@@ -1097,17 +1097,22 @@ DependencyGraph.prototype = {
this.defNameList[oldN.nodeId] = oldN; this.defNameList[oldN.nodeId] = oldN;
sheetNodeList[oldN.nodeId] = oldN; sheetNodeList[oldN.nodeId] = oldN;
if(oldDefName.isTable){ if (oldDefName.isTable) {
var tableParts = this.wb.getActiveWs().TableParts; var dataRange = parserHelp.parse3DRef(oldDefName.Ref);
for(var i = 0; i < tableParts.length; i++){ if (dataRange) {
if( tableParts[i].DisplayName == name ){ var sheetDefName = this.wb.getWorksheetByName(dataRange.sheet);
tableParts[i].DisplayName = oldN.Name; if (sheetDefName) {
var tableParts = sheetDefName.TableParts;
for (var i = 0; i < tableParts.length; i++) {
if (tableParts[i].DisplayName == name) {
tableParts[i].DisplayName = oldN.Name;
} }
}
} }
} }
else{ } else {
oldN.deleteAllMasterEdges(); oldN.deleteAllMasterEdges();
addToArrDefNameRecalc(oldN); addToArrDefNameRecalc(oldN);
} }
return oldN; return oldN;
......
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