Commit 524ee66a authored by GoshaZotov's avatar GoshaZotov

Merge branch 'develop' into Feature/special_paste

parents 06001b54 79213b13
......@@ -132,64 +132,6 @@ $(function () {
strictEqual(Asc.round(-.1-.2-.9+.2), -1, "Asc.round(.1+.2+.9-.2)"); // -1.0000...2
});
test("AscCommon.extendClass", function test_extendClass() {
function Base(b1) {
this.b1 = b1;
}
Base.prototype.mb1 = function (b1) {this.b1=b1;};
function Child(b1, c1) {
Child.superclass.constructor.call(this, b1);
this.c1 = c1;
}
AscCommon.extendClass(Child, Base);
Child.prototype.mc1 = function (c1) {this.c1=c1;};
var x = new Child(1, 2);
ok(x !== undefined, "x = new Child(1, 2)");
ok(x.mb1 !== undefined, "x.mb1");
ok(x.mc1 !== undefined, "x.mc1");
equal(x.b1, 1, "x.b1");
equal(x.c1, 2, "x.c1");
x.mb1(3);
equal(x.b1, 3, "x.b1");
equal(x.c1, 2, "x.c1");
x.mc1(4);
equal(x.b1, 3, "x.b1");
equal(x.c1, 4, "x.c1");
});
test("AscCommon.extendClass with fabric method", function test_extendClass2() {
function Base(b1) {
if ( !(this instanceof Base) ) {return new Base(b1);}
this.b1 = b1;
return this;
}
Base.prototype.mb1 = function (b1) {this.b1=b1;};
function Child(b1, c1) {
if ( !(this instanceof Child) ) {return new Child(b1, c1);}
Child.superclass.constructor.call(this, b1);
this.c1 = c1;
return this;
}
AscCommon.extendClass(Child, Base);
Child.prototype.mc1 = function (c1) {this.c1=c1;};
var x = Child(1, 2);
ok(x !== undefined, "x = Child(1, 2)");
ok(x.mb1 !== undefined, "x.mb1");
ok(x.mc1 !== undefined, "x.mc1");
equal(x.b1, 1, "x.b1");
equal(x.c1, 2, "x.c1");
x.mb1(3);
equal(x.b1, 3, "x.b1");
equal(x.c1, 2, "x.c1");
x.mc1(4);
equal(x.b1, 3, "x.b1");
equal(x.c1, 4, "x.c1");
});
function check_range(range, c1, r1, c2, r2, msg) {
strictEqual(range.c1, c1, msg + ", c1");
strictEqual(range.r1, r1, msg + ", r1");
......
......@@ -72,7 +72,7 @@ var editor;
* @extends {AscCommon.baseEditorsApi}
*/
function spreadsheet_api(config) {
spreadsheet_api.superclass.constructor.call(this, config, AscCommon.c_oEditorId.Spreadsheet);
AscCommon.baseEditorsApi.call(this, config, AscCommon.c_oEditorId.Spreadsheet);
/************ private!!! **************/
this.topLineEditorName = config['id-input'] || '';
......@@ -131,14 +131,14 @@ var editor;
this._init();
return this;
}
AscCommon.extendClass(spreadsheet_api, AscCommon.baseEditorsApi);
spreadsheet_api.prototype = Object.create(AscCommon.baseEditorsApi.prototype);
spreadsheet_api.prototype.constructor = spreadsheet_api;
spreadsheet_api.prototype.sendEvent = function() {
this.handlers.trigger.apply(this.handlers, arguments);
};
spreadsheet_api.prototype._init = function() {
spreadsheet_api.superclass._init.call(this);
AscCommon.baseEditorsApi.prototype._init.call(this);
this.topLineEditorElement = document.getElementById(this.topLineEditorName);
// ToDo нужно ли это
asc['editor'] = ( asc['editor'] || this );
......@@ -3285,7 +3285,7 @@ var editor;
this.asc_setMobileVersion(true);
}
spreadsheet_api.superclass._onEndLoadSdk.call(this);
AscCommon.baseEditorsApi.prototype._onEndLoadSdk.call(this);
this.controller = new AscCommonExcel.asc_CEventsController();
......
......@@ -71,29 +71,32 @@
* @constructor
*/
function ApiShape(oShape){
ApiShape.superclass.constructor.call(this, oShape);
ApiDrawing.call(this, oShape);
this.Shape = oShape;
}
AscCommon.extendClass(ApiShape, ApiDrawing);
ApiShape.prototype = Object.create(ApiDrawing.prototype);
ApiShape.prototype.constructor = ApiShape;
/**
* Class representing a image.
* @constructor
*/
function ApiImage(oImage){
ApiImage.superclass.constructor.call(this, oImage);
ApiDrawing.call(this, oImage);
}
AscCommon.extendClass(ApiImage, ApiDrawing);
ApiImage.prototype = Object.create(ApiDrawing.prototype);
ApiImage.prototype.constructor = ApiImage;
/**
* Class representing a chart.
* @constructor
*/
function ApiChart(oChart){
ApiChart.superclass.constructor.call(this, oChart);
ApiDrawing.call(this, oChart);
this.Chart = oChart;
}
AscCommon.extendClass(ApiChart, ApiDrawing);
ApiChart.prototype = Object.create(ApiDrawing.prototype);
ApiChart.prototype.constructor = ApiChart;
/**
* @typedef {("aliceBlue" | "antiqueWhite" | "aqua" | "aquamarine" | "azure" | "beige" | "bisque" | "black" |
......
......@@ -51,7 +51,10 @@ CChartSpace.prototype.setDrawingBase = CShape.prototype.setDrawingBase;
CChartSpace.prototype.deleteDrawingBase = CShape.prototype.deleteDrawingBase;
CChartSpace.prototype.getDrawingObjectsController = CShape.prototype.getDrawingObjectsController;
CChartSpace.prototype.Is_UseInDocument = CShape.prototype.Is_UseInDocument;
CChartSpace.prototype.getEditorType = function()
{
return 0;
};
CChartSpace.prototype.recalculateTransform = function()
{
CShape.prototype.recalculateTransform.call(this);
......
......@@ -45,6 +45,10 @@ CGroupShape.prototype.addToRecalculate = function()
this.drawingObjects.controller.objectsForRecalculate[this.Id] = this;
}
};
CGroupShape.prototype.getEditorType = function()
{
return 0;
};
CGroupShape.prototype.handleUpdateFill = function()
{
......
......@@ -56,7 +56,10 @@ CImageShape.prototype.getRotateAngle = CShape.prototype.getRotateAngle;
CImageShape.prototype.setWorksheet = CShape.prototype.setWorksheet;
CImageShape.prototype.getDrawingObjectsController = CShape.prototype.getDrawingObjectsController;
CImageShape.prototype.Is_UseInDocument = CShape.prototype.Is_UseInDocument;
CImageShape.prototype.getEditorType = function()
{
return 0;
};
CImageShape.prototype.setRecalculateInfo = function()
{
this.recalcInfo =
......
......@@ -44,6 +44,12 @@ var G_O_DEFAULT_COLOR_MAP = AscFormat.GenerateDefaultColorMap();
CShape.prototype.setDrawingObjects = function(drawingObjects)
{
};
CShape.prototype.getEditorType = function()
{
return 0;
};
CShape.prototype.setDrawingBase = function(drawingBase)
{
this.drawingBase = drawingBase;
......@@ -204,9 +210,10 @@ function addToDrawings(worksheet, graphic, position, lockByDefault, anchor)
function CChangesDrawingObjectsAddToDrawingObjects(Class, Pos){
this.Pos = Pos;
this.Type = AscDFH.historyitem_AutoShapes_AddToDrawingObjects;
CChangesDrawingObjectsAddToDrawingObjects.superclass.constructor.call(this, Class);
AscDFH.CChangesBase.call(this, Class);
}
AscCommon.extendClass(CChangesDrawingObjectsAddToDrawingObjects, AscDFH.CChangesBase);
CChangesDrawingObjectsAddToDrawingObjects.prototype = Object.create(AscDFH.CChangesBase.prototype);
CChangesDrawingObjectsAddToDrawingObjects.prototype.constructor = CChangesDrawingObjectsAddToDrawingObjects;
CChangesDrawingObjectsAddToDrawingObjects.prototype.Undo = function(){
AscFormat.deleteDrawingBase(this.Class.worksheet.Drawings, this.Class.Get_Id());
};
......@@ -228,9 +235,10 @@ AscCommon.extendClass(CChangesDrawingObjectsAddToDrawingObjects, AscDFH.CChanges
function CChangesDrawingObjectsRemoveFromDrawingObjects(Class, Pos){
this.Type = AscDFH.historyitem_AutoShapes_RemoveFromDrawingObjects;
this.Pos = Pos;
CChangesDrawingObjectsRemoveFromDrawingObjects.superclass.constructor.call(this, Class);
AscDFH.CChangesBase.call(this, Class);
}
AscCommon.extendClass(CChangesDrawingObjectsRemoveFromDrawingObjects, AscDFH.CChangesBase);
CChangesDrawingObjectsRemoveFromDrawingObjects.prototype = Object.create(AscDFH.CChangesBase.prototype);
CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.constructor = CChangesDrawingObjectsRemoveFromDrawingObjects;
CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.Undo = function(){
AscFormat.addToDrawings(this.Class.worksheet, this.Class, this.Pos);
};
......
......@@ -41,10 +41,11 @@
*/
function CCollaborativeEditing()
{
CCollaborativeEditing.superclass.constructor.call(this);
AscCommon.CCollaborativeEditingBase.call(this);
}
AscCommon.extendClass(CCollaborativeEditing, AscCommon.CCollaborativeEditingBase);
CCollaborativeEditing.prototype = Object.create(AscCommon.CCollaborativeEditingBase.prototype);
CCollaborativeEditing.prototype.constructor = CCollaborativeEditing;
CCollaborativeEditing.prototype.Have_OtherChanges = function()
{
......
This diff is collapsed.
......@@ -54,7 +54,8 @@
this.argumentsMax = 255;
}
cCUBEKPIMEMBER.prototype = Object.create(cBaseFunction.prototype);
cCUBEKPIMEMBER.prototype = Object.create(cBaseFunction.prototype);
cCUBEKPIMEMBER.prototype.constructor = cCUBEKPIMEMBER;
/** @constructor */
function cCUBEMEMBER() {
......@@ -65,7 +66,8 @@
this.argumentsMax = 255;
}
cCUBEMEMBER.prototype = Object.create(cBaseFunction.prototype);
cCUBEMEMBER.prototype = Object.create(cBaseFunction.prototype);
cCUBEMEMBER.prototype.constructor = cCUBEMEMBER;
/** @constructor */
function cCUBEMEMBERPROPERTY() {
......@@ -76,7 +78,8 @@
this.argumentsMax = 255;
}
cCUBEMEMBERPROPERTY.prototype = Object.create(cBaseFunction.prototype);
cCUBEMEMBERPROPERTY.prototype = Object.create(cBaseFunction.prototype);
cCUBEMEMBERPROPERTY.prototype.constructor = cCUBEMEMBERPROPERTY;
/** @constructor */
function cCUBERANKEDMEMBER() {
......@@ -87,7 +90,8 @@
this.argumentsMax = 255;
}
cCUBERANKEDMEMBER.prototype = Object.create(cBaseFunction.prototype);
cCUBERANKEDMEMBER.prototype = Object.create(cBaseFunction.prototype);
cCUBERANKEDMEMBER.prototype.constructor = cCUBERANKEDMEMBER;
/** @constructor */
function cCUBESET() {
......@@ -98,7 +102,8 @@
this.argumentsMax = 255;
}
cCUBESET.prototype = Object.create(cBaseFunction.prototype);
cCUBESET.prototype = Object.create(cBaseFunction.prototype);
cCUBESET.prototype.constructor = cCUBESET;
/** @constructor */
function cCUBESETCOUNT() {
......@@ -109,7 +114,8 @@
this.argumentsMax = 255;
}
cCUBESETCOUNT.prototype = Object.create(cBaseFunction.prototype);
cCUBESETCOUNT.prototype = Object.create(cBaseFunction.prototype);
cCUBESETCOUNT.prototype.constructor = cCUBESETCOUNT;
/** @constructor */
function cCUBEVALUE() {
......@@ -120,5 +126,6 @@
this.argumentsMax = 255;
}
cCUBEVALUE.prototype = Object.create(cBaseFunction.prototype);
cCUBEVALUE.prototype = Object.create(cBaseFunction.prototype);
cCUBEVALUE.prototype.constructor = cCUBEVALUE;
})(window);
......@@ -49,82 +49,94 @@
cBaseFunction.call(this, "DAVERAGE");
}
cDAVERAGE.prototype = Object.create(cBaseFunction.prototype);
cDAVERAGE.prototype = Object.create(cBaseFunction.prototype);
cDAVERAGE.prototype.constructor = cDAVERAGE;
/** @constructor */
function cDCOUNT() {
cBaseFunction.call(this, "DCOUNT");
}
cDCOUNT.prototype = Object.create(cBaseFunction.prototype);
cDCOUNT.prototype = Object.create(cBaseFunction.prototype);
cDCOUNT.prototype.constructor = cDCOUNT;
/** @constructor */
function cDCOUNTA() {
cBaseFunction.call(this, "DCOUNTA");
}
cDCOUNTA.prototype = Object.create(cBaseFunction.prototype);
cDCOUNTA.prototype = Object.create(cBaseFunction.prototype);
cDCOUNTA.prototype.constructor = cDCOUNTA;
/** @constructor */
function cDGET() {
cBaseFunction.call(this, "DGET");
}
cDGET.prototype = Object.create(cBaseFunction.prototype);
cDGET.prototype = Object.create(cBaseFunction.prototype);
cDGET.prototype.constructor = cDGET;
/** @constructor */
function cDMAX() {
cBaseFunction.call(this, "DMAX");
}
cDMAX.prototype = Object.create(cBaseFunction.prototype);
cDMAX.prototype = Object.create(cBaseFunction.prototype);
cDMAX.prototype.constructor = cDMAX;
/** @constructor */
function cDMIN() {
cBaseFunction.call(this, "DMIN");
}
cDMIN.prototype = Object.create(cBaseFunction.prototype);
cDMIN.prototype = Object.create(cBaseFunction.prototype);
cDMIN.prototype.constructor = cDMIN;
/** @constructor */
function cDPRODUCT() {
cBaseFunction.call(this, "DPRODUCT");
}
cDPRODUCT.prototype = Object.create(cBaseFunction.prototype);
cDPRODUCT.prototype = Object.create(cBaseFunction.prototype);
cDPRODUCT.prototype.constructor = cDPRODUCT;
/** @constructor */
function cDSTDEV() {
cBaseFunction.call(this, "DSTDEV");
}
cDSTDEV.prototype = Object.create(cBaseFunction.prototype);
cDSTDEV.prototype = Object.create(cBaseFunction.prototype);
cDSTDEV.prototype.constructor = cDSTDEV;
/** @constructor */
function cDSTDEVP() {
cBaseFunction.call(this, "DSTDEVP");
}
cDSTDEVP.prototype = Object.create(cBaseFunction.prototype);
cDSTDEVP.prototype = Object.create(cBaseFunction.prototype);
cDSTDEVP.prototype.constructor = cDSTDEVP;
/** @constructor */
function cDSUM() {
cBaseFunction.call(this, "DSUM");
}
cDSUM.prototype = Object.create(cBaseFunction.prototype);
cDSUM.prototype = Object.create(cBaseFunction.prototype);
cDSUM.prototype.constructor = cDSUM;
/** @constructor */
function cDVAR() {
cBaseFunction.call(this, "DVAR");
}
cDVAR.prototype = Object.create(cBaseFunction.prototype);
cDVAR.prototype = Object.create(cBaseFunction.prototype);
cDVAR.prototype.constructor = cDVAR;
/** @constructor */
function cDVARP() {
cBaseFunction.call(this, "DVARP");
}
cDVARP.prototype = Object.create(cBaseFunction.prototype);
cDVARP.prototype = Object.create(cBaseFunction.prototype);
cDVARP.prototype.constructor = cDVARP;
})(window);
......@@ -303,7 +303,8 @@
this.argumentsMax = 3;
}
cDATE.prototype = Object.create(cBaseFunction.prototype);
cDATE.prototype = Object.create(cBaseFunction.prototype);
cDATE.prototype.constructor = cDATE;
cDATE.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2], year, month, day;
......@@ -372,7 +373,8 @@
this.argumentsMax = 3;
}
cDATEDIF.prototype = Object.create(cBaseFunction.prototype);
cDATEDIF.prototype = Object.create(cBaseFunction.prototype);
cDATEDIF.prototype.constructor = cDATEDIF;
cDATEDIF.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cDATEDIF.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2];
......@@ -489,7 +491,8 @@
this.argumentsMax = 1;
}
cDATEVALUE.prototype = Object.create(cBaseFunction.prototype);
cDATEVALUE.prototype = Object.create(cBaseFunction.prototype);
cDATEVALUE.prototype.constructor = cDATEVALUE;
cDATEVALUE.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cDATEVALUE.prototype.Calculate = function (arg) {
var arg0 = arg[0];
......@@ -528,7 +531,8 @@
this.argumentsMax = 1;
}
cDAY.prototype = Object.create(cBaseFunction.prototype);
cDAY.prototype = Object.create(cBaseFunction.prototype);
cDAY.prototype.constructor = cDAY;
cDAY.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cDAY.prototype.Calculate = function (arg) {
var arg0 = arg[0], val;
......@@ -600,7 +604,8 @@
this.argumentsMax = 3;
}
cDAYS360.prototype = Object.create(cBaseFunction.prototype);
cDAYS360.prototype = Object.create(cBaseFunction.prototype);
cDAYS360.prototype.constructor = cDAYS360;
cDAYS360.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cDAYS360.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2] ? arg[2] : new cBool(false);
......@@ -665,7 +670,8 @@
this.argumentsMax = 2;
}
cEDATE.prototype = Object.create(cBaseFunction.prototype);
cEDATE.prototype = Object.create(cBaseFunction.prototype);
cEDATE.prototype.constructor = cEDATE;
cEDATE.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cEDATE.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1];
......@@ -739,7 +745,8 @@
this.argumentsMax = 2;
}
cEOMONTH.prototype = Object.create(cBaseFunction.prototype);
cEOMONTH.prototype = Object.create(cBaseFunction.prototype);
cEOMONTH.prototype.constructor = cEOMONTH;
cEOMONTH.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cEOMONTH.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1];
......@@ -804,7 +811,8 @@
this.argumentsMax = 1;
}
cHOUR.prototype = Object.create(cBaseFunction.prototype);
cHOUR.prototype = Object.create(cBaseFunction.prototype);
cHOUR.prototype.constructor = cHOUR;
cHOUR.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cHOUR.prototype.Calculate = function (arg) {
var arg0 = arg[0], val;
......@@ -868,7 +876,8 @@
this.argumentsMax = 1;
}
cMINUTE.prototype = Object.create(cBaseFunction.prototype);
cMINUTE.prototype = Object.create(cBaseFunction.prototype);
cMINUTE.prototype.constructor = cMINUTE;
cMINUTE.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cMINUTE.prototype.Calculate = function (arg) {
var arg0 = arg[0], val;
......@@ -931,7 +940,8 @@
this.argumentsMax = 1;
}
cMONTH.prototype = Object.create(cBaseFunction.prototype);
cMONTH.prototype = Object.create(cBaseFunction.prototype);
cMONTH.prototype.constructor = cMONTH;
cMONTH.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cMONTH.prototype.Calculate = function (arg) {
var arg0 = arg[0], val;
......@@ -999,7 +1009,8 @@
this.argumentsMax = 3;
}
cNETWORKDAYS.prototype = Object.create(cBaseFunction.prototype);
cNETWORKDAYS.prototype = Object.create(cBaseFunction.prototype);
cNETWORKDAYS.prototype.constructor = cNETWORKDAYS;
cNETWORKDAYS.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cNETWORKDAYS.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2];
......@@ -1120,7 +1131,8 @@
cBaseFunction.call(this, "NETWORKDAYS.INTL");
}
cNETWORKDAYS_INTL.prototype = Object.create(cBaseFunction.prototype);
cNETWORKDAYS_INTL.prototype = Object.create(cBaseFunction.prototype);
cNETWORKDAYS_INTL.prototype.constructor = cNETWORKDAYS_INTL;
/** @constructor */
function cNOW() {
......@@ -1131,7 +1143,8 @@
this.argumentsMax = 0;
}
cNOW.prototype = Object.create(cBaseFunction.prototype);
cNOW.prototype = Object.create(cBaseFunction.prototype);
cNOW.prototype.constructor = cNOW;
cNOW.prototype.Calculate = function () {
var d = new Date();
this.value = new cNumber(d.getExcelDate() +
......@@ -1154,7 +1167,8 @@
this.argumentsMax = 1;
}
cSECOND.prototype = Object.create(cBaseFunction.prototype);
cSECOND.prototype = Object.create(cBaseFunction.prototype);
cSECOND.prototype.constructor = cSECOND;
cSECOND.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cSECOND.prototype.Calculate = function (arg) {
var arg0 = arg[0], val;
......@@ -1217,7 +1231,8 @@
this.argumentsMax = 3;
}
cTIME.prototype = Object.create(cBaseFunction.prototype);
cTIME.prototype = Object.create(cBaseFunction.prototype);
cTIME.prototype.constructor = cTIME;
cTIME.prototype.Calculate = function (arg) {
var hour = arg[0], minute = arg[1], second = arg[2];
......@@ -1277,7 +1292,8 @@
this.argumentsMax = 1;
}
cTIMEVALUE.prototype = Object.create(cBaseFunction.prototype);
cTIMEVALUE.prototype = Object.create(cBaseFunction.prototype);
cTIMEVALUE.prototype.constructor = cTIMEVALUE;
cTIMEVALUE.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cTIMEVALUE.prototype.Calculate = function (arg) {
var arg0 = arg[0];
......@@ -1317,7 +1333,8 @@
this.argumentsMax = 0;
}
cTODAY.prototype = Object.create(cBaseFunction.prototype);
cTODAY.prototype = Object.create(cBaseFunction.prototype);
cTODAY.prototype.constructor = cTODAY;
cTODAY.prototype.Calculate = function () {
this.setCA(new cNumber(new Date().getExcelDate()), true);
if (arguments[1].getNumFormatStr().toLowerCase() === "general") {
......@@ -1340,7 +1357,8 @@
this.argumentsMax = 2;
}
cWEEKDAY.prototype = Object.create(cBaseFunction.prototype);
cWEEKDAY.prototype = Object.create(cBaseFunction.prototype);
cWEEKDAY.prototype.constructor = cWEEKDAY;
cWEEKDAY.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cWEEKDAY.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1] ? arg[1] : new cNumber(1);
......@@ -1422,7 +1440,8 @@
this.argumentsMax = 2;
}
cWEEKNUM.prototype = Object.create(cBaseFunction.prototype);
cWEEKNUM.prototype = Object.create(cBaseFunction.prototype);
cWEEKNUM.prototype.constructor = cWEEKNUM;
cWEEKNUM.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cWEEKNUM.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1] ? arg[1] : new cNumber(1), type = 0;
......@@ -1537,7 +1556,8 @@
this.argumentsMax = 3;
}
cWORKDAY.prototype = Object.create(cBaseFunction.prototype);
cWORKDAY.prototype = Object.create(cBaseFunction.prototype);
cWORKDAY.prototype.constructor = cWORKDAY;
cWORKDAY.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cWORKDAY.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2];
......@@ -1659,7 +1679,8 @@
cBaseFunction.call(this, "WORKDAY.INTL");
}
cWORKDAY_INTL.prototype = Object.create(cBaseFunction.prototype);
cWORKDAY_INTL.prototype = Object.create(cBaseFunction.prototype);
cWORKDAY_INTL.prototype.constructor = cWORKDAY_INTL;
/** @constructor */
function cYEAR() {
......@@ -1670,7 +1691,8 @@
this.argumentsMax = 1;
}
cYEAR.prototype = Object.create(cBaseFunction.prototype);
cYEAR.prototype = Object.create(cBaseFunction.prototype);
cYEAR.prototype.constructor = cYEAR;
cYEAR.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cYEAR.prototype.Calculate = function (arg) {
var arg0 = arg[0], val;
......@@ -1732,7 +1754,8 @@
this.argumentsMax = 3;
}
cYEARFRAC.prototype = Object.create(cBaseFunction.prototype);
cYEARFRAC.prototype = Object.create(cBaseFunction.prototype);
cYEARFRAC.prototype.constructor = cYEARFRAC;
cYEARFRAC.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cYEARFRAC.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2] ? arg[2] : new cNumber(0);
......
......@@ -64,7 +64,8 @@
this.argumentsMax = 1;
}
cERROR_TYPE.prototype = Object.create(cBaseFunction.prototype);
cERROR_TYPE.prototype = Object.create(cBaseFunction.prototype);
cERROR_TYPE.prototype.constructor = cERROR_TYPE;
cERROR_TYPE.prototype.Calculate = function (arg) {
function typeError(elem) {
if (elem instanceof cError) {
......@@ -125,7 +126,8 @@
this.argumentsMax = 1;
}
cISBLANK.prototype = Object.create(cBaseFunction.prototype);
cISBLANK.prototype = Object.create(cBaseFunction.prototype);
cISBLANK.prototype.constructor = cISBLANK;
cISBLANK.prototype.Calculate = function (arg) {
var arg0 = arg[0];
if (arg0 instanceof cArea || arg0 instanceof cArea3D) {
......@@ -154,7 +156,8 @@
this.argumentsMax = 1;
}
cISERR.prototype = Object.create(cBaseFunction.prototype);
cISERR.prototype = Object.create(cBaseFunction.prototype);
cISERR.prototype.constructor = cISERR;
cISERR.prototype.Calculate = function (arg) {
var arg0 = arg[0];
if (arg0 instanceof cArray) {
......@@ -186,7 +189,8 @@
this.argumentsMax = 1;
}
cISERROR.prototype = Object.create(cBaseFunction.prototype);
cISERROR.prototype = Object.create(cBaseFunction.prototype);
cISERROR.prototype.constructor = cISERROR;
cISERROR.prototype.Calculate = function (arg) {
var arg0 = arg[0];
if (arg0 instanceof cArray) {
......@@ -218,7 +222,8 @@
this.argumentsMax = 1;
}
cISEVEN.prototype = Object.create(cBaseFunction.prototype);
cISEVEN.prototype = Object.create(cBaseFunction.prototype);
cISEVEN.prototype.constructor = cISEVEN;
cISEVEN.prototype.Calculate = function (arg) {
var arg0 = arg[0];
if (arg0 instanceof cArray) {
......@@ -255,7 +260,8 @@
this.argumentsMax = 1;
}
cISLOGICAL.prototype = Object.create(cBaseFunction.prototype);
cISLOGICAL.prototype = Object.create(cBaseFunction.prototype);
cISLOGICAL.prototype.constructor = cISLOGICAL;
cISLOGICAL.prototype.Calculate = function (arg) {
var arg0 = arg[0];
if (arg0 instanceof cArray) {
......@@ -287,7 +293,8 @@
this.argumentsMax = 1;
}
cISNA.prototype = Object.create(cBaseFunction.prototype);
cISNA.prototype = Object.create(cBaseFunction.prototype);
cISNA.prototype.constructor = cISNA;
cISNA.prototype.Calculate = function (arg) {
var arg0 = arg[0];
if (arg0 instanceof cArray) {
......@@ -319,7 +326,8 @@
this.argumentsMax = 1;
}
cISNONTEXT.prototype = Object.create(cBaseFunction.prototype);
cISNONTEXT.prototype = Object.create(cBaseFunction.prototype);
cISNONTEXT.prototype.constructor = cISNONTEXT;
cISNONTEXT.prototype.Calculate = function (arg) {
var arg0 = arg[0];
if (arg0 instanceof cArray) {
......@@ -350,7 +358,8 @@
this.argumentsMax = 1;
}
cISNUMBER.prototype = Object.create(cBaseFunction.prototype);
cISNUMBER.prototype = Object.create(cBaseFunction.prototype);
cISNUMBER.prototype.constructor = cISNUMBER;
cISNUMBER.prototype.Calculate = function (arg) {
var arg0 = arg[0];
if (arg0 instanceof cArray) {
......@@ -382,7 +391,8 @@
this.argumentsMax = 1;
}
cISODD.prototype = Object.create(cBaseFunction.prototype);
cISODD.prototype = Object.create(cBaseFunction.prototype);
cISODD.prototype.constructor = cISODD;
cISODD.prototype.Calculate = function (arg) {
var arg0 = arg[0];
if (arg0 instanceof cArray) {
......@@ -419,7 +429,8 @@
this.argumentsMax = 1;
}
cISREF.prototype = Object.create(cBaseFunction.prototype);
cISREF.prototype = Object.create(cBaseFunction.prototype);
cISREF.prototype.constructor = cISREF;
cISREF.prototype.Calculate = function (arg) {
if ((arg[0] instanceof cRef || arg[0] instanceof cArea || arg[0] instanceof cArea3D ||
arg[0] instanceof cRef3D) && arg[0].isValid && arg[0].isValid()) {
......@@ -443,7 +454,8 @@
this.argumentsMax = 1;
}
cISTEXT.prototype = Object.create(cBaseFunction.prototype);
cISTEXT.prototype = Object.create(cBaseFunction.prototype);
cISTEXT.prototype.constructor = cISTEXT;
cISTEXT.prototype.Calculate = function (arg) {
var arg0 = arg[0];
if (arg0 instanceof cArray) {
......@@ -475,7 +487,8 @@
this.argumentsMax = 1;
}
cN.prototype = Object.create(cBaseFunction.prototype);
cN.prototype = Object.create(cBaseFunction.prototype);
cN.prototype.constructor = cN;
cN.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cN.prototype.Calculate = function (arg) {
var arg0 = arg[0];
......@@ -521,7 +534,8 @@
this.argumentsMax = 0;
}
cNA.prototype = Object.create(cBaseFunction.prototype);
cNA.prototype = Object.create(cBaseFunction.prototype);
cNA.prototype.constructor = cNA;
cNA.prototype.Calculate = function () {
return this.value = new cError(cErrorType.not_available);
};
......@@ -540,7 +554,8 @@
this.argumentsMax = 1;
}
cTYPE.prototype = Object.create(cBaseFunction.prototype);
cTYPE.prototype = Object.create(cBaseFunction.prototype);
cTYPE.prototype.constructor = cTYPE;
cTYPE.prototype.Calculate = function (arg) {
var arg0 = arg[0];
if (arg0 instanceof cArea || arg0 instanceof cArea3D) {
......
......@@ -62,7 +62,8 @@
this.argumentsMax = 255;
}
cAND.prototype = Object.create(cBaseFunction.prototype);
cAND.prototype = Object.create(cBaseFunction.prototype);
cAND.prototype.constructor = cAND;
cAND.prototype.Calculate = function (arg) {
var argResult = null;
for (var i = 0; i < arg.length; i++) {
......@@ -137,7 +138,8 @@
this.argumentsMax = 0;
}
cFALSE.prototype = Object.create(cBaseFunction.prototype);
cFALSE.prototype = Object.create(cBaseFunction.prototype);
cFALSE.prototype.constructor = cFALSE;
cFALSE.prototype.Calculate = function () {
return this.value = new cBool(false);
};
......@@ -156,7 +158,8 @@
this.argumentsMax = 3;
}
cIF.prototype = Object.create(cBaseFunction.prototype);
cIF.prototype = Object.create(cBaseFunction.prototype);
cIF.prototype.constructor = cIF;
cIF.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2];
......@@ -198,7 +201,8 @@
this.argumentsMax = 2;
}
cIFERROR.prototype = Object.create(cBaseFunction.prototype);
cIFERROR.prototype = Object.create(cBaseFunction.prototype);
cIFERROR.prototype.constructor = cIFERROR;
cIFERROR.prototype.Calculate = function (arg) {
var arg0 = arg[0];
if (arg0 instanceof cArray) {
......@@ -232,7 +236,8 @@
this.argumentsMax = 1;
}
cNOT.prototype = Object.create(cBaseFunction.prototype);
cNOT.prototype = Object.create(cBaseFunction.prototype);
cNOT.prototype.constructor = cNOT;
cNOT.prototype.Calculate = function (arg) {
var arg0 = arg[0];
if (arg0 instanceof cArray) {
......@@ -271,7 +276,8 @@
this.argumentsMax = 255;
}
cOR.prototype = Object.create(cBaseFunction.prototype);
cOR.prototype = Object.create(cBaseFunction.prototype);
cOR.prototype.constructor = cOR;
cOR.prototype.Calculate = function (arg) {
var argResult = null;
for (var i = 0; i < arg.length; i++) {
......@@ -343,7 +349,8 @@
this.argumentsMax = 0;
}
cTRUE.prototype = Object.create(cBaseFunction.prototype);
cTRUE.prototype = Object.create(cBaseFunction.prototype);
cTRUE.prototype.constructor = cTRUE;
cTRUE.prototype.Calculate = function () {
return this.value = new cBool(true);
};
......
......@@ -103,7 +103,8 @@
this.argumentsMax = 5;
}
cADDRESS.prototype = Object.create(cBaseFunction.prototype);
cADDRESS.prototype = Object.create(cBaseFunction.prototype);
cADDRESS.prototype.constructor = cADDRESS;
cADDRESS.prototype.Calculate = function (arg) {
var rowNumber = arg[0], colNumber = arg[1], refType = arg[2] ? arg[2] : new cNumber(1), A1RefType = arg[3] ?
arg[3] : new cBool(true), sheetName = arg[4] ? arg[4] : new cEmpty();
......@@ -215,7 +216,8 @@
cBaseFunction.call(this, "AREAS");
}
cAREAS.prototype = Object.create(cBaseFunction.prototype);
cAREAS.prototype = Object.create(cBaseFunction.prototype);
cAREAS.prototype.constructor = cAREAS;
/** @constructor */
function cCHOOSE() {
......@@ -226,7 +228,8 @@
this.argumentsMax = 30;
}
cCHOOSE.prototype = Object.create(cBaseFunction.prototype);
cCHOOSE.prototype = Object.create(cBaseFunction.prototype);
cCHOOSE.prototype.constructor = cCHOOSE;
cCHOOSE.prototype.Calculate = function (arg) {
var arg0 = arg[0];
......@@ -264,7 +267,8 @@
this.argumentsMax = 1;
}
cCOLUMN.prototype = Object.create(cBaseFunction.prototype);
cCOLUMN.prototype = Object.create(cBaseFunction.prototype);
cCOLUMN.prototype.constructor = cCOLUMN;
cCOLUMN.prototype.Calculate = function (arg) {
var arg0;
if (this.argumentsCurrent == 0) {
......@@ -294,7 +298,8 @@
this.argumentsMax = 1;
}
cCOLUMNS.prototype = Object.create(cBaseFunction.prototype);
cCOLUMNS.prototype = Object.create(cBaseFunction.prototype);
cCOLUMNS.prototype.constructor = cCOLUMNS;
cCOLUMNS.prototype.Calculate = function (arg) {
var arg0 = arg[0];
var range;
......@@ -318,7 +323,8 @@
cBaseFunction.call(this, "GETPIVOTDATA");
}
cGETPIVOTDATA.prototype = Object.create(cBaseFunction.prototype);
cGETPIVOTDATA.prototype = Object.create(cBaseFunction.prototype);
cGETPIVOTDATA.prototype.constructor = cGETPIVOTDATA;
/** @constructor */
function cHLOOKUP() {
......@@ -329,7 +335,8 @@
this.argumentsMax = 4;
}
cHLOOKUP.prototype = Object.create(cBaseFunction.prototype);
cHLOOKUP.prototype = Object.create(cBaseFunction.prototype);
cHLOOKUP.prototype.constructor = cHLOOKUP;
cHLOOKUP.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2];
var arg3 = this.argumentsCurrent == 4 ? arg[3].tocBool().value : true;
......@@ -433,7 +440,8 @@
cBaseFunction.call(this, "HYPERLINK");
}
cHYPERLINK.prototype = Object.create(cBaseFunction.prototype);
cHYPERLINK.prototype = Object.create(cBaseFunction.prototype);
cHYPERLINK.prototype.constructor = cHYPERLINK;
/** @constructor */
function cINDEX() {
......@@ -444,7 +452,8 @@
this.argumentsMax = 4;
}
cINDEX.prototype = Object.create(cBaseFunction.prototype);
cINDEX.prototype = Object.create(cBaseFunction.prototype);
cINDEX.prototype.constructor = cINDEX;
cINDEX.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1] && (cElementType.empty !== arg[1].type) ? arg[1] : new cNumber(1), arg2 = arg[2] &&
(cElementType.empty !== arg[2].type) ? arg[2] : new cNumber(1), arg3 = arg[3] &&
......@@ -525,7 +534,8 @@
this.argumentsMax = 2;
}
cINDIRECT.prototype = Object.create(cBaseFunction.prototype);
cINDIRECT.prototype = Object.create(cBaseFunction.prototype);
cINDIRECT.prototype.constructor = cINDIRECT;
cINDIRECT.prototype.Calculate = function (arg) {
var t = this, arg0 = arg[0].tocString(), arg1 = arg[1] ? arg[1] :
new cBool(true), r1 = arguments[1], wb = r1.worksheet.workbook, o = {
......@@ -599,7 +609,8 @@
this.argumentsMax = 3;
}
cLOOKUP.prototype = Object.create(cBaseFunction.prototype);
cLOOKUP.prototype = Object.create(cBaseFunction.prototype);
cLOOKUP.prototype.constructor = cLOOKUP;
cLOOKUP.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1], arg2 = this.argumentsCurrent == 2 ? arg1 : arg[2], resC = -1, resR = -1;
......@@ -744,7 +755,8 @@
this.argumentsMax = 3;
}
cMATCH.prototype = Object.create(cBaseFunction.prototype);
cMATCH.prototype = Object.create(cBaseFunction.prototype);
cMATCH.prototype.constructor = cMATCH;
cMATCH.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2] ? arg[2] : new cNumber(1);
......@@ -849,7 +861,8 @@
this.argumentsMax = 5;
}
cOFFSET.prototype = Object.create(cBaseFunction.prototype);
cOFFSET.prototype = Object.create(cBaseFunction.prototype);
cOFFSET.prototype.constructor = cOFFSET;
cOFFSET.prototype.Calculate = function (arg) {
function validBBOX(bbox) {
......@@ -949,7 +962,8 @@
this.argumentsMax = 1;
}
cROW.prototype = Object.create(cBaseFunction.prototype);
cROW.prototype = Object.create(cBaseFunction.prototype);
cROW.prototype.constructor = cROW;
cROW.prototype.Calculate = function (arg) {
var arg0;
if (this.argumentsCurrent == 0) {
......@@ -979,7 +993,8 @@
this.argumentsMax = 1;
}
cROWS.prototype = Object.create(cBaseFunction.prototype);
cROWS.prototype = Object.create(cBaseFunction.prototype);
cROWS.prototype.constructor = cROWS;
cROWS.prototype.Calculate = function (arg) {
var arg0 = arg[0];
var range;
......@@ -1003,7 +1018,8 @@
cBaseFunction.call(this, "RTD");
}
cRTD.prototype = Object.create(cBaseFunction.prototype);
cRTD.prototype = Object.create(cBaseFunction.prototype);
cRTD.prototype.constructor = cRTD;
/** @constructor */
function cTRANSPOSE() {
......@@ -1014,7 +1030,8 @@
this.argumentsMax = 1;
}
cTRANSPOSE.prototype = Object.create(cBaseFunction.prototype);
cTRANSPOSE.prototype = Object.create(cBaseFunction.prototype);
cTRANSPOSE.prototype.constructor = cTRANSPOSE;
cTRANSPOSE.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cTRANSPOSE.prototype.Calculate = function (arg) {
......@@ -1147,7 +1164,8 @@
this.argumentsMax = 4;
}
cVLOOKUP.prototype = Object.create(cBaseFunction.prototype);
cVLOOKUP.prototype = Object.create(cBaseFunction.prototype);
cVLOOKUP.prototype.constructor = cVLOOKUP;
cVLOOKUP.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2];
var arg3 = this.argumentsCurrent == 4 ? arg[3].tocBool().value : true;
......
This diff is collapsed.
......@@ -66,14 +66,16 @@
cBaseFunction.call(this, "ASC");
}
cASC.prototype = Object.create(cBaseFunction.prototype);
cASC.prototype = Object.create(cBaseFunction.prototype);
cASC.prototype.constructor = cASC;
/** @constructor */
function cBAHTTEXT() {
cBaseFunction.call(this, "BAHTTEXT");
}
cBAHTTEXT.prototype = Object.create(cBaseFunction.prototype);
cBAHTTEXT.prototype = Object.create(cBaseFunction.prototype);
cBAHTTEXT.prototype.constructor = cBAHTTEXT;
/** @constructor */
function cCHAR() {
......@@ -84,7 +86,8 @@
this.argumentsMax = 1;
}
cCHAR.prototype = Object.create(cBaseFunction.prototype);
cCHAR.prototype = Object.create(cBaseFunction.prototype);
cCHAR.prototype.constructor = cCHAR;
cCHAR.prototype.Calculate = function (arg) {
var arg0 = arg[0];
......@@ -132,7 +135,8 @@
}
cCLEAN.prototype = Object.create(cBaseFunction.prototype);
cCLEAN.prototype = Object.create(cBaseFunction.prototype);
cCLEAN.prototype.constructor = cCLEAN;
cCLEAN.prototype.Calculate = function (arg) {
var arg0 = arg[0];
......@@ -170,7 +174,8 @@
this.argumentsMax = 1;
}
cCODE.prototype = Object.create(cBaseFunction.prototype);
cCODE.prototype = Object.create(cBaseFunction.prototype);
cCODE.prototype.constructor = cCODE;
cCODE.prototype.Calculate = function (arg) {
var arg0 = arg[0];
......@@ -216,7 +221,8 @@
this.argumentsMax = 255;
}
cCONCATENATE.prototype = Object.create(cBaseFunction.prototype);
cCONCATENATE.prototype = Object.create(cBaseFunction.prototype);
cCONCATENATE.prototype.constructor = cCONCATENATE;
cCONCATENATE.prototype.Calculate = function (arg) {
var arg0 = new cString(""), argI;
for (var i = 0; i < this.argumentsCurrent; i++) {
......@@ -261,7 +267,8 @@
this.argumentsMax = 2;
}
cDOLLAR.prototype = Object.create(cBaseFunction.prototype);
cDOLLAR.prototype = Object.create(cBaseFunction.prototype);
cDOLLAR.prototype.constructor = cDOLLAR;
cDOLLAR.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cDOLLAR.prototype.Calculate = function (arg) {
......@@ -461,7 +468,8 @@
this.argumentsMax = 2;
}
cEXACT.prototype = Object.create(cBaseFunction.prototype);
cEXACT.prototype = Object.create(cBaseFunction.prototype);
cEXACT.prototype.constructor = cEXACT;
cEXACT.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1];
if (arg0 instanceof cArea || arg0 instanceof cArea3D) {
......@@ -508,7 +516,8 @@
this.argumentsMax = 3;
}
cFIND.prototype = Object.create(cBaseFunction.prototype);
cFIND.prototype = Object.create(cBaseFunction.prototype);
cFIND.prototype.constructor = cFIND;
cFIND.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1], arg2 = this.getArguments() == 3 ? arg[2] :
null, res, str, searchStr, pos = -1;
......@@ -602,7 +611,8 @@
this.argumentsMax = 3;
}
cFIXED.prototype = Object.create(cBaseFunction.prototype);
cFIXED.prototype = Object.create(cBaseFunction.prototype);
cFIXED.prototype.constructor = cFIXED;
cFIXED.prototype.Calculate = function (arg) {
function SignZeroPositive(number) {
......@@ -795,7 +805,8 @@
cBaseFunction.call(this, "JIS");
}
cJIS.prototype = Object.create(cBaseFunction.prototype);
cJIS.prototype = Object.create(cBaseFunction.prototype);
cJIS.prototype.constructor = cJIS;
/** @constructor */
function cLEFT() {
......@@ -806,7 +817,8 @@
this.argumentsMax = 2;
}
cLEFT.prototype = Object.create(cBaseFunction.prototype);
cLEFT.prototype = Object.create(cBaseFunction.prototype);
cLEFT.prototype.constructor = cLEFT;
cLEFT.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = this.argumentsCurrent == 1 ? new cNumber(1) : arg[1];
if (arg0 instanceof cArea || arg0 instanceof cArea3D) {
......@@ -864,7 +876,8 @@
this.argumentsMax = 1;
}
cLEN.prototype = Object.create(cBaseFunction.prototype);
cLEN.prototype = Object.create(cBaseFunction.prototype);
cLEN.prototype.constructor = cLEN;
cLEN.prototype.Calculate = function (arg) {
var arg0 = arg[0];
if (arg0 instanceof cArea || arg0 instanceof cArea3D) {
......@@ -906,7 +919,8 @@
this.argumentsMax = 1;
}
cLOWER.prototype = Object.create(cBaseFunction.prototype);
cLOWER.prototype = Object.create(cBaseFunction.prototype);
cLOWER.prototype.constructor = cLOWER;
cLOWER.prototype.Calculate = function (arg) {
var arg0 = arg[0];
......@@ -940,7 +954,8 @@
this.argumentsMax = 3;
}
cMID.prototype = Object.create(cBaseFunction.prototype);
cMID.prototype = Object.create(cBaseFunction.prototype);
cMID.prototype.constructor = cMID;
cMID.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2];
if (arg0 instanceof cArea || arg0 instanceof cArea3D) {
......@@ -1014,7 +1029,8 @@
cBaseFunction.call(this, "PHONETIC");
}
cPHONETIC.prototype = Object.create(cBaseFunction.prototype);
cPHONETIC.prototype = Object.create(cBaseFunction.prototype);
cPHONETIC.prototype.constructor = cPHONETIC;
/** @constructor */
function cPROPER() {
......@@ -1025,7 +1041,8 @@
this.argumentsMax = 1;
}
cPROPER.prototype = Object.create(cBaseFunction.prototype);
cPROPER.prototype = Object.create(cBaseFunction.prototype);
cPROPER.prototype.constructor = cPROPER;
cPROPER.prototype.Calculate = function (arg) {
var reg_PROPER = new RegExp("[-#$+*/^&%<\\[\\]='?_\\@!~`\">: ;.\\)\\(,]|\\d|\\s"), arg0 = arg[0];
......@@ -1092,7 +1109,8 @@
this.argumentsMax = 4;
}
cREPLACE.prototype = Object.create(cBaseFunction.prototype);
cREPLACE.prototype = Object.create(cBaseFunction.prototype);
cREPLACE.prototype.constructor = cREPLACE;
cREPLACE.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2], arg3 = arg[3];
......@@ -1178,7 +1196,8 @@
this.argumentsMax = 2;
}
cREPT.prototype = Object.create(cBaseFunction.prototype);
cREPT.prototype = Object.create(cBaseFunction.prototype);
cREPT.prototype.constructor = cREPT;
cREPT.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1], res = "";
if (arg0 instanceof cError) {
......@@ -1241,7 +1260,8 @@
this.argumentsMax = 2;
}
cRIGHT.prototype = Object.create(cBaseFunction.prototype);
cRIGHT.prototype = Object.create(cBaseFunction.prototype);
cRIGHT.prototype.constructor = cRIGHT;
cRIGHT.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = this.argumentsCurrent == 1 ? new cNumber(1) : arg[1];
if (arg0 instanceof cArea || arg0 instanceof cArea3D) {
......@@ -1299,7 +1319,8 @@
this.argumentsMax = 3;
}
cSEARCH.prototype = Object.create(cBaseFunction.prototype);
cSEARCH.prototype = Object.create(cBaseFunction.prototype);
cSEARCH.prototype.constructor = cSEARCH;
cSEARCH.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2] ? arg[2] : new cNumber(1);
......@@ -1397,7 +1418,8 @@
this.argumentsMax = 4;
}
cSUBSTITUTE.prototype = Object.create(cBaseFunction.prototype);
cSUBSTITUTE.prototype = Object.create(cBaseFunction.prototype);
cSUBSTITUTE.prototype.constructor = cSUBSTITUTE;
cSUBSTITUTE.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2], arg3 = arg[3] ? arg[3] : new cNumber(0);
......@@ -1479,7 +1501,8 @@
this.argumentsMax = 1;
}
cT.prototype = Object.create(cBaseFunction.prototype);
cT.prototype = Object.create(cBaseFunction.prototype);
cT.prototype.constructor = cT;
cT.prototype.Calculate = function (arg) {
var arg0 = arg[0];
if (arg0 instanceof cRef || arg0 instanceof cRef3D) {
......@@ -1513,7 +1536,8 @@
this.argumentsMax = 2;
}
cTEXT.prototype = Object.create(cBaseFunction.prototype);
cTEXT.prototype = Object.create(cBaseFunction.prototype);
cTEXT.prototype.constructor = cTEXT;
cTEXT.prototype.Calculate = function (arg) {
var arg0 = arg[0], arg1 = arg[1];
if (arg0 instanceof cRef || arg0 instanceof cRef3D) {
......@@ -1585,7 +1609,8 @@
this.argumentsMax = 1;
}
cTRIM.prototype = Object.create(cBaseFunction.prototype);
cTRIM.prototype = Object.create(cBaseFunction.prototype);
cTRIM.prototype.constructor = cTRIM;
cTRIM.prototype.Calculate = function (arg) {
var arg0 = arg[0];
......@@ -1622,7 +1647,8 @@
this.argumentsMax = 1;
}
cUPPER.prototype = Object.create(cBaseFunction.prototype);
cUPPER.prototype = Object.create(cBaseFunction.prototype);
cUPPER.prototype.constructor = cUPPER;
cUPPER.prototype.Calculate = function (arg) {
var arg0 = arg[0];
if (arg0 instanceof cArea || arg0 instanceof cArea3D) {
......@@ -1654,7 +1680,8 @@
this.argumentsMax = 1;
}
cVALUE.prototype = Object.create(cBaseFunction.prototype);
cVALUE.prototype = Object.create(cBaseFunction.prototype);
cVALUE.prototype.constructor = cVALUE;
cVALUE.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cVALUE.prototype.Calculate = function (arg) {
var arg0 = arg[0];
......
......@@ -3880,12 +3880,13 @@ TreeRBNode.prototype = {
* @extends {TreeRBNode}
*/
function IntervalTreeRBNode(low, high, storedValue){
IntervalTreeRBNode.superclass.constructor.call(this, low, storedValue);
TreeRBNode.call(this, low, storedValue);
this.high = high;
this.maxHigh = this.high;
this.minLow = this.key;
}
AscCommon.extendClass(IntervalTreeRBNode, TreeRBNode);
IntervalTreeRBNode.prototype = Object.create(TreeRBNode.prototype);
IntervalTreeRBNode.prototype.constructor = IntervalTreeRBNode;
IntervalTreeRBNode.prototype.isEqual = function (x) {
return this.key == x.key && this.high == x.high;
};
......@@ -4181,9 +4182,10 @@ TreeRB.prototype = {
* @extends {TreeRB}
*/
function IntervalTreeRB(){
IntervalTreeRB.superclass.constructor.call(this);
TreeRB.call(this);
}
AscCommon.extendClass(IntervalTreeRB, TreeRB);
IntervalTreeRB.prototype = Object.create(TreeRB.prototype);
IntervalTreeRB.prototype.constructor = IntervalTreeRB;
IntervalTreeRB.prototype._init = function (x) {
this.nil = new IntervalTreeRBNode();
this.nil.left = this.nil.right = this.nil.parent = this.nil;
......@@ -4231,7 +4233,7 @@ IntervalTreeRB.prototype._enumerateRecursion = function (low, high, x, enumResul
};
IntervalTreeRB.prototype._leftRotate = function (x) {
var y = x.right;
IntervalTreeRB.superclass._leftRotate.call(this, x);
TreeRB.prototype._leftRotate.call(this, x);
x.maxHigh = Math.max(x.left.maxHigh,Math.max(x.right.maxHigh,x.high));
x.minLow = Math.min(x.left.minLow,Math.min(x.right.minLow,x.key));
......@@ -4240,7 +4242,7 @@ IntervalTreeRB.prototype._leftRotate = function (x) {
};
IntervalTreeRB.prototype._rightRotate = function (y) {
var x = y.left;
IntervalTreeRB.superclass._rightRotate.call(this, y);
TreeRB.prototype._rightRotate.call(this, y);
y.maxHigh = Math.max(y.left.maxHigh,Math.max(y.right.maxHigh,y.high));
y.minLow = Math.min(y.left.minLow,Math.min(y.right.minLow,y.key));
......
......@@ -792,7 +792,7 @@
if (3 == arguments.length) {
var range = arguments[0];
Range3D.superclass.constructor.call(this, range.c1, range.r1, range.c2, range.r2);
Range.call(this, range.c1, range.r1, range.c2, range.r2);
// ToDo стоит пересмотреть конструкторы.
this.refType1 = range.refType1;
this.refType2 = range.refType2;
......@@ -800,29 +800,30 @@
this.sheet = arguments[1];
this.sheet2 = arguments[2];
} else if (arguments.length > 1) {
ActiveRange.superclass.constructor.apply(this, arguments);
Range.apply(this, arguments);
} else {
ActiveRange.superclass.constructor.call(this, 0, 0, 0, 0);
Range.call(this, 0, 0, 0, 0);
}
}
AscCommon.extendClass(Range3D, Range);
Range3D.prototype = Object.create(Range.prototype);
Range3D.prototype.constructor = Range3D;
Range3D.prototype.isIntersect = function () {
var oRes = true;
if (2 == arguments.length) {
oRes = this.sheet === arguments[1];
}
return oRes && Range3D.superclass.isIntersect.apply(this, arguments);
return oRes && Range.prototype.isIntersect.apply(this, arguments);
};
Range3D.prototype.clone = function () {
return new Range3D(ActiveRange.superclass.clone.apply(this, arguments), this.sheet, this.sheet2);
return new Range3D(Range.prototype.clone.apply(this, arguments), this.sheet, this.sheet2);
};
Range3D.prototype.setSheet = function (sheet, sheet2) {
this.sheet = sheet;
this.sheet2 = sheet2 ? sheet2 : sheet;
};
Range3D.prototype.getName = function () {
return AscCommon.parserHelp.get3DRef(this.sheet, Range3D.superclass.getName.apply(this));
return AscCommon.parserHelp.get3DRef(this.sheet, Range.prototype.getName.apply(this));
};
/**
......@@ -1091,46 +1092,47 @@
if(1 == arguments.length)
{
var range = arguments[0];
ActiveRange.superclass.constructor.call(this, range.c1, range.r1, range.c2, range.r2);
Range.call(this, range.c1, range.r1, range.c2, range.r2);
// ToDo стоит пересмотреть конструкторы.
this.refType1 = range.refType1;
this.refType2 = range.refType2;
}
else if(arguments.length > 1)
ActiveRange.superclass.constructor.apply(this, arguments);
Range.apply(this, arguments);
else
ActiveRange.superclass.constructor.call(this, 0, 0, 0, 0);
Range.call(this, 0, 0, 0, 0);
this.type = c_oAscSelectionType.RangeCells;
this.startCol = 0; // Активная ячейка в выделении
this.startRow = 0; // Активная ячейка в выделении
this._updateAdditionalData();
}
AscCommon.extendClass(ActiveRange, Range);
ActiveRange.prototype = Object.create(Range.prototype);
ActiveRange.prototype.constructor = ActiveRange;
ActiveRange.prototype.assign = function () {
ActiveRange.superclass.assign.apply(this, arguments);
Range.prototype.assign.apply(this, arguments);
this._updateAdditionalData();
return this;
};
ActiveRange.prototype.assign2 = function () {
ActiveRange.superclass.assign2.apply(this, arguments);
Range.prototype.assign2.apply(this, arguments);
this._updateAdditionalData();
return this;
};
ActiveRange.prototype.clone = function(){
var oRes = new ActiveRange(ActiveRange.superclass.clone.apply(this, arguments));
var oRes = new ActiveRange(Range.prototype.clone.apply(this, arguments));
oRes.type = this.type;
oRes.startCol = this.startCol;
oRes.startRow = this.startRow;
return oRes;
};
ActiveRange.prototype.normalize = function () {
ActiveRange.superclass.normalize.apply(this, arguments);
Range.prototype.normalize.apply(this, arguments);
this._updateAdditionalData();
return this;
};
ActiveRange.prototype.isEqualAll = function () {
var bRes = ActiveRange.superclass.isEqual.apply(this, arguments);
var bRes = Range.prototype.isEqual.apply(this, arguments);
if(bRes && arguments.length > 0)
{
var range = arguments[0];
......@@ -1139,16 +1141,16 @@
return bRes;
};
ActiveRange.prototype.contains = function () {
return ActiveRange.superclass.contains.apply(this, arguments);
return Range.prototype.contains.apply(this, arguments);
};
ActiveRange.prototype.containsRange = function () {
return ActiveRange.superclass.containsRange.apply(this, arguments);
return Range.prototype.containsRange.apply(this, arguments);
};
ActiveRange.prototype.containsFirstLineRange = function () {
return ActiveRange.superclass.containsFirstLineRange.apply(this, arguments);
return Range.prototype.containsFirstLineRange.apply(this, arguments);
};
ActiveRange.prototype.intersection = function () {
var oRes = ActiveRange.superclass.intersection.apply(this, arguments);
var oRes = Range.prototype.intersection.apply(this, arguments);
if(null != oRes)
{
oRes = new ActiveRange(oRes);
......@@ -1157,7 +1159,7 @@
return oRes;
};
ActiveRange.prototype.intersectionSimple = function () {
var oRes = ActiveRange.superclass.intersectionSimple.apply(this, arguments);
var oRes = Range.prototype.intersectionSimple.apply(this, arguments);
if(null != oRes)
{
oRes = new ActiveRange(oRes);
......@@ -1166,17 +1168,17 @@
return oRes;
};
ActiveRange.prototype.union = function () {
var oRes = new ActiveRange(ActiveRange.superclass.union.apply(this, arguments));
var oRes = new ActiveRange(Range.prototype.union.apply(this, arguments));
oRes._updateAdditionalData();
return oRes;
};
ActiveRange.prototype.union2 = function () {
ActiveRange.superclass.union2.apply(this, arguments);
Range.prototype.union2.apply(this, arguments);
this._updateAdditionalData();
return this;
};
ActiveRange.prototype.union3 = function () {
ActiveRange.superclass.union3.apply(this, arguments);
Range.prototype.union3.apply(this, arguments);
this._updateAdditionalData();
return this;
};
......@@ -1185,12 +1187,12 @@
this.setOffsetLast(offset);
};
ActiveRange.prototype.setOffsetFirst = function(offset){
ActiveRange.superclass.setOffsetFirst.apply(this, arguments);
Range.prototype.setOffsetFirst.apply(this, arguments);
this._updateAdditionalData();
return this;
};
ActiveRange.prototype.setOffsetLast = function(offset){
ActiveRange.superclass.setOffsetLast.apply(this, arguments);
Range.prototype.setOffsetLast.apply(this, arguments);
this._updateAdditionalData();
return this;
};
......@@ -1226,37 +1228,39 @@
if(1 == arguments.length)
{
var range = arguments[0];
FormulaRange.superclass.constructor.call(this, range.c1, range.r1, range.c2, range.r2);
Range.call(this, range.c1, range.r1, range.c2, range.r2);
}
else if(arguments.length > 1)
FormulaRange.superclass.constructor.apply(this, arguments);
Range.apply(this, arguments);
else
FormulaRange.superclass.constructor.call(this, 0, 0, 0, 0);
Range.call(this, 0, 0, 0, 0);
this.refType1 = referenceType.R;
this.refType2 = referenceType.R;
}
AscCommon.extendClass(FormulaRange, Range);
FormulaRange.prototype = Object.create(Range.prototype);
FormulaRange.prototype.constructor = FormulaRange;
FormulaRange.prototype.clone = function () {
var oRes = new FormulaRange(FormulaRange.superclass.clone.apply(this, arguments));
var oRes = new FormulaRange(Range.prototype.clone.apply(this, arguments));
oRes.refType1 = this.refType1;
oRes.refType2 = this.refType2;
return oRes;
};
FormulaRange.prototype.intersection = function () {
var oRes = FormulaRange.superclass.intersection.apply(this, arguments);
var oRes = Range.prototype.intersection.apply(this, arguments);
if(null != oRes)
oRes = new FormulaRange(oRes);
return oRes;
};
FormulaRange.prototype.intersectionSimple = function () {
var oRes = FormulaRange.superclass.intersectionSimple.apply(this, arguments);
var oRes = Range.prototype.intersectionSimple.apply(this, arguments);
if(null != oRes)
oRes = new FormulaRange(oRes);
return oRes;
};
FormulaRange.prototype.union = function () {
return new FormulaRange(FormulaRange.superclass.union.apply(this, arguments));
return new FormulaRange(Range.prototype.union.apply(this, arguments));
};
FormulaRange.prototype.getName = function () {
var sRes = "";
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -46,7 +46,6 @@ function twttr(){};
function _gaq(){};
function constructor(){};
function superclass(){};
function touchstart(){};
function touchmove(){};
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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