Commit 25d630e5 authored by Dmitry.Shahtanov's avatar Dmitry.Shahtanov Committed by Alexander.Trofimov

fix:

Bug 30181 - Переименование листа, содержащего форматированную таблицу, не осуществляется и вызывает ошибку в консоли (http://bugzserver/show_bug.cgi?id=30181)
Bug 30187 - [NamedRanges] Имя диапазона или таблицы остается в списке имен после удаления листа, содержащего диапазон (http://bugzserver/show_bug.cgi?id=30187)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64428 954022d7-b5bf-4e40-9824-e11837661b57
parent 4d2bd902
...@@ -951,15 +951,15 @@ DependencyGraph.prototype = { ...@@ -951,15 +951,15 @@ DependencyGraph.prototype = {
/*var ws = this.wb.getWorksheet( sheetId ); /*var ws = this.wb.getWorksheet( sheetId );
ws ? sheetId = ws.getId() : null;*/ ws ? sheetId = ws.getId() : null;*/
var nodesList = this.defNameList, retRes = {}, defN, seUndoRedo = [], nSE, wsIndex; var nodesList = this.defNameList, retRes = {}, defN, seUndoRedo = [], nSE, wsIndex, ws = this.wb.getWorksheetById(sheetId ), wsName = ws.getName();
for ( var id in nodesList ) { for ( var id in nodesList ) {
/*if ( nodesList[id].isTable ) { if ( nodesList[id].isTable ) {
if ( nodesList[id].sheetTableId == sheetId ) { if(nodesList[id].Ref.indexOf(wsName) > -1){
nodesList[id].Ref = null; nodesList[id].Ref = null;
} }
continue; continue;
}*/ }
if ( !nodesList[id].isTable && nodesList[id].parsedRef && nodesList[id].parsedRef.removeSheet( sheetId ) ) { if ( !nodesList[id].isTable && nodesList[id].parsedRef && nodesList[id].parsedRef.removeSheet( sheetId ) ) {
seUndoRedo = []; seUndoRedo = [];
defN = nodesList[id]; defN = nodesList[id];
...@@ -1053,11 +1053,16 @@ DependencyGraph.prototype = { ...@@ -1053,11 +1053,16 @@ DependencyGraph.prototype = {
this.defNameSheets[newSheetId] = obj; this.defNameSheets[newSheetId] = obj;
}, },
relinkDefNameByWorksheet:function (){ relinkDefNameByWorksheet:function (oName, nName){
var oldS = this.defNameList; var oldS = this.defNameList;
for( var id in oldS ){ for( var id in oldS ){
oldS[id].relinkRef(); if(oldS[id].isTable){
oldS[id].Ref = oldS[id].Ref.replace(oName,nName);
}
else{
oldS[id].relinkRef();
}
} }
}, },
...@@ -2427,10 +2432,12 @@ Workbook.prototype.getDefinesNamesWB = function (defNameListId) { ...@@ -2427,10 +2432,12 @@ Workbook.prototype.getDefinesNamesWB = function (defNameListId) {
function getNames(id,arr){ function getNames(id,arr){
var listDN = thas.dependencyFormulas.defNameSheets[id], name; var listDN = thas.dependencyFormulas.defNameSheets[id], name;
for ( var id in listDN ) { for ( var id in listDN ) {
name = listDN[id].getAscCDefName(); name = listDN[id]
if ( name.Ref && !name.Hidden ) {
arr.push( name ); if ( name.Ref && !name.Hidden ) {
if( name.parsedRef && name.parsedRef.isParsed && name.parsedRef.calculate().errorType !== cErrorType.bad_reference ){
arr.push( name.getAscCDefName() );
}
} }
} }
} }
...@@ -3184,7 +3191,7 @@ Woorksheet.prototype.setName=function(name, bFromUndoRedo){ ...@@ -3184,7 +3191,7 @@ Woorksheet.prototype.setName=function(name, bFromUndoRedo){
this.workbook.getWorksheetById(id)._ReBuildFormulas(this.workbook.cwf[id].cells,lastName,this.sName); this.workbook.getWorksheetById(id)._ReBuildFormulas(this.workbook.cwf[id].cells,lastName,this.sName);
} }
this.workbook.dependencyFormulas.relinkDefNameByWorksheet(this.Id); this.workbook.dependencyFormulas.relinkDefNameByWorksheet(lastName, name);
if(!bFromUndoRedo) if(!bFromUndoRedo)
{ {
......
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