Commit e6755497 authored by GoshaZotov's avatar GoshaZotov

delete function delTableName2

parent c7ade749
...@@ -3875,7 +3875,7 @@ function parserFormula( formula, parent, _ws ) { ...@@ -3875,7 +3875,7 @@ function parserFormula( formula, parent, _ws ) {
parserFormula.prototype.setIsTable = function(isTable){ parserFormula.prototype.setIsTable = function(isTable){
this.isTable = isTable; this.isTable = isTable;
}; };
parserFormula.prototype.notify = function(data, bConvertTableFormulaToRef) { parserFormula.prototype.notify = function(data) {
var eventData = {notifyData: data, assemble: null, isRebuild: false, formula: this}; var eventData = {notifyData: data, assemble: null, isRebuild: false, formula: this};
if (this.parent && this.parent.onFormulaEvent) { if (this.parent && this.parent.onFormulaEvent) {
var checkCanDo = this.parent.onFormulaEvent(AscCommon.c_oNotifyParentType.CanDo, eventData); var checkCanDo = this.parent.onFormulaEvent(AscCommon.c_oNotifyParentType.CanDo, eventData);
...@@ -3903,7 +3903,7 @@ function parserFormula( formula, parent, _ws ) { ...@@ -3903,7 +3903,7 @@ function parserFormula( formula, parent, _ws ) {
eventData.isRebuild = false; eventData.isRebuild = false;
} else if (AscCommon.c_oNotifyType.ChangeDefName === data.type) { } else if (AscCommon.c_oNotifyType.ChangeDefName === data.type) {
if (!data.to) { if (!data.to) {
this.removeTableName(data.from, bConvertTableFormulaToRef); this.removeTableName(data.from, data.bConvertTableFormulaToRef);
eventData.isRebuild = true; eventData.isRebuild = true;
} else if (data.from.name != data.to.name) { } else if (data.from.name != data.to.name) {
this.changeDefName(data.from, data.to); this.changeDefName(data.from, data.to);
......
...@@ -753,23 +753,13 @@ ...@@ -753,23 +753,13 @@
History.TurnOn(); History.TurnOn();
} }
}, },
delTableName: function(tableName) { delTableName: function(tableName, bConvertTableFormulaToRef) {
this.buildDependency();
var defName = this._delDefName(tableName, null);
if (defName) {
defName.removeDependencies();
}
this.addToChangedDefName(defName);
var notifyData = {type: AscCommon.c_oNotifyType.ChangeDefName, from: defName.getUndoDefName(), to: null};
this._broadcastDefName(tableName, notifyData);
},
delTableName2: function(tableName) {
this.buildDependency(); this.buildDependency();
var defName = this.getDefNameByName(tableName); var defName = this.getDefNameByName(tableName);
this.addToChangedDefName(defName); this.addToChangedDefName(defName);
var notifyData = {type: AscCommon.c_oNotifyType.ChangeDefName, from: defName.getUndoDefName(), to: null}; var notifyData = {type: AscCommon.c_oNotifyType.ChangeDefName, from: defName.getUndoDefName(), to: null, bConvertTableFormulaToRef: bConvertTableFormulaToRef};
this._broadcastDefName(tableName, notifyData, true); this._broadcastDefName(tableName, notifyData);
this._delDefName(tableName, null); this._delDefName(tableName, null);
if (defName) { if (defName) {
...@@ -1039,12 +1029,12 @@ ...@@ -1039,12 +1029,12 @@
this.volatileListeners[i].notify(notifyData); this.volatileListeners[i].notify(notifyData);
} }
}, },
_broadcastDefName: function(name, notifyData, bConvertTableFormulaToRef) { _broadcastDefName: function(name, notifyData) {
var nameIndex = getDefNameIndex(name); var nameIndex = getDefNameIndex(name);
var container = this.defNameListeners[nameIndex]; var container = this.defNameListeners[nameIndex];
if (container) { if (container) {
for (var listenerId in container.listeners) { for (var listenerId in container.listeners) {
container.listeners[listenerId].notify(notifyData, bConvertTableFormulaToRef); container.listeners[listenerId].notify(notifyData);
} }
} }
}, },
...@@ -4570,7 +4560,7 @@ Woorksheet.prototype.isApplyFilterBySheet = function(){ ...@@ -4570,7 +4560,7 @@ Woorksheet.prototype.isApplyFilterBySheet = function(){
{ {
//TODO скорее всего стоит убрать else //TODO скорее всего стоит убрать else
var tablePart = this.TableParts[index]; var tablePart = this.TableParts[index];
this.workbook.dependencyFormulas.delTableName2(tablePart.DisplayName); this.workbook.dependencyFormulas.delTableName(tablePart.DisplayName, bConvertTableFormulaToRef);
tablePart.removeDependencies(); tablePart.removeDependencies();
//delete table //delete table
......
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