Commit 009b7a61 authored by konovalovsergey's avatar konovalovsergey

start defnames and tablenames

parent ae551ee7
...@@ -321,7 +321,8 @@ ...@@ -321,7 +321,8 @@
}; };
CFormulaCF.prototype.getValue = function(ws) { CFormulaCF.prototype.getValue = function(ws) {
this.init(ws); this.init(ws);
return this._f.calculate().getValue(); //todo bbox
return this._f.calculate(null, null).getValue();
}; };
function CIconSet () { function CIconSet () {
......
This diff is collapsed.
This diff is collapsed.
...@@ -4733,7 +4733,7 @@ TablePart.prototype.moveRef = function(col, row) { ...@@ -4733,7 +4733,7 @@ TablePart.prototype.moveRef = function(col, row) {
this.Ref = ref; this.Ref = ref;
//event //event
this.handlers.trigger("changeRefTablePart", this.DisplayName, this.Ref); this.handlers.trigger("changeRefTablePart", this.DisplayName, this.getRangeWithoutHeaderFooter());
if(this.AutoFilter) if(this.AutoFilter)
this.AutoFilter.moveRef(col, row); this.AutoFilter.moveRef(col, row);
...@@ -4748,9 +4748,7 @@ TablePart.prototype.changeRef = function(col, row, bIsFirst) { ...@@ -4748,9 +4748,7 @@ TablePart.prototype.changeRef = function(col, row, bIsFirst) {
this.Ref = ref; this.Ref = ref;
//event //event
var endRow = this.TotalsRowCount ? this.Ref.r2 - 1 : this.Ref.r2; this.handlers.trigger("changeRefTablePart", this.DisplayName, this.getRangeWithoutHeaderFooter());
var refNamedRanges = Asc.Range(this.Ref.c1, this.Ref.r1, this.Ref.c2, endRow);
this.handlers.trigger("changeRefTablePart", this.DisplayName, refNamedRanges);
if(this.AutoFilter) if(this.AutoFilter)
this.AutoFilter.changeRef(col, row, bIsFirst); this.AutoFilter.changeRef(col, row, bIsFirst);
...@@ -4793,9 +4791,8 @@ TablePart.prototype.changeRefOnRange = function(range, autoFilters, generateNewT ...@@ -4793,9 +4791,8 @@ TablePart.prototype.changeRefOnRange = function(range, autoFilters, generateNewT
} }
} }
this.Ref = Asc.Range(range.c1, range.r1, range.c2, range.r2);
//event //event
this.handlers.trigger("changeRefTablePart", this.DisplayName, this.Ref); this.handlers.trigger("changeRefTablePart", this.DisplayName, this.getRangeWithoutHeaderFooter());
if(this.AutoFilter) if(this.AutoFilter)
this.AutoFilter.changeRefOnRange(range); this.AutoFilter.changeRefOnRange(range);
...@@ -4927,9 +4924,15 @@ TablePart.prototype.getTableRangeForFormula = function(objectParam) ...@@ -4927,9 +4924,15 @@ TablePart.prototype.getTableRangeForFormula = function(objectParam)
} }
case FormulaTablePartInfo.thisRow: case FormulaTablePartInfo.thisRow:
{ {
// if( this.Ref.containsRange( objectParam.cell ) ){ if (objectParam.cell) {
res = new Asc.Range( this.Ref.c1, objectParam.cell.r1, this.Ref.c2, objectParam.cell.r1 ); res = new Asc.Range(this.Ref.c1, objectParam.cell.r1, this.Ref.c2, objectParam.cell.r1);
// } } else {
//like FormulaTablePartInfo.data
var startRow = this.HeaderRowCount === null ? this.Ref.r1 + 1 : this.Ref.r1;
var endRow = this.TotalsRowCount ? this.Ref.r2 - 1 : this.Ref.r2;
res = new Asc.Range(this.Ref.c1, startRow, this.Ref.c2, endRow);
}
break; break;
} }
case FormulaTablePartInfo.columns: case FormulaTablePartInfo.columns:
...@@ -5234,6 +5237,7 @@ AutoFilter.prototype.isShowButton = function() ...@@ -5234,6 +5237,7 @@ AutoFilter.prototype.isShowButton = function()
AutoFilter.prototype.getRangeWithoutHeaderFooter = function() AutoFilter.prototype.getRangeWithoutHeaderFooter = function()
{ {
//todo
return Asc.Range(this.Ref.c1, this.Ref.r1 + 1, this.Ref.c2, this.Ref.r2); return Asc.Range(this.Ref.c1, this.Ref.r1 + 1, this.Ref.c2, this.Ref.r2);
}; };
......
...@@ -949,6 +949,7 @@ ...@@ -949,6 +949,7 @@
this._setStyleTables(cloneData.newFilterRef); this._setStyleTables(cloneData.newFilterRef);
//event //event
//todo
worksheet.handlers.trigger("changeRefTablePart", cloneData.oldFilter.DisplayName, cloneData.oldFilter.Ref); worksheet.handlers.trigger("changeRefTablePart", cloneData.oldFilter.DisplayName, cloneData.oldFilter.Ref);
break; break;
...@@ -1064,7 +1065,7 @@ ...@@ -1064,7 +1065,7 @@
if(cloneData.Ref.isEqual(worksheet.TableParts[l].Ref)) if(cloneData.Ref.isEqual(worksheet.TableParts[l].Ref))
{ {
this._cleanStyleTable(cloneData.Ref); this._cleanStyleTable(cloneData.Ref);
worksheet.workbook.dependencyFormulas.delTableName(worksheet.TableParts[l].DisplayName, worksheet.getName()); worksheet.workbook.dependencyFormulas.delTableName(worksheet.TableParts[l].DisplayName);
worksheet.TableParts.splice(l,1); worksheet.TableParts.splice(l,1);
} }
} }
...@@ -1150,7 +1151,7 @@ ...@@ -1150,7 +1151,7 @@
t._addHistoryObj(oldFilter, AscCH.historyitem_AutoFilter_Empty, {activeCells: activeCells}, null, oldFilter.Ref); t._addHistoryObj(oldFilter, AscCH.historyitem_AutoFilter_Empty, {activeCells: activeCells}, null, oldFilter.Ref);
if(isTablePart) if(isTablePart)
worksheet.workbook.dependencyFormulas.delTableName(oldFilter.DisplayName, worksheet.getName()) worksheet.workbook.dependencyFormulas.delTableName(oldFilter.DisplayName)
} else } else
return oldFilter; return oldFilter;
}; };
...@@ -2543,7 +2544,7 @@ ...@@ -2543,7 +2544,7 @@
History.StartTransaction(); History.StartTransaction();
//TODO добавлять в историю смену именного диапазона //TODO добавлять в историю смену именного диапазона
worksheet.workbook.dependencyFormulas.changeTableRef(tableName, worksheet, newName); worksheet.workbook.dependencyFormulas.changeTableName(tableName, newName);
tablePart.changeDisplayName(newName); tablePart.changeDisplayName(newName);
......
...@@ -836,7 +836,8 @@ ...@@ -836,7 +836,8 @@
// var __e__ = new Date().getTime(); // var __e__ = new Date().getTime();
// console.log("e-s "+ (__e__ - __s__)); // console.log("e-s "+ (__e__ - __s__));
this._formula = new AscCommonExcel.parserFormula( s.substr( 1 ), this.options.cellName, ws ); var bbox = AscCommonExcel.g_oRangeCache.getActiveRange(this.options.cellName);
this._formula = new AscCommonExcel.parserFormula( s.substr( 1 ), null, ws );
this._formula.parse(); this._formula.parse();
var r, offset, _e, _s, wsName = null, refStr, isName = false, var r, offset, _e, _s, wsName = null, refStr, isName = false,
...@@ -896,7 +897,7 @@ ...@@ -896,7 +897,7 @@
case cElementType.table : case cElementType.table :
case cElementType.name : case cElementType.name :
{ {
var nameRef = r.oper.toRef(); var nameRef = r.oper.toRef(bbox);
if( nameRef instanceof AscCommonExcel.cError ) continue; if( nameRef instanceof AscCommonExcel.cError ) continue;
switch ( nameRef.type ) { switch ( nameRef.type ) {
...@@ -961,7 +962,8 @@ ...@@ -961,7 +962,8 @@
wsOPEN = this.handlers.trigger( "getCellFormulaEnterWSOpen" ), wsOPEN = this.handlers.trigger( "getCellFormulaEnterWSOpen" ),
ws = wsOPEN ? wsOPEN.model : this.handlers.trigger( "getActiveWS" ); ws = wsOPEN ? wsOPEN.model : this.handlers.trigger( "getActiveWS" );
this._formula = new AscCommonExcel.parserFormula( s.substr( 1 ), this.options.cellName, ws ); var bbox = AscCommonExcel.g_oRangeCache.getActiveRange(this.options.cellName);
this._formula = new AscCommonExcel.parserFormula( s.substr( 1 ), null, ws );
this._formula.parse(); this._formula.parse();
if ( this._formula.RefPos && this._formula.RefPos.length > 0 ) { if ( this._formula.RefPos && this._formula.RefPos.length > 0 ) {
...@@ -1015,7 +1017,7 @@ ...@@ -1015,7 +1017,7 @@
case cElementType.table : case cElementType.table :
case cElementType.name : case cElementType.name :
{ {
var nameRef = r.oper.toRef(); var nameRef = r.oper.toRef(bbox);
if ( nameRef instanceof AscCommonExcel.cError ) continue; if ( nameRef instanceof AscCommonExcel.cError ) continue;
switch ( nameRef.type ) { switch ( nameRef.type ) {
......
...@@ -2298,7 +2298,7 @@ ...@@ -2298,7 +2298,7 @@
var delDefinedNamesCallback = function(res) { var delDefinedNamesCallback = function(res) {
if (res) { if (res) {
t.handlers.trigger("asc_onDelDefName", t.model.delDefinesNames(oldName)); t.model.delDefinesNames(oldName);
t.handlers.trigger("asc_onRefreshDefNameList"); t.handlers.trigger("asc_onRefreshDefNameList");
} else { } else {
t.handlers.trigger("asc_onError", c_oAscError.ID.LockCreateDefName, c_oAscError.Level.NoCritical); t.handlers.trigger("asc_onError", c_oAscError.ID.LockCreateDefName, c_oAscError.Level.NoCritical);
......
...@@ -815,7 +815,9 @@ var c_oAscPrintDefaultSettings = { ...@@ -815,7 +815,9 @@ var c_oAscPrintDefaultSettings = {
Dirty: 0, Dirty: 0,
Shift: 1, Shift: 1,
Move: 2, Move: 2,
Delete: 3 Delete: 3,
ChangeDefName: 4,
ChangeDefNameTable: 5
}; };
var c_oDashType = { var c_oDashType = {
......
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