Commit 6e20bf4c authored by Anna.Pavlova's avatar Anna.Pavlova Committed by Alexander.Trofimov

1. Поправлен баги на пересчете GroupCharacter: не прокидывались параметры в...

1. Поправлен баги на пересчете GroupCharacter: не прокидывались параметры в констукторы CNumerator, CDenominator;
для матрицы : если mcs не заполнен (нулевой длины), у матрицы кол-во строк было 0
2. На запись свойств у матрицы дописала свойство mcs
3. Поправила gaps для "=: (забыла включить после последних правок с Gaps)
4. Рефакторинг

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58743 954022d7-b5bf-4e40-9824-e11837661b57
parent f56440b9
......@@ -2,10 +2,7 @@
function CDegreeBase(props, bInside)
{
CDegreeBase.superclass.constructor.call(this);
this.kind = MATH_DEGREE;
this.bInside = bInside;
CDegreeBase.superclass.constructor.call(this, bInside);
this.upBase = 0; // отступ сверху для основания
this.upIter = 0; // отступ сверху для итератора
......@@ -18,6 +15,7 @@ function CDegreeBase(props, bInside)
this.baseContent = null;
this.iterContent = null;
if(props !== null && typeof(props) !== "undefined")
this.init(props);
}
......@@ -29,7 +27,6 @@ CDegreeBase.prototype.init = function(props)
};
CDegreeBase.prototype.fillContent = function()
{
this.setDimension(1, 2);
this.elements[0][0] = this.baseContent;
this.elements[0][1] = this.iterContent;
};
......@@ -192,7 +189,7 @@ CDegreeBase.prototype.getBase = function()
};
CDegreeBase.prototype.IsPlhIterator = function()
{
return this.elements[0][1].IsPlaceholder();
return this.iterContent.IsPlaceholder();
};
CDegreeBase.prototype.setProperties = function(props)
{
......@@ -217,6 +214,7 @@ CDegreeBase.prototype.setIterator = function(iterator)
function CDegree(props, bInside)
{
this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_DEGREE;
CDegree.superclass.constructor.call(this, props, bInside);
......@@ -270,8 +268,7 @@ CDegree.prototype.Get_Id = function()
function CIterators(iterUp, iterDn)
{
CIterators.superclass.constructor.call(this);
this.bInside = true;
CIterators.superclass.constructor.call(this, true);
this.lUp = 0; // центр основания
this.lD = 0; // высота - центр основания
......@@ -314,10 +311,7 @@ CIterators.prototype.alignIterators = function(mcJc)
function CDegreeSubSupBase(props, bInside)
{
CDegreeSubSupBase.superclass.constructor.call(this);
this.kind = MATH_DEGREESubSup;
this.bInside = bInside;
CDegreeSubSupBase.superclass.constructor.call(this, bInside);
this.gapBase = 0;
......@@ -372,16 +366,8 @@ CDegreeSubSupBase.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, A
var ArgSzIters = ArgSize.Copy();
ArgSzIters.decrease();
if(this.Pr.type == DEGREE_SubSup)
{
this.elements[0][0].Resize(oMeasure, this, ParaMath, RPI, ArgSize);
this.elements[0][1].Resize(oMeasure, this, ParaMath, RPI, ArgSzIters);
}
else
{
this.elements[0][1].Resize(oMeasure, this, ParaMath, RPI, ArgSize);
this.elements[0][0].Resize(oMeasure, this, ParaMath, RPI, ArgSzIters);
}
this.baseContent.Resize(oMeasure, this, ParaMath, RPI, ArgSize);
this.iters.Resize(oMeasure, this, ParaMath, RPI, ArgSzIters);
this.recalculateSize(oMeasure, RPI);
};
......@@ -468,10 +454,6 @@ CDegreeSubSupBase.prototype.recalculateSize = function(oMeasure, RPI)
this.size = {width: width, height: height, ascent: ascent};
};
CDegreeSubSupBase.prototype.setPosition = function(pos, PosInfo)
{
CDegreeSubSupBase.superclass.setPosition.call(this, pos, PosInfo);
};
CDegreeSubSupBase.prototype.align = function(x, y)
{
var _x = 0, _y = 0;
......@@ -531,6 +513,7 @@ CDegreeSubSupBase.prototype.setProperties = function(props)
function CDegreeSubSup(props, bInside)
{
this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_DEGREESubSup;
CDegreeSubSup.superclass.constructor.call(this, props, bInside);
......
......@@ -457,9 +457,9 @@ CFraction.prototype.Get_Id = function()
return this.Id;
}
function CFractionBase()
function CFractionBase(bInside)
{
CFractionBase.superclass.constructor.call(this);
CFractionBase.superclass.constructor.call(this, bInside);
this.gap = 0;
this.init();
}
......@@ -501,7 +501,7 @@ CFractionBase.prototype.Get_Id = function()
function CNumerator()
{
CNumerator.superclass.constructor.call(this);
CNumerator.superclass.constructor.call(this, true);
}
Asc.extendClass(CNumerator, CFractionBase);
CNumerator.prototype.recalculateSize = function()
......@@ -553,7 +553,7 @@ CNumerator.prototype.setPosition = function(pos, PosInfo)
function CDenominator()
{
CDenominator.superclass.constructor.call(this);
CDenominator.superclass.constructor.call(this, true);
}
Asc.extendClass(CDenominator, CFractionBase);
CDenominator.prototype.recalculateSize = function()
......
......@@ -56,7 +56,6 @@ CRPI.prototype.Copy = function()
return RPI;
}
function CMathPointInfo()
{
this.x = 0;
......@@ -214,7 +213,6 @@ AmperWidths.prototype.SetDefault = function()
}
function CGaps(oSign, oEqual, oZeroOper, oLett)
{
this.sign = oSign;
......@@ -299,7 +297,7 @@ CCoeffGaps.prototype =
var COMPARE = code == 0x3C || code == 0x3E; // LESS, GREATER
var ARROWS = (code >= 0x2190 && code <= 0x21B3) || (code == 0x21B6) || (code == 0x21B7) || (code >= 0x21BA && code <= 0x21E9) || (code >=0x21F4 && code <= 0x21FF);
var INTERSECTION = code >= 0x2223 && code <= 0x222A;
var EQUALS = (code >= 0x2234 && code <= 0x22BD) || (code >= 0x22C4 && code <= 0x22FF);
var EQUALS = code == 0x3D || (code >= 0x2234 && code <= 0x22BD) || (code >= 0x22C4 && code <= 0x22FF);
var ARR_FISHES = (code >= 0x27DA && code <= 0x27E5) || (code >= 0x27EC && code <= 0x297F);
var TRIANGLE_SYMB = code >= 0x29CE && code <= 0x29D7;
var OTH_SYMB = code == 0x29DF || (code >= 0x29E1 && code <= 0x29E7) || (code >= 0x29F4 && code <= 0x29F8) || (code >= 0x2A22 && code <= 0x2AF0) || (code >= 0x2AF2 && code <= 0x2AFB) || code == 0x2AFD || code == 0x2AFE;
......
......@@ -180,6 +180,8 @@ CMatrixBase.prototype.recalculateSize = function(oMeasure, RPI)
{
this.setRuleGap(this.spaceColumn, this.Pr.cGpRule, this.Pr.cGp, this.Pr.cSp);
// выставим выравнивание для столбцов
var lng = this.Pr.mcs.length;
var col = 0;
......@@ -585,9 +587,11 @@ CMathMatrix.prototype.setColumnGapRule = function(rule, gap, minGap)
CMathMatrix.prototype.setProperties = function(props)
{
this.setCtrPrp(props.ctrPrp);
this.Pr.Set_FromObject(props);
this.column = this.Pr.Set_FromObject(props);
this.column = this.Pr.Get_ColumnsCount();
if(props.mcs.length == 0)
this.column = props.column;
//this.column = this.Pr.Get_ColumnsCount();
};
CMathMatrix.prototype.fillContent = function()
{
......@@ -610,6 +614,7 @@ CMathMatrix.prototype.getPropsForWrite = function()
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;
......
......@@ -3869,7 +3869,6 @@ CMathGroupChrPr.prototype.Set_FromObject = function(Obj)
if(LOCATION_TOP === Obj.pos || LOCATION_BOT === Obj.pos)
this.pos = Obj.pos;
};
CMathGroupChrPr.prototype.Write_ToBinary = function(Writer)
{
// Long : chr
......@@ -3882,7 +3881,6 @@ CMathGroupChrPr.prototype.Write_ToBinary = function(Writer)
Writer.WriteLong(this.vertJc);
Writer.WriteLong(this.pos);
};
CMathGroupChrPr.prototype.Read_FromBinary = function(Reader)
{
// Long : chr
......
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