Commit 034b1f8f authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

В классах CMathMatrix и CRadical реализовано заполнение Content.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58840 954022d7-b5bf-4e40-9824-e11837661b57
parent 7d734cfa
......@@ -516,7 +516,6 @@ function CMathMatrix(props)
CMathMatrix.superclass.constructor.call(this);
this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_MATRIX;
this.Pr = new CMathMatrixPr();
......@@ -534,9 +533,20 @@ function CMathMatrix(props)
g_oTableId.Add( this, this.Id );
}
Asc.extendClass(CMathMatrix, CMatrixBase);
CMathMatrix.prototype.ClassType = historyitem_type_matrix;
CMathMatrix.prototype.kind = MATH_MATRIX;
CMathMatrix.prototype.init = function(props)
{
this.setProperties(props);
this.column = this.Pr.Get_ColumnsCount();
var nRowsCount = this.getRowsCount();
var nColsCount = this.getColsCount();
this.Fill_LogicalContent(nRowsCount * nColsCount);
this.fillContent();
}
CMathMatrix.prototype.setPosition = function(pos, PosInfo)
......@@ -619,130 +629,36 @@ CMathMatrix.prototype.setColumnGapRule = function(rule, gap, minGap)
if(minGap !== null && typeof(minGap) !== "undefined")
this.spaceColumn.minGap = minGap;
};
////
CMathMatrix.prototype.setProperties = function(props)
CMathMatrix.prototype.getContentElement = function(nRowIndex, nColIndex)
{
this.setCtrPrp(props.ctrPrp);
this.column = this.Pr.Set_FromObject(props);
return this.Content[nRowIndex * this.getColsCount() + nColIndex];
};
CMathMatrix.prototype.fillContent = function()
{
this.setDimension(this.Pr.row, this.column);
this.setContent();
};
CMathMatrix.prototype.getRowsCount = function()
{
return this.Pr.row;
};
CMathMatrix.prototype.getColsCount = function()
{
return this.column;
};
CMathMatrix.prototype.getPropsForWrite = function()
{
var props = {};
props.baseJc = this.Pr.baseJc;
props.row = this.Pr.nRow;
props.column = this.Pr.nCol;
props.plcHide = this.Pr.plcHide;
props.mcs = this.Pr.mcs;
props.cGpRule = this.spaceColumn.rule;
props.cGp = this.spaceColumn.gap;
props.cSp = this.spaceColumn.minGap;
props.rSpRule = this.spaceRow.rule;
props.rSp = this.spaceRow.gap;
return props;
};
CMathMatrix.prototype.Copy = function()
{
var oProps = this.Pr.Copy();
oProps.ctrPrp = this.CtrPrp.Copy();
var NewMatrix = new CMathMatrix(oProps);
this.column = this.Pr.Get_ColumnsCount();
var nRowsCount = this.getRowsCount();
var nColsCount = this.getColsCount();
this.setDimension(nRowsCount, nColsCount);
for(var nRowIndex = 0; nRowIndex < nRowsCount; nRowIndex++)
{
for (var nColIndex = 0; nColIndex < nColsCount; nColIndex++)
{
this.elements[nRowIndex][nColIndex].CopyTo(NewMatrix.elements[nRowIndex][nColIndex], false);
this.elements[nRowIndex][nColIndex] = this.getContentElement(nRowIndex, nColIndex);
}
}
return NewMatrix;
};
CMathMatrix.prototype.Refresh_RecalcData = function(Data)
CMathMatrix.prototype.getRowsCount = function()
{
return this.Pr.row;
};
CMathMatrix.prototype.Write_ToBinary2 = function( Writer )
CMathMatrix.prototype.getColsCount = function()
{
var nRowsCount = this.getRowsCount();
var nColsCount = this.getColsCount();
Writer.WriteLong( historyitem_type_matrix );
// String : Id
// Long : Rows count
// Long : Cols count
// Array[Rows * Cols] of Strings : Id
// Variable : CtrlPr
// Variable : MathPr
Writer.WriteString2(this.Id);
Writer.WriteLong(nRowsCount);
Writer.WriteLong(nColsCount);
for(var nRowIndex = 0; nRowIndex < nRowsCount; nRowIndex++)
{
for (var nColsIndex = 0; nColsIndex < nColsCount; nColsIndex++)
{
Writer.WriteString2(this.getElement(nRowIndex, nColsIndex).Id);
}
}
this.CtrPrp.Write_ToBinary(Writer);
this.Pr.Write_ToBinary(Writer);
return this.column;
};
CMathMatrix.prototype.Read_FromBinary2 = function( Reader )
{
// String : Id
// Long : Rows count
// Long : Cols count
// Array[Rows * Cols] of Strings : Id
// Variable : CtrlPr
// Variable : MathPr
this.Id = Reader.GetString2();
var nRowsCount = Reader.GetLong();
var nColsCount = Reader.GetLong();
this.setDimension(nRowsCount, nColsCount);
this.elements = [];
for (var nRowIndex = 0; nRowIndex < nRowsCount; nRowIndex++)
{
this.elements[nRowIndex] = [];
for (var nColIndex = 0; nColIndex < nColsCount; nColIndex++)
{
this.elements[nRowIndex][nColIndex] = g_oTableId.Get_ById(Reader.GetString2());
}
}
this.CtrPrp.Read_FromBinary(Reader);
this.Pr.Read_FromBinary(Reader);
this.column = this.Pr.Get_ColumnsCount();
};
CMathMatrix.prototype.Get_Id = function()
{
return this.Id;
};
function CMathPoint()
{
......
......@@ -399,10 +399,9 @@ function CRadical(props)
CRadical.superclass.constructor.call(this);
this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_RADICAL;
this.Iterator = new CMathContent();
this.Base = new CMathContent();
this.Iterator = null;
this.Base = null;
this.RealBase = null;
......@@ -420,15 +419,22 @@ function CRadical(props)
g_oTableId.Add( this, this.Id );
}
Asc.extendClass(CRadical, CMathBase);
CRadical.prototype.ClassType = historyitem_type_rad;
CRadical.prototype.kind = MATH_RADICAL;
CRadical.prototype.init = function(props)
{
this.Fill_LogicalContent(2);
this.setProperties(props);
this.fillContent();
}
CRadical.prototype.setProperties = function(props)
CRadical.prototype.fillContent = function()
{
this.Pr.Set_FromObject(props);
this.setCtrPrp(props.ctrPrp);
}
this.Iterator = this.getDegree();
this.Base = this.getBase();
};
CRadical.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
{
this.Parent = Parent;
......@@ -678,56 +684,14 @@ CRadical.prototype.draw = function(x, y, pGraphics)
}
CRadical.prototype.getBase = function()
{
return this.Base;
return this.Content[1];
}
CRadical.prototype.getDegree = function()
{
return this.Iterator;
}
CRadical.prototype.getPropsForWrite = function()
{
return this.Pr;
return this.Content[0];
}
CRadical.prototype.Correct_Content = function(bInnerCorrection)
{
this.Iterator.Correct_Content(bInnerCorrection);
this.Base.Correct_Content(bInnerCorrection);
};
CRadical.prototype.Copy = function()
{
var oProps = this.Pr.Copy();
oProps.ctrPrp = this.CtrPrp.Copy();
var NewRadical = new CRadical(oProps);
this.Base.CopyTo(NewRadical.Base, false);
this.Iterator.CopyTo(NewRadical.Iterator, false);
return NewRadical;
};
CRadical.prototype.Refresh_RecalcData = function(Data)
{
}
CRadical.prototype.Write_ToBinary2 = function( Writer )
{
Writer.WriteLong( historyitem_type_rad );
Writer.WriteString2(this.Id);
Writer.WriteString2(this.getDegree().Id);
Writer.WriteString2(this.getBase().Id);
this.CtrPrp.Write_ToBinary(Writer);
this.Pr.Write_ToBinary(Writer);
}
CRadical.prototype.Read_FromBinary2 = function( Reader )
{
this.Id = Reader.GetString2();
this.Iterator = g_oTableId.Get_ById( Reader.GetString2());
this.Base = g_oTableId.Get_ById( Reader.GetString2());
this.CtrPrp.Read_FromBinary(Reader);
this.Pr.Read_FromBinary(Reader);
}
CRadical.prototype.Get_Id = function()
{
return this.Id;
}
\ No newline at end of file
this.Content[0].Correct_Content(bInnerCorrection);
this.Content[1].Correct_Content(bInnerCorrection);
};
\ No newline at end of file
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