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);
......
This diff is collapsed.
This diff is collapsed.
......@@ -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