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 = ...@@ -785,14 +785,14 @@ ParaMath.prototype =
if(argSize == -1) if(argSize == -1)
{ {
FSize = 0.0009*FSize*FSize + 0.68*FSize + 0.26; //FSize = 0.0009*FSize*FSize + 0.68*FSize + 0.26;
//FSize = 0.65*FSize; FSize = 0.65*FSize;
} }
else if(argSize == -2) else if(argSize == -2)
{ {
FSize = -0.0004*FSize*FSize + 0.66*FSize + 0.87; //FSize = -0.0004*FSize*FSize + 0.66*FSize + 0.87;
//FSize = 0.65*FSize*FSize; FSize = 0.65*0.65*FSize;
} }
tPrp.FontSize = FSize; tPrp.FontSize = FSize;
......
...@@ -1006,9 +1006,18 @@ function CAccent(props) ...@@ -1006,9 +1006,18 @@ function CAccent(props)
this.Id = g_oIdCounter.Get_NewId(); this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_ACCENT; this.kind = MATH_ACCENT;
this.chr = null; //// Properties
this.Pr =
{
chr: null,
chrType: null
};
/*this.chr = null;
this.chrType = null; this.chrType = null;
this.loc = LOCATION_TOP; this.loc = LOCATION_TOP;*/
/////////////////
this.operator = new COperator(OPER_ACCENT); this.operator = new COperator(OPER_ACCENT);
...@@ -1019,17 +1028,13 @@ function CAccent(props) ...@@ -1019,17 +1028,13 @@ function CAccent(props)
this.init(props); this.init(props);
if(props.ctrPrp !== null && typeof(props.ctrPrp) !== "undefined")
this.setCtrPrp(props.ctrPrp);
g_oTableId.Add( this, this.Id ); g_oTableId.Add( this, this.Id );
} }
extend(CAccent, CMathBase); extend(CAccent, CMathBase);
CAccent.prototype.init = function(props) CAccent.prototype.init = function(props)
{ {
this.chr = props.chr; this.Pr.chr = props.chr;
this.chrType = props.chrType; this.Pr.chrType = props.chrType;
//this.operator.init(prp, defaultPrp); //this.operator.init(prp, defaultPrp);
//this.operator.relate(this); //this.operator.relate(this);
...@@ -1038,17 +1043,20 @@ CAccent.prototype.init = function(props) ...@@ -1038,17 +1043,20 @@ CAccent.prototype.init = function(props)
this.setContent(); this.setContent();
this.elements[0][0].SetDot(true); this.elements[0][0].SetDot(true);
if(props.ctrPrp !== null && typeof(props.ctrPrp) !== "undefined")
this.setCtrPrp(props.ctrPrp);
} }
CAccent.prototype.setChr = function(chr) CAccent.prototype.setChr = function(chr)
{ {
this.chr = chr; this.Pr.chr = chr;
this.chrType = null; this.Pr.chrType = null;
this.RecalcInfo.bProps = true; this.RecalcInfo.bProps = true;
} }
CAccent.prototype.setChrType = function(chrType) CAccent.prototype.setChrType = function(chrType)
{ {
this.chr = null; this.Pr.chr = null;
this.chrType = chrType; this.Pr.chrType = chrType;
this.RecalcInfo.bProps = true; this.RecalcInfo.bProps = true;
} }
CAccent.prototype.old_init = function(properties) CAccent.prototype.old_init = function(properties)
...@@ -1596,14 +1604,7 @@ CAccent.prototype.setPosition = function(pos) ...@@ -1596,14 +1604,7 @@ CAccent.prototype.setPosition = function(pos)
} }
CAccent.prototype.getAscent = function() CAccent.prototype.getAscent = function()
{ {
var ascent; return this.operator.size.height + this.elements[0][0].size.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;
} }
CAccent.prototype.getPropsForWrite = function() CAccent.prototype.getPropsForWrite = function()
{ {
...@@ -1627,8 +1628,8 @@ CAccent.prototype.Resize = function(Parent, ParaMath, oMeasure) ...@@ -1627,8 +1628,8 @@ CAccent.prototype.Resize = function(Parent, ParaMath, oMeasure)
{ {
var prp = var prp =
{ {
type: this.chrType, type: this.Pr.chrType,
chr: this.chr, chr: this.Pr.chr,
loc: LOCATION_TOP loc: LOCATION_TOP
}; };
...@@ -1637,13 +1638,14 @@ CAccent.prototype.Resize = function(Parent, ParaMath, oMeasure) ...@@ -1637,13 +1638,14 @@ CAccent.prototype.Resize = function(Parent, ParaMath, oMeasure)
type: ACCENT_CIRCUMFLEX type: ACCENT_CIRCUMFLEX
}; };
this.operator.init(prp, defaultPrp); this.operator.setProperties(prp, defaultPrp);
this.operator.relate(this);
this.chr = String.fromCharCode(this.operator.code); this.chr = String.fromCharCode(this.operator.code);
this.chrType = this.operator.typeOper; this.chrType = this.operator.typeOper;
} }
this.operator.relate(this);
var base = this.elements[0][0]; var base = this.elements[0][0];
base.Resize(this, ParaMath, oMeasure); base.Resize(this, ParaMath, oMeasure);
......
This diff is collapsed.
This diff is collapsed.
...@@ -9,19 +9,26 @@ function CFraction(props) ...@@ -9,19 +9,26 @@ function CFraction(props)
CMathBase.call(this); CMathBase.call(this);
this.init(props); this.init(props);
this.setCtrPrp(props.ctrPrp);
g_oTableId.Add( this, this.Id ); g_oTableId.Add( this, this.Id );
} }
extend(CFraction, CMathBase); extend(CFraction, CMathBase);
CFraction.prototype.init = function(props) 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) if(bValid)
{ {
var bBar = props.type === BAR_FRACTION || props.type === NO_BAR_FRACTION, var bBar = type === BAR_FRACTION || type === NO_BAR_FRACTION,
bSkew = props.type === SKEWED_FRACTION, bSkew = type === SKEWED_FRACTION,
bLin = props.type === LINEAR_FRACTION; bLin = type === LINEAR_FRACTION;
if(bBar || bSkew || bLin) // на всякий случай if(bBar || bSkew || bLin) // на всякий случай
this.type = props.type; this.type = props.type;
...@@ -30,10 +37,8 @@ CFraction.prototype.init = function(props) ...@@ -30,10 +37,8 @@ CFraction.prototype.init = function(props)
if(this.type == BAR_FRACTION || this.type == NO_BAR_FRACTION) if(this.type == BAR_FRACTION || this.type == NO_BAR_FRACTION)
{ {
var num = new CNumerator(); var num = new CNumerator();
//num.init();
var den = new CDenominator(); var den = new CDenominator();
//den.init();
this.setDimension(2, 1); this.setDimension(2, 1);
...@@ -52,9 +57,6 @@ CFraction.prototype.init = function(props) ...@@ -52,9 +57,6 @@ CFraction.prototype.init = function(props)
this.setDimension(1, 2); this.setDimension(1, 2);
this.setContent(); this.setContent();
} }
/// вызов этой функции обязательно в конце
// this.WriteContentsToHistory();
} }
CFraction.prototype.getType = function() CFraction.prototype.getType = function()
{ {
......
...@@ -2264,7 +2264,7 @@ function COperator(type) ...@@ -2264,7 +2264,7 @@ function COperator(type)
this.shiftAccent = 0; 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); var props = this.getProps(properties, defaultProps);
...@@ -3330,7 +3330,7 @@ CDelimiter.prototype.init = function(props) ...@@ -3330,7 +3330,7 @@ CDelimiter.prototype.init = function(props)
{ {
type: PARENTHESIS_LEFT type: PARENTHESIS_LEFT
}; };
this.begOper.init(begPrp, begDefaultPrp); this.begOper.setProperties(begPrp, begDefaultPrp);
this.begOper.relate(this); this.begOper.relate(this);
var endPrp = var endPrp =
...@@ -3344,7 +3344,7 @@ CDelimiter.prototype.init = function(props) ...@@ -3344,7 +3344,7 @@ CDelimiter.prototype.init = function(props)
type: PARENTHESIS_RIGHT type: PARENTHESIS_RIGHT
}; };
this.endOper.init(endPrp, endDefaultPrp); this.endOper.setProperties(endPrp, endDefaultPrp);
this.endOper.relate(this); this.endOper.relate(this);
var sepPrp = var sepPrp =
...@@ -3361,7 +3361,7 @@ CDelimiter.prototype.init = function(props) ...@@ -3361,7 +3361,7 @@ CDelimiter.prototype.init = function(props)
if(props.column == 1 ) if(props.column == 1 )
sepPrp.type = OPERATOR_EMPTY; sepPrp.type = OPERATOR_EMPTY;
this.sepOper.init(sepPrp, sepDefaultPrp); this.sepOper.setProperties(sepPrp, sepDefaultPrp);
this.sepOper.relate(this); this.sepOper.relate(this);
if(props.shape == DELIMITER_SHAPE_MATH || props.shp == DELIMITER_SHAPE_MATH) 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