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

Поля со свойствами у Accent, BorderBox, Bar, Box, Degree, DegreeSubSup,...

Поля со свойствами у Accent, BorderBox, Bar, Box, Degree, DegreeSubSup, Fraction строго по документации


git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56281 954022d7-b5bf-4e40-9824-e11837661b57
parent 6da8f013
......@@ -785,14 +785,14 @@ ParaMath.prototype =
if(argSize == -1)
{
FSize = 0.0009*FSize*FSize + 0.68*FSize + 0.26;
//FSize = 0.65*FSize;
//FSize = 0.0009*FSize*FSize + 0.68*FSize + 0.26;
FSize = 0.65*FSize;
}
else if(argSize == -2)
{
FSize = -0.0004*FSize*FSize + 0.66*FSize + 0.87;
//FSize = 0.65*FSize*FSize;
//FSize = -0.0004*FSize*FSize + 0.66*FSize + 0.87;
FSize = 0.65*0.65*FSize;
}
tPrp.FontSize = FSize;
......
......@@ -1006,9 +1006,18 @@ function CAccent(props)
this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_ACCENT;
this.chr = null;
//// Properties
this.Pr =
{
chr: null,
chrType: null
};
/*this.chr = null;
this.chrType = null;
this.loc = LOCATION_TOP;
this.loc = LOCATION_TOP;*/
/////////////////
this.operator = new COperator(OPER_ACCENT);
......@@ -1019,17 +1028,13 @@ function CAccent(props)
this.init(props);
if(props.ctrPrp !== null && typeof(props.ctrPrp) !== "undefined")
this.setCtrPrp(props.ctrPrp);
g_oTableId.Add( this, this.Id );
}
extend(CAccent, CMathBase);
CAccent.prototype.init = function(props)
{
this.chr = props.chr;
this.chrType = props.chrType;
this.Pr.chr = props.chr;
this.Pr.chrType = props.chrType;
//this.operator.init(prp, defaultPrp);
//this.operator.relate(this);
......@@ -1038,17 +1043,20 @@ CAccent.prototype.init = function(props)
this.setContent();
this.elements[0][0].SetDot(true);
if(props.ctrPrp !== null && typeof(props.ctrPrp) !== "undefined")
this.setCtrPrp(props.ctrPrp);
}
CAccent.prototype.setChr = function(chr)
{
this.chr = chr;
this.chrType = null;
this.Pr.chr = chr;
this.Pr.chrType = null;
this.RecalcInfo.bProps = true;
}
CAccent.prototype.setChrType = function(chrType)
{
this.chr = null;
this.chrType = chrType;
this.Pr.chr = null;
this.Pr.chrType = chrType;
this.RecalcInfo.bProps = true;
}
CAccent.prototype.old_init = function(properties)
......@@ -1596,14 +1604,7 @@ CAccent.prototype.setPosition = function(pos)
}
CAccent.prototype.getAscent = function()
{
var ascent;
if(this.loc === LOCATION_TOP )
ascent = this.operator.size.height + this.elements[0][0].size.ascent;
else if(this.loc === LOCATION_BOT )
ascent = this.elements[0][0].size.ascent;
return ascent;
return this.operator.size.height + this.elements[0][0].size.ascent;
}
CAccent.prototype.getPropsForWrite = function()
{
......@@ -1627,8 +1628,8 @@ CAccent.prototype.Resize = function(Parent, ParaMath, oMeasure)
{
var prp =
{
type: this.chrType,
chr: this.chr,
type: this.Pr.chrType,
chr: this.Pr.chr,
loc: LOCATION_TOP
};
......@@ -1637,13 +1638,14 @@ CAccent.prototype.Resize = function(Parent, ParaMath, oMeasure)
type: ACCENT_CIRCUMFLEX
};
this.operator.init(prp, defaultPrp);
this.operator.relate(this);
this.operator.setProperties(prp, defaultPrp);
this.chr = String.fromCharCode(this.operator.code);
this.chrType = this.operator.typeOper;
}
this.operator.relate(this);
var base = this.elements[0][0];
base.Resize(this, ParaMath, oMeasure);
......
......@@ -5,39 +5,39 @@ function CBorderBox(props)
this.gapBrd = 0;
this.bLeft = true;
/*this.bLeft = true;
this.bRight = true;
this.bTop = true;
this.bBot = true;
/*this.bLeft = false;
this.bRight = false;
this.bTop = true;
this.bBot = false;*/
this.bLDiag = false;
this.bRDiag = false;
this.bHor = false;
this.bVert = false;
/*this.bLDiag = true;
this.bRDiag = true;*/
/*this.bHor = true;
this.bVert = true;*/
this.bVert = false;*/
this.Pr =
{
hideLeft: false,
hideRight: false,
hideTop: false,
hideBot: false,
strikeBLTR: true,
strikeTLBR: true,
strikeH: true,
strikeV: true
};
CMathBase.call(this);
this.init(props);
this.setCtrPrp(props.ctrPrp);
g_oTableId.Add( this, this.Id );
g_oTableId.Add(this, this.Id);
}
extend(CBorderBox, CMathBase);
CBorderBox.prototype.init = function(props)
{
if(typeof(props) !== "undefined" && props !== null)
/*if(typeof(props) !== "undefined" && props !== null)
{
if(props.hideLeft === true || props.hideLeft === 1)
this.bLeft = false;
......@@ -59,13 +59,42 @@ CBorderBox.prototype.init = function(props)
if(props.strikeV === true || props.strikeV === 1)
this.bVert = true;
}
}*/
this.setDimension(1, 1);
this.setBorders(props);
this.setDimension(1, 1);
this.setContent();
}
CBorderBox.prototype.setBorders = function(props)
{
if(typeof(props) !== "undefined" && props !== null)
{
if(typeof(this.Pr.hideLeft) !== "undefined" && this.Pr.hideLeft !== null)
this.Pr.hideLeft = props.hideLeft;
if(typeof(this.Pr.hideRight) !== "undefined" && this.Pr.hideRight !== null)
this.Pr.hideRight = props.hideRight;
if(typeof(this.Pr.hideTop) !== "undefined" && this.Pr.hideTop !== null)
this.Pr.hideTop = props.hideTop;
if(typeof(this.Pr.hideBot) !== "undefined" && this.Pr.hideBot !== null)
this.Pr.hideBot = props.hideBot;
if(typeof(this.Pr.strikeBLTR) !== "undefined" && this.Pr.strikeBLTR !== null) // right diagonal
this.Pr.strikeBLTR = props.strikeBLTR;
if(typeof(this.Pr.strikeTLBR) !== "undefined" && this.Pr.strikeTLBR !== null) // left diagonal
this.Pr.strikeTLBR = props.strikeTLBR;
if(typeof(this.Pr.strikeH) !== "undefined" && this.Pr.strikeH !== null)
this.Pr.strikeH = props.strikeH;
/// вызов этой функции обязательно в конце
//this.WriteContentsToHistory();
if(typeof(this.Pr.strikeV) !== "undefined" && this.Pr.strikeV !== null)
this.Pr.strikeV = props.strikeV;
}
this.RecalcInfo.bProps = true;
}
CBorderBox.prototype.recalculateSize = function()
{
......@@ -77,17 +106,17 @@ CBorderBox.prototype.recalculateSize = function()
this.gapBrd = this.Get_CompiledCtrPrp().FontSize*0.08104587131076388;
if(this.bTop)
if(this.Pr.hideTop == false)
{
height += this.gapBrd;
ascent += this.gapBrd;
}
if(this.bBot)
if(this.Pr.hideBot == false)
height += this.gapBrd;
if(this.bLeft)
if(this.Pr.hideLeft == false)
width += this.gapBrd;
if(this.bRight)
if(this.Pr.hideRight == false)
width += this.gapBrd;
width += this.GapLeft + this.GapRight;
......@@ -100,7 +129,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
//var penW = this.Get_CompiledCtrPrp().FontSize* 25.4/72 * 0.06 ;
var penW = this.Get_CompiledCtrPrp().FontSize*0.02;
if(this.bTop)
if(this.Pr.hideTop == false)
{
var x1 = this.pos.x + x,
x2 = this.pos.x + x + this.size.width - penW/2,
......@@ -116,7 +145,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
pGraphics.drawHorLine(0, y1 + penW, x1 + 2*25.4/96, x2 , 25.4/96);*/
}
if(this.bBot)
if(this.Pr.hideBot == false)
{
var x1 = this.pos.x + x,
x2 = this.pos.x + x + this.size.width - penW/2,
......@@ -126,7 +155,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
pGraphics.drawHorLine(0, y1, x1, x2, penW);
}
if(this.bLeft)
if(this.Pr.hideLeft == false)
{
var x1 = this.pos.x + x,
y1 = this.pos.y + y,
......@@ -136,7 +165,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
pGraphics.drawVerLine(0, x1, y1, y2, penW);
}
if(this.bRight)
if(this.Pr.hideRight == false)
{
var x1 = this.pos.x + x + this.size.width - penW/2,
y1 = this.pos.y + y,
......@@ -146,7 +175,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
pGraphics.drawVerLine(0, x1, y1, y2, penW);
}
if(this.bLDiag)
if(this.Pr.strikeTLBR) // left diagonal
{
var pW = penW*0.8;
var x1 = this.pos.x + x , y1 = this.pos.y + y,
......@@ -172,7 +201,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
}
if(this.bRDiag)
if(this.Pr.strikeBLTR) // right diagonal
{
var pW = penW*0.8;
var x1 = this.pos.x + x + this.size.width - pW - penW, y1 = this.pos.y + y,
......@@ -225,9 +254,9 @@ CBorderBox.prototype.setPosition = function(pos)
var x = this.pos.x + this.GapLeft, y = this.pos.y;
if(this.bLeft)
if(this.Pr.hideLeft == false)
x += this.gapBrd;
if(this.bTop)
if(this.Pr.hideTop == false)
y += this.gapBrd;
this.elements[0][0].setPosition({x : x, y: y});
......@@ -240,9 +269,9 @@ CBorderBox.prototype.findDisposition = function(mCoord)
var shX = 0, shY = 0;
if(this.bLeft)
if(this.Pr.hideLeft == false)
shX = this.gapBrd;
if(this.bTop)
if(this.Pr.hideTop == false)
shY = this.gapBrd;
var sCont = this.elements[0][0].size;
......@@ -290,7 +319,7 @@ CBorderBox.prototype.getBase = function()
}
CBorderBox.prototype.getPropsForWrite = function()
{
var props = {};
/*var props = {};
props.hideLeft = !this.bLeft;
props.hideRight = !this.bRight;
......@@ -302,7 +331,9 @@ CBorderBox.prototype.getPropsForWrite = function()
props.strikeH = this.bHor;
props.strikeV = this.bVert;
return props;
return props;*/
return this.Pr;
}
CBorderBox.prototype.Save_Changes = function(Data, Writer)
{
......@@ -414,7 +445,7 @@ function CBox(props)
CMathBase.call(this);
this.init(props);
this.setCtrPrp(props.ctrPrp);
g_oTableId.Add( this, this.Id );
}
extend(CBox, CMathBase);
......@@ -441,8 +472,8 @@ CBox.prototype.init = function(props)
if(this.opEmu)
this.elements[0][0].decreaseArgSize();
/// вызов этой функции обязательно в конце
//this.WriteContentsToHistory();
if(props.ctrPrp !== null && typeof(props.ctrPrp) !== "undefined")
this.setCtrPrp(props.ctrPrp);
}
CBox.prototype.getBase = function()
{
......@@ -541,69 +572,76 @@ function CBar(props)
this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_BAR;
this.loc = LOCATION_BOT;
this.Pr =
{
pos: LOCATION_BOT
};
//this.loc = LOCATION_BOT;
this.operator = new COperator(OPER_BAR);
CCharacter.call(this);
this.init(props);
this.setCtrPrp(props.ctrPrp);
g_oTableId.Add( this, this.Id );
}
extend(CBar, CCharacter);
CBar.prototype.init = function(props)
{
if(props.pos === LOCATION_TOP || props.location === LOCATION_TOP)
this.loc = LOCATION_TOP;
this.Pr.pos = LOCATION_TOP;
else if(props.pos === LOCATION_BOT || props.location === LOCATION_BOT)
this.loc = LOCATION_BOT;
this.Pr.pos = LOCATION_BOT;
/*var glyph = new COperatorLine();
var props =
{
location: this.loc,
turn: TURN_0
};
glyph.init(props);
this.setOperator( new COperator(glyph) );*/
var props =
if(props.ctrPrp !== null && typeof(props.ctrPrp) !== "undefined")
this.setCtrPrp(props.ctrPrp);
}
CBar.prototype.setLocation = function(pos)
{
this.Pr.pos = pos;
this.RecalcInfo.bProps = true;
}
CBar.prototype.Resize = function()
{
if(this.RecalcInfo.bCtrPrp == true)
{
location: this.loc,
type: DELIMITER_LINE
};
this.Set_CompiledCtrPrp();
this.RecalcInfo.bCtrPrp = false;
}
var defaultProps =
if(this.RecalcInfo.bProps == true)
{
loc: LOCATION_BOT
};
var prp =
{
loc: this.Pr.pos,
type: DELIMITER_LINE
};
this.setCharacter(props, defaultProps);
var defaultProps =
{
loc: LOCATION_BOT
};
this.setCharacter(prp, defaultProps);
}
/// вызов этой функции обязательно в конце
//this.WriteContentsToHistory();
CBar.superclass.Resize.call(this);
}
CBar.prototype.getAscent = function()
{
var ascent;
if(this.loc === LOCATION_TOP )
if(this.Pr.pos === LOCATION_TOP )
ascent = this.operator.size.height + this.elements[0][0].size.ascent;
else if(this.loc === LOCATION_BOT )
else if(this.Pr.pos === LOCATION_BOT )
ascent = this.elements[0][0].size.ascent;
return ascent;
}
CBar.prototype.getPropsForWrite = function()
{
var props =
{
pos: this.loc
};
return props;
return this.Pr;
}
CBar.prototype.Save_Changes = function(Data, Writer)
{
......@@ -669,9 +707,6 @@ CPhantom.prototype.init = function(props)
this.props = props;
this.setDimension(1, 1);
this.setContent();
/// вызов этой функции обязательно в конце
//this.WriteContentsToHistory();
}
CPhantom.prototype.getPropsForWrite = function()
{
......
......@@ -3,10 +3,15 @@ function CDegree(props)
this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_DEGREE;
this.type = DEGREE_SUPERSCRIPT ;
//this.type = DEGREE_SUPERSCRIPT;
this.upBase = 0; // отступ сверху для основания
this.upIter = 0; // отступ сверху для итератора
this.alnScr = false; // не выровнены, итераторы идут в соответствии с наклоном буквы/мат. объекта
//this.alnScr = false; // не выровнены, итераторы идут в соответствии с наклоном буквы/мат. объекта
this.Pr =
{
type: DEGREE_SUPERSCRIPT
};
CMathBase.call(this);
......@@ -17,10 +22,10 @@ function CDegree(props)
extend(CDegree, CMathBase);
CDegree.prototype.init = function(props)
{
if(props.alnScr === true || props.alnScr === 1)
/*if(props.alnScr === true || props.alnScr === 1)
this.alnScr = true;
else if(props.alnScr === false || props.alnScr === 0)
this.alnScr = false;
this.alnScr = false;*/
var oBase = new CMathContent();
......@@ -28,9 +33,9 @@ CDegree.prototype.init = function(props)
oBase = props.oBase;
if(props.type === DEGREE_SUPERSCRIPT)
this.type = DEGREE_SUPERSCRIPT;
this.Pr.type = DEGREE_SUPERSCRIPT;
else if(props.type === DEGREE_SUBSCRIPT)
this.type = DEGREE_SUBSCRIPT;
this.Pr.type = DEGREE_SUBSCRIPT;
this.setDimension(1, 2);
......@@ -38,9 +43,6 @@ CDegree.prototype.init = function(props)
oDegree.decreaseArgSize();
this.addMCToContent(oBase, oDegree);
/// вызов этой функции обязательно в конце
//this.WriteContentsToHistory();
}
/*CDegree.prototype.init_2 = function(props, oBase)
{
......@@ -58,9 +60,9 @@ CDegree.prototype.init = function(props)
}*/
CDegree.prototype.recalculateSize = function(oMeasure)
{
if(this.type === DEGREE_SUPERSCRIPT)
if(this.Pr.type === DEGREE_SUPERSCRIPT)
this.recalculateSup(oMeasure);
else if(this.type === DEGREE_SUBSCRIPT)
else if(this.Pr.type === DEGREE_SUBSCRIPT)
this.recalculateSubScript(oMeasure);
}
CDegree.prototype.old__recalculateSup = function(oMeasure)
......@@ -473,14 +475,18 @@ CDegree.prototype.getBase = function()
{
return this.elements[0][0];
}
CDegree.prototype.getPropsForWrite = function()
/*CDegree.prototype.getPropsForWrite = function()
{
var props = {};
props.type = this.type;
props.alnScr = this.alnScr;
//props.alnScr = this.alnScr;
return props;
}*/
CDegree.prototype.getPropsForWrite = function()
{
return this.Pr;
}
CDegree.prototype.IsPlhIterator = function()
{
......@@ -503,7 +509,7 @@ CDegree.prototype.Write_ToBinary2 = function( Writer )
Writer.WriteString2( this.elements[0][1].Id );
this.CtrPrp.Write_ToBinary(Writer);
Writer.WriteLong( this.type );
Writer.WriteLong( this.Pr.type );
}
CDegree.prototype.Read_FromBinary2 = function( Reader )
......@@ -517,7 +523,7 @@ CDegree.prototype.Read_FromBinary2 = function( Reader )
this.elements[0][1] = Element1;
this.CtrPrp.Read_FromBinary(Reader);
this.type = Reader.GetLong();
this.Pr.type = Reader.GetLong();
}
CDegree.prototype.Get_Id = function()
{
......@@ -694,8 +700,16 @@ function CDegreeSubSup(props)
this.kind = MATH_DEGREESubSup;
this.gapBase = 0;
this.type = DEGREE_SubSup;
this.alnScr = false; // не выровнены, итераторы идут в соответствии с наклоном буквы/мат. объекта
this.Pr =
{
type: DEGREE_SubSup,
alnScr: false
};
//this.type = DEGREE_SubSup;
//this.alnScr = false; // не выровнены, итераторы идут в соответствии с наклоном буквы/мат. объекта
CMathBase.call(this);
this.init(props);
......@@ -706,19 +720,17 @@ extend(CDegreeSubSup, CMathBase);
CDegreeSubSup.prototype.init = function(props)
{
if(props.alnScr === true || props.alnScr === 1)
this.alnScr = true;
this.Pr.alnScr = true;
else if(props.alnScr === false || props.alnScr === 0)
this.alnScr = false;
this.Pr.alnScr = false;
var oBase = new CMathContent();
if(props.indef == 2) /// props include Base for CNary
oBase = props.oBase;
if(props.type === DEGREE_SubSup)
this.type = DEGREE_SubSup;
else if(props.type === DEGREE_PreSubSup)
this.type = DEGREE_PreSubSup;
if(props.type === DEGREE_SubSup || props.type === DEGREE_PreSubSup)
this.Pr.type = props.type;
this.setDimension(1, 2);
......@@ -730,12 +742,12 @@ CDegreeSubSup.prototype.init = function(props)
oIters.lUp = 0;
oIters.lD = 0;
if(this.type == DEGREE_SubSup)
if(this.Pr.type == DEGREE_SubSup)
{
oIters.alignHor(-1, 0);
this.addMCToContent(oBase, oIters);
}
else if(this.type == DEGREE_PreSubSup)
else if(this.Pr.type == DEGREE_PreSubSup)
{
oIters.alignHor(-1, 1);
this.addMCToContent(oIters, oBase);
......@@ -787,12 +799,12 @@ CDegreeSubSup.prototype.old_old_recalculateSize = function(oMeasure)
var iters, base;
if(this.type == DEGREE_SubSup)
if(this.Pr.type == DEGREE_SubSup)
{
iters = this.elements[0][1];
base = this.elements[0][0];
}
else if(this.type == DEGREE_PreSubSup)
else if(this.Pr.type == DEGREE_PreSubSup)
{
iters = this.elements[0][0];
base = this.elements[0][1];
......@@ -830,12 +842,12 @@ CDegreeSubSup.prototype.old_recalculateSize = function(oMeasure)
var iters, base;
if(this.type == DEGREE_SubSup)
if(this.Pr.type == DEGREE_SubSup)
{
iters = this.elements[0][1];
base = this.elements[0][0];
}
else if(this.type == DEGREE_PreSubSup)
else if(this.Pr.type == DEGREE_PreSubSup)
{
iters = this.elements[0][0];
base = this.elements[0][1];
......@@ -911,12 +923,12 @@ CDegreeSubSup.prototype._recalculateSize = function(oMeasure)
var iters, base;
if(this.type == DEGREE_SubSup)
if(this.Pr.type == DEGREE_SubSup)
{
iters = this.elements[0][1];
base = this.elements[0][0];
}
else if(this.type == DEGREE_PreSubSup)
else if(this.Pr.type == DEGREE_PreSubSup)
{
iters = this.elements[0][0];
base = this.elements[0][1];
......@@ -1022,12 +1034,12 @@ CDegreeSubSup.prototype.recalculateSize = function(oMeasure)
var iters, base;
if(this.type == DEGREE_SubSup)
if(this.Pr.type == DEGREE_SubSup)
{
iters = this.elements[0][1];
base = this.elements[0][0];
}
else if(this.type == DEGREE_PreSubSup)
else if(this.Pr.type == DEGREE_PreSubSup)
{
iters = this.elements[0][0];
base = this.elements[0][1];
......@@ -1089,7 +1101,7 @@ CDegreeSubSup.prototype.old_setPosition = function(pos)
{
this.pos = {x: pos.x, y: pos.y - this.size.ascent};
if(this.type == DEGREE_SubSup)
if(this.Pr.type == DEGREE_SubSup)
{
var iters = this.elements[0][1],
base = this.elements[0][0];
......@@ -1105,7 +1117,7 @@ CDegreeSubSup.prototype.old_align = function(x, y)
{
var _x = 0, _y = 0;
if(this.type == DEGREE_SubSup)
if(this.Pr.type == DEGREE_SubSup)
{
if(x == 0 && y == 0)
_y = this.elements[0][1].upper;
......@@ -1122,7 +1134,7 @@ CDegreeSubSup.prototype.align = function(x, y)
{
var _x = 0, _y = 0;
if(this.type == DEGREE_SubSup)
if(this.Pr.type == DEGREE_SubSup)
{
if(x == 0 && y == 0)
_y = this.gapBase;
......@@ -1139,9 +1151,9 @@ CDegreeSubSup.prototype.getBase = function()
{
var base;
if(this.type == DEGREE_SubSup)
if(this.Pr.type == DEGREE_SubSup)
base = this.elements[0][0];
else if(this.type == DEGREE_PreSubSup)
else if(this.Pr.type == DEGREE_PreSubSup)
base = this.elements[0][1];
return base;
......@@ -1150,9 +1162,9 @@ CDegreeSubSup.prototype.getUpperIterator = function()
{
var iter;
if(this.type == DEGREE_SubSup)
if(this.Pr.type == DEGREE_SubSup)
iter = this.elements[0][1].getUpperIterator();
else if(this.type == DEGREE_PreSubSup)
else if(this.Pr.type == DEGREE_PreSubSup)
iter = this.elements[0][0].getUpperIterator();
return iter;
......@@ -1161,21 +1173,23 @@ CDegreeSubSup.prototype.getLowerIterator = function()
{
var iter;
if(this.type == DEGREE_SubSup)
if(this.Pr.type == DEGREE_SubSup)
iter = this.elements[0][1].getLowerIterator();
else if(this.type == DEGREE_PreSubSup)
else if(this.Pr.type == DEGREE_PreSubSup)
iter = this.elements[0][0].getLowerIterator();
return iter;
}
CDegreeSubSup.prototype.getPropsForWrite = function()
{
var props = {};
/*var props = {};
props.type = this.type;
props.alnScr = this.alnScr;
return props;
return props;*/
return this.Pr;
}
CDegreeSubSup.prototype.Save_Changes = function(Data, Writer)
{
......@@ -1194,8 +1208,8 @@ CDegreeSubSup.prototype.Write_ToBinary2 = function( Writer )
Writer.WriteString2( this.elements[0][1].Id );
this.CtrPrp.Write_ToBinary(Writer);
Writer.WriteLong( this.type );
if ( this.type == DEGREE_SubSup )
Writer.WriteLong( this.Pr.type );
if ( this.Pr.type == DEGREE_SubSup )
{
var StartPos = Writer.GetCurPosition();
Writer.Skip(4);
......@@ -1222,8 +1236,8 @@ CDegreeSubSup.prototype.Read_FromBinary2 = function( Reader )
this.elements[0][1] = Element1;
this.CtrPrp.Read_FromBinary(Reader);
this.type = Reader.GetLong();
if ( this.type == DEGREE_SubSup )
this.Pr.type = Reader.GetLong();
if ( this.Pr.type == DEGREE_SubSup )
{
var Flags = Reader.GetLong();
if ( Flags & 1 )
......
......@@ -9,19 +9,26 @@ function CFraction(props)
CMathBase.call(this);
this.init(props);
this.setCtrPrp(props.ctrPrp);
g_oTableId.Add( this, this.Id );
}
extend(CFraction, CMathBase);
CFraction.prototype.init = function(props)
{
var bValid = typeof(props.type) !== "undefined" && props.type !== null;
this.setType(props.type);
if(props.ctrPrp !== null && typeof(props.ctrPrp) !== "undefined")
this.setCtrPrp(props.ctrPrp);
}
CFraction.prototype.setType = function(type)
{
var bValid = typeof(type) !== "undefined" && type !== null;
if(bValid)
{
var bBar = props.type === BAR_FRACTION || props.type === NO_BAR_FRACTION,
bSkew = props.type === SKEWED_FRACTION,
bLin = props.type === LINEAR_FRACTION;
var bBar = type === BAR_FRACTION || type === NO_BAR_FRACTION,
bSkew = type === SKEWED_FRACTION,
bLin = type === LINEAR_FRACTION;
if(bBar || bSkew || bLin) // на всякий случай
this.type = props.type;
......@@ -30,10 +37,8 @@ CFraction.prototype.init = function(props)
if(this.type == BAR_FRACTION || this.type == NO_BAR_FRACTION)
{
var num = new CNumerator();
//num.init();
var den = new CDenominator();
//den.init();
this.setDimension(2, 1);
......@@ -52,9 +57,6 @@ CFraction.prototype.init = function(props)
this.setDimension(1, 2);
this.setContent();
}
/// вызов этой функции обязательно в конце
// this.WriteContentsToHistory();
}
CFraction.prototype.getType = function()
{
......
......@@ -2264,7 +2264,7 @@ function COperator(type)
this.shiftAccent = 0;
}
COperator.prototype.init = function(properties, defaultProps) // props (chr, type, location), defaultProps (chr, location)
COperator.prototype.setProperties = function(properties, defaultProps) // props (chr, type, location), defaultProps (chr, location)
{
var props = this.getProps(properties, defaultProps);
......@@ -3330,7 +3330,7 @@ CDelimiter.prototype.init = function(props)
{
type: PARENTHESIS_LEFT
};
this.begOper.init(begPrp, begDefaultPrp);
this.begOper.setProperties(begPrp, begDefaultPrp);
this.begOper.relate(this);
var endPrp =
......@@ -3344,7 +3344,7 @@ CDelimiter.prototype.init = function(props)
type: PARENTHESIS_RIGHT
};
this.endOper.init(endPrp, endDefaultPrp);
this.endOper.setProperties(endPrp, endDefaultPrp);
this.endOper.relate(this);
var sepPrp =
......@@ -3361,7 +3361,7 @@ CDelimiter.prototype.init = function(props)
if(props.column == 1 )
sepPrp.type = OPERATOR_EMPTY;
this.sepOper.init(sepPrp, sepDefaultPrp);
this.sepOper.setProperties(sepPrp, sepDefaultPrp);
this.sepOper.relate(this);
if(props.shape == DELIMITER_SHAPE_MATH || props.shp == DELIMITER_SHAPE_MATH)
......
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