Commit 009b7a61 authored by konovalovsergey's avatar konovalovsergey

start defnames and tablenames

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