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

изменила properties для чтения

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50688 954022d7-b5bf-4e40-9824-e11837661b57
parent 41a3aa17
...@@ -545,7 +545,7 @@ CSign.prototype.setSign = function(props) ...@@ -545,7 +545,7 @@ CSign.prototype.setSign = function(props)
} }
else else
{ {
this.type = MATH_TEXT; this.type = ACCENT_TEXT;
this.sign.add(sign.code); this.sign.add(sign.code);
} }
} }
......
...@@ -41,7 +41,7 @@ CBorderBox.prototype.init = function(props) ...@@ -41,7 +41,7 @@ CBorderBox.prototype.init = function(props)
if(props.strikeV === true || props.strikeV === 1) if(props.strikeV === true || props.strikeV === 1)
this.bVert = true; this.bVert = true;
} }
this.setDimension(1, 1); this.setDimension(1, 1);
this.setContent(); this.setContent();
} }
...@@ -272,17 +272,14 @@ function CBox() ...@@ -272,17 +272,14 @@ function CBox()
extend(CBox, CMathBase); extend(CBox, CMathBase);
CBox.prototype.init = function(props) CBox.prototype.init = function(props)
{ {
if( typeof(props) !== "undefined" && (props !== null) ) if(props.opEmu === true || props.opEmu === 1)
{ this.opEmu = true;
if(props.opEmu === true || props.opEmu === 1)
this.opEmu = true;
if(props.diff === true || props.diff === 1) if(props.diff === true || props.diff === 1)
this.diff = true; this.diff = true;
if(props.noBreak === true || props.noBreak === 1) if(props.noBreak === true || props.noBreak === 1)
this.noBreak = true; this.noBreak = true;
}
this.setDimension(1, 1); this.setDimension(1, 1);
this.setContent(); this.setContent();
...@@ -300,9 +297,9 @@ function CBar() ...@@ -300,9 +297,9 @@ function CBar()
extend(CBar, CCharacter); extend(CBar, CCharacter);
CBar.prototype.init = function(props) CBar.prototype.init = function(props)
{ {
if(props.pos === "top" || props.location === LOCATION_TOP) if(props.pos === LOCATION_TOP || props.location === LOCATION_TOP)
this.loc = LOCATION_TOP; this.loc = LOCATION_TOP;
else if(props.pos === "bot" || props.location === LOCATION_BOT) else if(props.pos === LOCATION_BOT || props.location === LOCATION_BOT)
this.loc = LOCATION_BOT; this.loc = LOCATION_BOT;
var glyph = new COperatorLine(); var glyph = new COperatorLine();
......
...@@ -7,7 +7,7 @@ function CFraction() ...@@ -7,7 +7,7 @@ function CFraction()
extend(CFraction, CMathBase); extend(CFraction, CMathBase);
CFraction.prototype.init = function(props) CFraction.prototype.init = function(props)
{ {
if( typeof(props.type) !== "undefined" || props.type !== null ) if( typeof(props.type) !== "undefined" && props.type !== null )
this.type = props.type; this.type = props.type;
else else
this.type = BAR_FRACTION; this.type = BAR_FRACTION;
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
//var NameFunctions = ["min", "max", "lim", "log", "ln", "sin", "cos", "tan", "ctg", "cosh", "sinh", "tanh", "cth", "sec", "csc", "cot", "csch", "sech", "coth"]; //var NameFunctions = ["min", "max", "lim", "log", "ln", "sin", "cos", "tan", "ctg", "cosh", "sinh", "tanh", "cth", "sec", "csc", "cot", "csch", "sech", "coth"];
//var Diff = ["dx","dy","dθ"]; //var Diff = ["dx","dy","dθ"];
function CLogarithm() function old_CLogarithm()
{ {
CSubMathBase.call(this,1,2); CSubMathBase.call(this,1,2);
} }
extend(CLogarithm, CSubMathBase); extend(old_CLogarithm, CSubMathBase);
CLogarithm.prototype.setContent = function() old_CLogarithm.prototype.setContent = function()
{ {
var oBase = new CMathContent(); var oBase = new CMathContent();
var GParams = Common_CopyObj(this.params); var GParams = Common_CopyObj(this.params);
...@@ -31,17 +31,17 @@ CLogarithm.prototype.setContent = function() ...@@ -31,17 +31,17 @@ CLogarithm.prototype.setContent = function()
oArg.relate(this); oArg.relate(this);
oArg.fillPlaceholders(); oArg.fillPlaceholders();
CLogarithm.superclass.setContent.call(this, oFunc, oArg); old_CLogarithm.superclass.setContent.call(this, oFunc, oArg);
} }
CLogarithm.prototype.getFunction = function() old_CLogarithm.prototype.getFunction = function()
{ {
return this.elements[0][0].getBase(); return this.elements[0][0].getBase();
} }
CLogarithm.prototype.getBase = function() old_CLogarithm.prototype.getBase = function()
{ {
return this.elements[0][0].getIterator(); return this.elements[0][0].getIterator();
} }
CLogarithm.prototype.getArgument = function() old_CLogarithm.prototype.getArgument = function()
{ {
return this.elements[0][1]; return this.elements[0][1];
} }
...@@ -57,7 +57,6 @@ CLimit.prototype.init = function(props) ...@@ -57,7 +57,6 @@ CLimit.prototype.init = function(props)
this.setDimension(2, 1); this.setDimension(2, 1);
var oBase = new CMathContent(); var oBase = new CMathContent();
oBase.setOwnTPrp({Italic: false}); oBase.setOwnTPrp({Italic: false});
var oIter = new CMathContent(); var oIter = new CMathContent();
......
...@@ -108,9 +108,15 @@ var ACCENT_ARROW_RIGHT = 15; ...@@ -108,9 +108,15 @@ var ACCENT_ARROW_RIGHT = 15;
var ACCENT_ARROW_LR = 16; var ACCENT_ARROW_LR = 16;
var ACCENT_HALF_ARROW_LEFT = 17; var ACCENT_HALF_ARROW_LEFT = 17;
var ACCENT_HALF_ARROW_RIGHT = 18; var ACCENT_HALF_ARROW_RIGHT = 18;
var MATH_TEXT = 19; var ACCENT_TEXT = 19;
var BASEJC_CENTER = 0;
var BASEJC_TOP = 1;
var BASEJC_BOTTOM = 2;
var MATH_TEXT = 0;
var MATH_RUN_PRP = 1;
var MATH_OBJS = 2;
var MATH_EMPTY = 3;
var MATH_PLACEHOLDER = 4;
var MATRIX_CENTER = 0;
var MATRIX_TOP = 1;
var MATRIX_BOTTOM = 2;
\ No newline at end of file
...@@ -20,7 +20,7 @@ function CMathMatrix() ...@@ -20,7 +20,7 @@ function CMathMatrix()
}; };
this.plcHide = false; this.plcHide = false;
this.baseJc = 0; this.baseJc = BASEJC_CENTER;
this.gaps = this.gaps =
{ {
row: new Array(), row: new Array(),
...@@ -40,7 +40,7 @@ CMathMatrix.prototype.init = function(props) ...@@ -40,7 +40,7 @@ CMathMatrix.prototype.init = function(props)
this.setDimension(props.row, props.column); this.setDimension(props.row, props.column);
this.setContent(); this.setContent();
if(typeof(props.baseJc) !== "undefined" && props.baseJc !== null) /*if(typeof(props.baseJc) !== "undefined" && props.baseJc !== null)
{ {
if(props.baseJc === "center") if(props.baseJc === "center")
this.baseJc = MATRIX_CENTER; this.baseJc = MATRIX_CENTER;
...@@ -48,7 +48,14 @@ CMathMatrix.prototype.init = function(props) ...@@ -48,7 +48,14 @@ CMathMatrix.prototype.init = function(props)
this.baseJc = MATRIX_TOP; this.baseJc = MATRIX_TOP;
else if(props.baseJc === "bottom") else if(props.baseJc === "bottom")
this.baseJc = MATRIX_BOTTOM; this.baseJc = MATRIX_BOTTOM;
} }*/
if(props.baseJc === BASEJC_CENTER)
this.baseJc = BASEJC_CENTER;
else if(props.baseJc === BASEJC_TOP)
this.baseJc = BASEJC_TOP;
else if(props.baseJc === BASEJC_BOTTOM)
this.baseJc = BASEJC_BOTTOM;
this.setRuleGap(this.spaceColumn, props.cGpRule, props.cGp, props.cSp); this.setRuleGap(this.spaceColumn, props.cGpRule, props.cGp, props.cSp);
this.setRuleGap(this.spaceRow, props.rSpRule, props.rSp); this.setRuleGap(this.spaceRow, props.rSpRule, props.rSp);
...@@ -184,12 +191,12 @@ CMathMatrix.prototype.recalculateSize = function() ...@@ -184,12 +191,12 @@ CMathMatrix.prototype.recalculateSize = function()
var center = 0; var center = 0;
if(this.baseJc == 1) if(this.baseJc == BASEJC_TOP)
{ {
for(var j = 0; j < this.nCol; j++) for(var j = 0; j < this.nCol; j++)
center = this.elements[0][j].size.center > center ? this.elements[0][j].size.center : center; center = this.elements[0][j].size.center > center ? this.elements[0][j].size.center : center;
} }
else if(this.baseJc == 2) else if(this.baseJc == BASEJC_BOTTOM)
{ {
var descent = 0, var descent = 0,
currDsc; currDsc;
...@@ -358,6 +365,7 @@ CMathMatrix.prototype.addRow = function() ...@@ -358,6 +365,7 @@ CMathMatrix.prototype.addRow = function()
{ {
this.elements[this.nRow-1][j] = new CMathContent(); this.elements[this.nRow-1][j] = new CMathContent();
this.elements[this.nRow-1][j].relate(this); this.elements[this.nRow-1][j].relate(this);
this.elements[this.nRow-1][j].setComposition(this.Composition);
this.elements[this.nRow-1][j].setReduct(this.reduct); this.elements[this.nRow-1][j].setReduct(this.reduct);
//this.elements[this.nRow-1][j].setComposition(this.Composition); //this.elements[this.nRow-1][j].setComposition(this.Composition);
} }
...@@ -459,6 +467,38 @@ function CEqArray() ...@@ -459,6 +467,38 @@ function CEqArray()
} }
extend(CEqArray, CMathMatrix); extend(CEqArray, CMathMatrix);
CEqArray.prototype.init = function(props) CEqArray.prototype.init = function(props)
{
var Pr =
{
column: 1,
row: props.row,
baseJc: BASEJC_CENTER,
rSpRule: 0,
rSp: 0,
maxDist: 0,
objDist: 0
}; // default
if(props.rSpRule !== "undefined" && props.rSpRule !== null)
Pr.rSpRule = props.rSpRule;
if(props.rSp !== "undefined" && props.rSp !== null)
Pr.rSp = props.rSp;
if(props.baseJc !== "undefined" && props.baseJc !== null)
Pr.baseJc = props.baseJc;
if(props.maxDist !== "undefined" && props.maxDist !== null)
Pr.maxDist = props.maxDist;
if(props.objDist !== "undefined" && props.objDist !== null)
Pr.objDist = props.objDist;
CEqArray.superclass.init.call(this, Pr);
}
CEqArray.prototype.old_init = function(props)
{ {
var prps = var prps =
{ {
...@@ -471,4 +511,8 @@ CEqArray.prototype.init = function(props) ...@@ -471,4 +511,8 @@ CEqArray.prototype.init = function(props)
}; };
CEqArray.superclass.init.call(this, prps); CEqArray.superclass.init.call(this, prps);
}
CEqArray.prototype.getElement = function(num)
{
return this.elements[num][y];
} }
\ No newline at end of file
...@@ -17,8 +17,8 @@ function CGlyphOperator() ...@@ -17,8 +17,8 @@ function CGlyphOperator()
this.penW = 1; // px this.penW = 1; // px
this.TxtPrp = new CMathTextPrp(); //this.TxtPrp = new CMathTextPrp();
this.bGlyph = true; //this.bGlyph = true;
} }
CGlyphOperator.prototype.init = function(props) CGlyphOperator.prototype.init = function(props)
...@@ -3850,9 +3850,9 @@ function CDelimiter() ...@@ -3850,9 +3850,9 @@ function CDelimiter()
extend(CDelimiter, CSubMathBase); extend(CDelimiter, CSubMathBase);
CDelimiter.prototype.init = function(props) CDelimiter.prototype.init = function(props)
{ {
if(props.grow == "1" || props.grow == true) if(props.grow == true || props.grow == 1)
this.grow = true; this.grow = true;
else if(props.grow == "0" || props.grow == false) else if(props.grow == false || props.grow == 0)
this.grow = false; this.grow = false;
else else
this.grow = true; this.grow = true;
...@@ -3871,9 +3871,9 @@ CDelimiter.prototype.init = function(props) ...@@ -3871,9 +3871,9 @@ CDelimiter.prototype.init = function(props)
this.sepOper.setTxtPrp(tPrp); this.sepOper.setTxtPrp(tPrp);
this.endOper.setTxtPrp(tPrp); this.endOper.setTxtPrp(tPrp);
if(props.shape == "match" || props.shapeType == DELIMITER_SHAPE_MATH) if(props.shape == DELIMITER_SHAPE_MATH)
this.shape = DELIMITER_SHAPE_MATH; this.shape = DELIMITER_SHAPE_MATH;
else if(props.shape == "centered" || props.shapeType == DELIMITER_SHAPE_CENTERED) else if(props.shape == DELIMITER_SHAPE_CENTERED)
this.shape = DELIMITER_SHAPE_CENTERED; this.shape = DELIMITER_SHAPE_CENTERED;
else else
this.shape = DELIMITER_SHAPE_CENTERED; this.shape = DELIMITER_SHAPE_CENTERED;
...@@ -4708,14 +4708,14 @@ function CGroupCharacter() ...@@ -4708,14 +4708,14 @@ function CGroupCharacter()
extend(CGroupCharacter, CCharacter); extend(CGroupCharacter, CCharacter);
CGroupCharacter.prototype.init = function(props) CGroupCharacter.prototype.init = function(props)
{ {
if(props.vertJust === "top" || props.justif == VJUST_TOP) if(props.vertJust === VJUST_TOP)
this.vertJust = VJUST_TOP; this.vertJust = VJUST_TOP;
else if(props.vertJust === "bottom"|| props.justif == VJUST_BOT) else if(props.vertJust === VJUST_BOT)
this.vertJust = VJUST_BOT; this.vertJust = VJUST_BOT;
if(props.pos === "top" || props.location === LOCATION_TOP) if(props.pos === LOCATION_TOP || props.location === LOCATION_TOP)
this.loc = LOCATION_TOP; this.loc = LOCATION_TOP;
else if(props.pos === "bot" || props.location === LOCATION_BOT) else if(props.pos === LOCATION_BOT || props.location === LOCATION_BOT)
this.loc = LOCATION_BOT; this.loc = LOCATION_BOT;
var type = props.chrType; var type = props.chrType;
...@@ -4727,7 +4727,6 @@ CGroupCharacter.prototype.init = function(props) ...@@ -4727,7 +4727,6 @@ CGroupCharacter.prototype.init = function(props)
this.setReduct(DEGR_REDUCT); this.setReduct(DEGR_REDUCT);
this.setOperator( new COperator(glyph) ); this.setOperator( new COperator(glyph) );
} }
CGroupCharacter.prototype.getCenter = function() CGroupCharacter.prototype.getCenter = function()
{ {
......
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