Commit 6c91fe35 authored by Alexander.Trofimov's avatar Alexander.Trofimov

delete this.name from formulas classes -> move to prototype

parent 639ab89f
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
* @param {Window} window * @param {Window} window
* @param {undefined} undefined * @param {undefined} undefined
*/ */
function (window, undefined) { function (window, undefined) {
function _getRowTitle(row) { function _getRowTitle(row) {
return "" + (row + 1); return "" + (row + 1);
} }
...@@ -217,11 +217,13 @@ ...@@ -217,11 +217,13 @@
* @extends {AscCommonExcel.cBaseFunction} * @extends {AscCommonExcel.cBaseFunction}
*/ */
function cAREAS() { function cAREAS() {
cBaseFunction.call(this, "AREAS"); this.value = null;
this.argumentsCurrent = 0;
} }
cAREAS.prototype = Object.create(cBaseFunction.prototype); cAREAS.prototype = Object.create(cBaseFunction.prototype);
cAREAS.prototype.constructor = cAREAS; cAREAS.prototype.constructor = cAREAS;
cAREAS.prototype.name = 'AREAS';
/** /**
* @constructor * @constructor
...@@ -353,11 +355,13 @@ ...@@ -353,11 +355,13 @@
* @extends {AscCommonExcel.cBaseFunction} * @extends {AscCommonExcel.cBaseFunction}
*/ */
function cGETPIVOTDATA() { function cGETPIVOTDATA() {
cBaseFunction.call(this, "GETPIVOTDATA"); this.value = null;
this.argumentsCurrent = 0;
} }
cGETPIVOTDATA.prototype = Object.create(cBaseFunction.prototype); cGETPIVOTDATA.prototype = Object.create(cBaseFunction.prototype);
cGETPIVOTDATA.prototype.constructor = cGETPIVOTDATA; cGETPIVOTDATA.prototype.constructor = cGETPIVOTDATA;
cGETPIVOTDATA.prototype.name = 'GETPIVOTDATA';
/** /**
* @constructor * @constructor
...@@ -382,11 +386,13 @@ ...@@ -382,11 +386,13 @@
* @extends {AscCommonExcel.cBaseFunction} * @extends {AscCommonExcel.cBaseFunction}
*/ */
function cHYPERLINK() { function cHYPERLINK() {
cBaseFunction.call(this, "HYPERLINK"); this.value = null;
this.argumentsCurrent = 0;
} }
cHYPERLINK.prototype = Object.create(cBaseFunction.prototype); cHYPERLINK.prototype = Object.create(cBaseFunction.prototype);
cHYPERLINK.prototype.constructor = cHYPERLINK; cHYPERLINK.prototype.constructor = cHYPERLINK;
cHYPERLINK.prototype.name = 'HYPERLINK';
/** /**
* @constructor * @constructor
...@@ -449,8 +455,8 @@ ...@@ -449,8 +455,8 @@
if (arg1 > Math.abs(bbox.r1 - bbox.r2) + 1 || arg2 > Math.abs(bbox.c1 - bbox.c2) + 1) { if (arg1 > Math.abs(bbox.r1 - bbox.r2) + 1 || arg2 > Math.abs(bbox.c1 - bbox.c2) + 1) {
res = new cError(cErrorType.bad_reference); res = new cError(cErrorType.bad_reference);
} else { } else {
res = new Asc.Range(bbox.c1 + arg2 - 1, bbox.r1 + arg1 - 1, bbox.c1 + arg2 - 1, res = new Asc.Range(bbox.c1 + arg2 - 1, bbox.r1 + arg1 - 1, bbox.c1 + arg2 - 1, bbox.r1 + arg1 -
bbox.r1 + arg1 - 1) 1)
res = new cRef(res.getName(), ws); res = new cRef(res.getName(), ws);
} }
} }
...@@ -581,9 +587,9 @@ ...@@ -581,9 +587,9 @@
} }
if (!( (cElementType.cellsRange === arg1.type || cElementType.cellsRange3D === arg1.type || if (!( (cElementType.cellsRange === arg1.type || cElementType.cellsRange3D === arg1.type ||
cElementType.array === arg1.type) && cElementType.array === arg1.type) &&
(cElementType.cellsRange === arg2.type || cElementType.cellsRange3D === arg2.type || (cElementType.cellsRange === arg2.type || cElementType.cellsRange3D === arg2.type ||
cElementType.array === arg2.type) )) { cElementType.array === arg2.type) )) {
return this.value = new cError(cErrorType.not_available); return this.value = new cError(cErrorType.not_available);
} }
...@@ -712,7 +718,7 @@ ...@@ -712,7 +718,7 @@
var a0Type = a0.type; var a0Type = a0.type;
var a0Value = a0.getValue(); var a0Value = a0.getValue();
if (!(cElementType.number === a0Type || cElementType.string === a0Type || cElementType.bool === a0Type || if (!(cElementType.number === a0Type || cElementType.string === a0Type || cElementType.bool === a0Type ||
cElementType.error === a0Type || cElementType.empty === a0Type)) { cElementType.error === a0Type || cElementType.empty === a0Type)) {
a0Type = a0Value.type; a0Type = a0Value.type;
a0Value = a0Value.getValue(); a0Value = a0Value.getValue();
} }
...@@ -932,11 +938,13 @@ ...@@ -932,11 +938,13 @@
* @extends {AscCommonExcel.cBaseFunction} * @extends {AscCommonExcel.cBaseFunction}
*/ */
function cRTD() { function cRTD() {
cBaseFunction.call(this, "RTD"); this.value = null;
this.argumentsCurrent = 0;
} }
cRTD.prototype = Object.create(cBaseFunction.prototype); cRTD.prototype = Object.create(cBaseFunction.prototype);
cRTD.prototype.constructor = cRTD; cRTD.prototype.constructor = cRTD;
cRTD.prototype.name = 'RTD';
/** /**
* @constructor * @constructor
......
...@@ -2382,12 +2382,9 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara ...@@ -2382,12 +2382,9 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
}; };
/** @constructor */ /** @constructor */
function cBaseFunction(name) { function cBaseFunction() {
this.name = name;
this.value = null; this.value = null;
this.argumentsCurrent = 0; this.argumentsCurrent = 0;
// this.isXLFN = rx_sFuncPref.test(this.name);
} }
cBaseFunction.prototype.type = cElementType.func; cBaseFunction.prototype.type = cElementType.func;
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
* @param {Window} window * @param {Window} window
* @param {undefined} undefined * @param {undefined} undefined
*/ */
function (window, undefined) { function (window, undefined) {
// Import // Import
var cElementType = AscCommonExcel.cElementType; var cElementType = AscCommonExcel.cElementType;
var CellValueType = AscCommon.CellValueType; var CellValueType = AscCommon.CellValueType;
...@@ -70,22 +70,26 @@ ...@@ -70,22 +70,26 @@
* @extends {AscCommonExcel.cBaseFunction} * @extends {AscCommonExcel.cBaseFunction}
*/ */
function cASC() { function cASC() {
cBaseFunction.call(this, "ASC"); this.value = null;
this.argumentsCurrent = 0;
} }
cASC.prototype = Object.create(cBaseFunction.prototype); cASC.prototype = Object.create(cBaseFunction.prototype);
cASC.prototype.constructor = cASC; cASC.prototype.constructor = cASC;
cASC.prototype.name = 'ASC';
/** /**
* @constructor * @constructor
* @extends {AscCommonExcel.cBaseFunction} * @extends {AscCommonExcel.cBaseFunction}
*/ */
function cBAHTTEXT() { function cBAHTTEXT() {
cBaseFunction.call(this, "BAHTTEXT"); this.value = null;
this.argumentsCurrent = 0;
} }
cBAHTTEXT.prototype = Object.create(cBaseFunction.prototype); cBAHTTEXT.prototype = Object.create(cBaseFunction.prototype);
cBAHTTEXT.prototype.constructor = cBAHTTEXT; cBAHTTEXT.prototype.constructor = cBAHTTEXT;
cBAHTTEXT.prototype.name = 'BAHTTEXT';
/** /**
* @constructor * @constructor
...@@ -858,11 +862,13 @@ ...@@ -858,11 +862,13 @@
* @extends {AscCommonExcel.cBaseFunction} * @extends {AscCommonExcel.cBaseFunction}
*/ */
function cJIS() { function cJIS() {
cBaseFunction.call(this, "JIS"); this.value = null;
this.argumentsCurrent = 0;
} }
cJIS.prototype = Object.create(cBaseFunction.prototype); cJIS.prototype = Object.create(cBaseFunction.prototype);
cJIS.prototype.constructor = cJIS; cJIS.prototype.constructor = cJIS;
cJIS.prototype.name = 'JIS';
/** /**
* @constructor * @constructor
...@@ -1219,11 +1225,13 @@ ...@@ -1219,11 +1225,13 @@
* @extends {AscCommonExcel.cBaseFunction} * @extends {AscCommonExcel.cBaseFunction}
*/ */
function cPHONETIC() { function cPHONETIC() {
cBaseFunction.call(this, "PHONETIC"); this.value = null;
this.argumentsCurrent = 0;
} }
cPHONETIC.prototype = Object.create(cBaseFunction.prototype); cPHONETIC.prototype = Object.create(cBaseFunction.prototype);
cPHONETIC.prototype.constructor = cPHONETIC; cPHONETIC.prototype.constructor = cPHONETIC;
cPHONETIC.prototype.name = 'PHONETIC';
/** /**
* @constructor * @constructor
......
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