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 = {
var g_oUndoRedoData_DefinedNamesProperties = {
Name: 0,
Ref:1,
Scope:2,
LocalSheetId:2,
slaveEdge:3
};
function UndoRedoData_DefinedNames(name, ref, scope, slaveEdge){
this.Properties = g_oUndoRedoData_DefinedNamesProperties;
this.Name = name;
this.Ref = ref;
this.Scope = scope;
this.LocalSheetId = scope;
this.slaveEdge = slaveEdge;
}
UndoRedoData_DefinedNames.prototype = {
......@@ -1606,7 +1606,7 @@ UndoRedoData_DefinedNames.prototype = {
{
case this.Properties.Name: return this.Name;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;
}
return null;
......@@ -1617,7 +1617,7 @@ UndoRedoData_DefinedNames.prototype = {
{
case this.Properties.Name: this.Name = 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;
}
}
......
......@@ -814,7 +814,7 @@ DependencyGraph.prototype = {
/*Defined Names section*/
getDefNameNode:function ( node ) {
var ret = this.defNameList[node];
ret.Ref == null ? ret = null : false;
ret && ret.Ref == null ? ret = null : false;
return ret;
},
getDefNameNodeByName:function ( name, sheetId ) {
......@@ -913,7 +913,7 @@ DependencyGraph.prototype = {
/*var ws = this.wb.getWorksheet( sheetId );
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 ){
......@@ -925,8 +925,10 @@ DependencyGraph.prototype = {
seUndoRedo.push(nseID);
}
wsIndex = this.wb.getWorksheetById(defN.sheetId);
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 ){
......@@ -2398,17 +2400,16 @@ Workbook.prototype.delDefinesNames = function ( defName ) {
this.needRecalc.length++;
se = se.returnCell();
se ? function () {
if( se ){
se.setFormula( se.formulaParsed.assemble() );
se.formulaParsed.isParsed = false;
se.formulaParsed.parse();
se.formulaParsed.buildDependencies();
}() : null;
}
}
sortDependency( this );
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