Commit 8fcf0aa9 authored by Dmitry.Shahtanov's avatar Dmitry.Shahtanov Committed by Alexander.Trofimov

UndoRedo для именованных диапазонов при удалении листа

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@63155 954022d7-b5bf-4e40-9824-e11837661b57
parent 964ae673
...@@ -1581,14 +1581,14 @@ UndoRedoData_SheetPositions.prototype = { ...@@ -1581,14 +1581,14 @@ UndoRedoData_SheetPositions.prototype = {
var g_oUndoRedoData_DefinedNamesProperties = { var g_oUndoRedoData_DefinedNamesProperties = {
Name: 0, Name: 0,
Ref:1, Ref:1,
Scope:2, LocalSheetId:2,
slaveEdge:3 slaveEdge:3
}; };
function UndoRedoData_DefinedNames(name, ref, scope, slaveEdge){ function UndoRedoData_DefinedNames(name, ref, scope, slaveEdge){
this.Properties = g_oUndoRedoData_DefinedNamesProperties; this.Properties = g_oUndoRedoData_DefinedNamesProperties;
this.Name = name; this.Name = name;
this.Ref = ref; this.Ref = ref;
this.Scope = scope; this.LocalSheetId = scope;
this.slaveEdge = slaveEdge; this.slaveEdge = slaveEdge;
} }
UndoRedoData_DefinedNames.prototype = { UndoRedoData_DefinedNames.prototype = {
...@@ -1606,7 +1606,7 @@ UndoRedoData_DefinedNames.prototype = { ...@@ -1606,7 +1606,7 @@ UndoRedoData_DefinedNames.prototype = {
{ {
case this.Properties.Name: return this.Name;break; case this.Properties.Name: return this.Name;break;
case this.Properties.Ref: return this.Ref;break; case this.Properties.Ref: return this.Ref;break;
case this.Properties.Scope: return this.Scope;break; case this.Properties.LocalSheetId: return this.LocalSheetId;break;
case this.Properties.slaveEdge: return this.slaveEdge;break; case this.Properties.slaveEdge: return this.slaveEdge;break;
} }
return null; return null;
...@@ -1617,7 +1617,7 @@ UndoRedoData_DefinedNames.prototype = { ...@@ -1617,7 +1617,7 @@ UndoRedoData_DefinedNames.prototype = {
{ {
case this.Properties.Name: this.Name = value;break; case this.Properties.Name: this.Name = value;break;
case this.Properties.Ref: this.Ref = value;break; case this.Properties.Ref: this.Ref = value;break;
case this.Properties.Scope: this.Scope = value;break; case this.Properties.LocalSheetId: this.LocalSheetId = value;break;
case this.Properties.slaveEdge: this.slaveEdge = value;break; case this.Properties.slaveEdge: this.slaveEdge = value;break;
} }
} }
......
...@@ -814,7 +814,7 @@ DependencyGraph.prototype = { ...@@ -814,7 +814,7 @@ DependencyGraph.prototype = {
/*Defined Names section*/ /*Defined Names section*/
getDefNameNode:function ( node ) { getDefNameNode:function ( node ) {
var ret = this.defNameList[node]; var ret = this.defNameList[node];
ret.Ref == null ? ret = null : false; ret && ret.Ref == null ? ret = null : false;
return ret; return ret;
}, },
getDefNameNodeByName:function ( name, sheetId ) { getDefNameNodeByName:function ( name, sheetId ) {
...@@ -913,7 +913,7 @@ DependencyGraph.prototype = { ...@@ -913,7 +913,7 @@ 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; var nodesList = this.defNameList, retRes = {}, defN, seUndoRedo = [], nSE, wsIndex;
for( var id in nodesList ){ for( var id in nodesList ){
...@@ -925,8 +925,10 @@ DependencyGraph.prototype = { ...@@ -925,8 +925,10 @@ DependencyGraph.prototype = {
seUndoRedo.push(nseID); seUndoRedo.push(nseID);
} }
wsIndex = this.wb.getWorksheetById(defN.sheetId);
History.Add( g_oUndoRedoWorkbook, historyitem_Workbook_DefinedNamesDelete, null, null, History.Add( g_oUndoRedoWorkbook, historyitem_Workbook_DefinedNamesDelete, null, null,
new UndoRedoData_DefinedNames( defN.Name, defN.Ref, defN.Scope, seUndoRedo ) ); new UndoRedoData_DefinedNames( defN.Name, defN.Ref, wsIndex ? wsIndex.getIndex() : undefined, seUndoRedo ) );
if( defN.sheetId == sheetId ){ if( defN.sheetId == sheetId ){
...@@ -2398,17 +2400,16 @@ Workbook.prototype.delDefinesNames = function ( defName ) { ...@@ -2398,17 +2400,16 @@ Workbook.prototype.delDefinesNames = function ( defName ) {
this.needRecalc.length++; this.needRecalc.length++;
se = se.returnCell(); se = se.returnCell();
se ? function () { if( se ){
se.setFormula( se.formulaParsed.assemble() ); se.setFormula( se.formulaParsed.assemble() );
se.formulaParsed.isParsed = false; se.formulaParsed.isParsed = false;
se.formulaParsed.parse(); se.formulaParsed.parse();
se.formulaParsed.buildDependencies(); se.formulaParsed.buildDependencies();
}() : null; }
} }
sortDependency( this ); sortDependency( this );
History.Add( g_oUndoRedoWorkbook, historyitem_Workbook_DefinedNamesDelete, null, null, new UndoRedoData_DefinedNames( defName.Name, defName.Ref, defName.Scope, seUndoRedo ) ); History.Add( g_oUndoRedoWorkbook, historyitem_Workbook_DefinedNamesDelete, null, null, new UndoRedoData_DefinedNames( defName.Name, defName.Ref, defName.Scope, seUndoRedo ) );
} }
......
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