Commit 308bb93a authored by Anna.Pavlova's avatar Anna.Pavlova

1. Реализовала getPropsForWhite на запись в файл

2. Поправила CAccent 
3. Поправила CBar

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53207 954022d7-b5bf-4e40-9824-e11837661b57
parent 35c9c87b
This diff is collapsed.
...@@ -262,16 +262,18 @@ CBorderBox.prototype.getBase = function() ...@@ -262,16 +262,18 @@ CBorderBox.prototype.getBase = function()
} }
CBorderBox.prototype.getPropsForWrite = function() CBorderBox.prototype.getPropsForWrite = function()
{ {
var props = { var props = {};
hideBot: !this.bBot,
hideLeft: !this.bLeft, props.hideLeft = !this.bLeft;
hideRight: !this.bRight, props.hideRight = !this.bRight;
hideTop: !this.bTop, props.hideTop = !this.bTop;
strikeBLTR: this.bLDiag, props.hideBot = !this.bBot;
strikeH: this.bHor,
strikeTLBR: this.bRDiag, props.strikeBLTR = this.bRDiag;
strikeV: this.bVert props.strikeTLBR = this.bLDiag;
}; props.strikeH = this.bHor;
props.strikeV = this.bVert;
return props; return props;
} }
...@@ -280,9 +282,11 @@ function CBox() ...@@ -280,9 +282,11 @@ function CBox()
{ {
this.kind = MATH_BOX; this.kind = MATH_BOX;
this.aln = false;
this.opEmu = false; this.opEmu = false;
this.diff = false; this.diff = false;
this.noBreak = false; this.noBreak = false;
this.brk = false;
CMathBase.call(this); CMathBase.call(this);
} }
...@@ -298,6 +302,12 @@ CBox.prototype.init = function(props) ...@@ -298,6 +302,12 @@ CBox.prototype.init = function(props)
if(props.noBreak === true || props.noBreak === 1) if(props.noBreak === true || props.noBreak === 1)
this.noBreak = true; this.noBreak = true;
if(props.brk === true || props.brk === 1)
this.brk = true;
if(props.aln === true || props.aln === 1)
this.aln = true;
this.setDimension(1, 1); this.setDimension(1, 1);
this.setContent(); this.setContent();
} }
...@@ -307,13 +317,15 @@ CBox.prototype.getBase = function() ...@@ -307,13 +317,15 @@ CBox.prototype.getBase = function()
} }
CBox.prototype.getPropsForWrite = function() CBox.prototype.getPropsForWrite = function()
{ {
var props = { var props =
aln: null, {
brk: null, aln: this.aln,
opEmu: this.opEmu,
diff: this.diff, diff: this.diff,
noBreak: this.noBreak, noBreak: this.noBreak,
opEmu: this.opEmu brk: this.brk
}; };
return props; return props;
} }
...@@ -322,6 +334,8 @@ function CBar() ...@@ -322,6 +334,8 @@ function CBar()
this.kind = MATH_BAR; this.kind = MATH_BAR;
this.loc = LOCATION_BOT; this.loc = LOCATION_BOT;
this.operator = new COperator(OPER_BAR);
CCharacter.call(this); CCharacter.call(this);
} }
extend(CBar, CCharacter); extend(CBar, CCharacter);
...@@ -332,7 +346,7 @@ CBar.prototype.init = function(props) ...@@ -332,7 +346,7 @@ CBar.prototype.init = function(props)
else if(props.pos === LOCATION_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();
var props = var props =
{ {
location: this.loc, location: this.loc,
...@@ -340,7 +354,20 @@ CBar.prototype.init = function(props) ...@@ -340,7 +354,20 @@ CBar.prototype.init = function(props)
}; };
glyph.init(props); glyph.init(props);
this.setOperator( new COperator(glyph) ); this.setOperator( new COperator(glyph) );*/
var props =
{
location: this.loc,
type: DELIMITER_LINE
};
var defaultProps =
{
loc: LOCATION_BOT
};
this.setCharacter(props, defaultProps);
} }
CBar.prototype.getCenter = function() CBar.prototype.getCenter = function()
{ {
...@@ -353,15 +380,29 @@ CBar.prototype.getCenter = function() ...@@ -353,15 +380,29 @@ CBar.prototype.getCenter = function()
return center; return center;
} }
CBar.prototype.getPropsForWrite = function()
{
var props =
{
pos: this.loc
};
return props;
}
function CPhantom() function CPhantom()
{ {
this.props = null;
CMathBase.call(this); CMathBase.call(this);
} }
extend(CPhantom, CMathBase); extend(CPhantom, CMathBase);
CPhantom.prototype.init = function(props) CPhantom.prototype.init = function(props)
{ {
this.props = props;
this.setDimension(1, 1); this.setDimension(1, 1);
this.setContent(); this.setContent();
} }
CPhantom.prototype.getPropsForWrite = function()
{
return this.props;
}
\ No newline at end of file
...@@ -4,11 +4,18 @@ function CDegree() ...@@ -4,11 +4,18 @@ function CDegree()
this.type = DEGREE_SUPERSCRIPT ; this.type = DEGREE_SUPERSCRIPT ;
this.shiftDegree = 0; this.shiftDegree = 0;
this.alnScr = false; // не выровнены, итераторы идут в соответствии с наклоном буквы/мат. объекта
CMathBase.call(this); CMathBase.call(this);
} }
extend(CDegree, CMathBase); extend(CDegree, CMathBase);
CDegree.prototype.init = function(props) CDegree.prototype.init = function(props)
{ {
if(props.alnScr === true || props.alnScr === 1)
this.alnScr = true;
else if(props.alnScr === false || props.alnScr === 0)
this.alnScr = false;
this.init_2( props, new CMathContent() ); this.init_2( props, new CMathContent() );
} }
CDegree.prototype.init_2 = function(props, oBase) CDegree.prototype.init_2 = function(props, oBase)
...@@ -68,7 +75,7 @@ CDegree.prototype.setPosition = function(_pos) ...@@ -68,7 +75,7 @@ CDegree.prototype.setPosition = function(_pos)
this.elements[0][0].setPosition({x: pos.x, y: pos.y - this.elements[0][0].size.center }); this.elements[0][0].setPosition({x: pos.x, y: pos.y - this.elements[0][0].size.center });
this.elements[0][1].setPosition({x: pos.x + this.elements[0][0].size.width + this.dW, y: pos.y + this.shiftDegree - this.size.center}); this.elements[0][1].setPosition({x: pos.x + this.elements[0][0].size.width + this.dW, y: pos.y + this.shiftDegree - this.size.center});
} }
CDegree.prototype.findDisposition = function( mCoord ) CDegree.prototype.findDisposition = function(mCoord)
{ {
var coordX, coordY; var coordX, coordY;
var X, Y; var X, Y;
...@@ -143,6 +150,14 @@ CDegree.prototype.getBase = function() ...@@ -143,6 +150,14 @@ CDegree.prototype.getBase = function()
{ {
return this.elements[0][0]; return this.elements[0][0];
} }
CDegree.prototype.getPropsForWrite = function()
{
var props = {};
props.type = this.type;
props.alnScr = this.alnScr;
return props;
}
function CIterators() function CIterators()
{ {
...@@ -211,6 +226,11 @@ function CDegreeSubSup() ...@@ -211,6 +226,11 @@ function CDegreeSubSup()
extend(CDegreeSubSup, CSubMathBase); extend(CDegreeSubSup, CSubMathBase);
CDegreeSubSup.prototype.init = function(props) CDegreeSubSup.prototype.init = function(props)
{ {
if(props.alnScr === true || props.alnScr === 1)
this.alnScr = true;
else if(props.alnScr === false || props.alnScr === 0)
this.alnScr = false;
var oBase = new CMathContent(); var oBase = new CMathContent();
this.init_2(props, oBase); this.init_2(props, oBase);
} }
...@@ -224,11 +244,6 @@ CDegreeSubSup.prototype.init_2 = function(props, oBase) ...@@ -224,11 +244,6 @@ CDegreeSubSup.prototype.init_2 = function(props, oBase)
else if(props.type === DEGREE_PreSubSup) else if(props.type === DEGREE_PreSubSup)
this.type = DEGREE_PreSubSup; this.type = DEGREE_PreSubSup;
if(props.alnScr === true || props.alnScr === 1)
this.alnScr = true;
else if(props.alnScr === false || props.alnScr === 0)
this.alnScr = false;
this.setDimension(1, 2); this.setDimension(1, 2);
var oIters = new CIterators(); var oIters = new CIterators();
...@@ -304,9 +319,11 @@ CDegreeSubSup.prototype.getLowerIterator = function() ...@@ -304,9 +319,11 @@ CDegreeSubSup.prototype.getLowerIterator = function()
} }
CDegreeSubSup.prototype.getPropsForWrite = function() CDegreeSubSup.prototype.getPropsForWrite = function()
{ {
var props = { var props = {};
alnScr: this.alnScr
}; props.type = this.type;
props.alnScr = this.alnScr;
return props; return props;
} }
......
...@@ -386,18 +386,9 @@ CFraction.prototype.findDisposition = function( mCoord ) ...@@ -386,18 +386,9 @@ CFraction.prototype.findDisposition = function( mCoord )
} }
CFraction.prototype.getPropsForWrite = function() CFraction.prototype.getPropsForWrite = function()
{ {
var type = null; var props =
if (this.type == BAR_FRACTION) {
type = 0; type: this.type
else if (this.type == LINEAR_FRACTION)
type = 1;
else if (this.type == NO_BAR_FRACTION)
type = 2;
else if (this.type == SKEWED_FRACTION)
type = 3;
var props = {
type: type
}; };
return props; return props;
} }
......
...@@ -8,7 +8,7 @@ function CLimit() ...@@ -8,7 +8,7 @@ function CLimit()
extend(CLimit, CMathBase); extend(CLimit, CMathBase);
CLimit.prototype.init = function(props) CLimit.prototype.init = function(props)
{ {
if( typeof(props.type) !== "undefined" && props.type !== null) if(props.type === LIMIT_UP || props.type === LIMIT_LOW)
this.type = props.type; this.type = props.type;
this.setDimension(2, 1); this.setDimension(2, 1);
...@@ -57,7 +57,15 @@ CLimit.prototype.setDistance = function() ...@@ -57,7 +57,15 @@ CLimit.prototype.setDistance = function()
{ {
this.dH = 0.03674768518518519*this.getCtrPrp().FontSize; this.dH = 0.03674768518518519*this.getCtrPrp().FontSize;
} }
CLimit.prototype.getPropsForWrite = function()
{
var props =
{
type: this.type
};
return props;
}
function CMathFunc() function CMathFunc()
{ {
...@@ -83,5 +91,10 @@ CMathFunc.prototype.getArgument = function() ...@@ -83,5 +91,10 @@ CMathFunc.prototype.getArgument = function()
{ {
return this.elements[0][1]; return this.elements[0][1];
} }
CMathFunc.prototype.getPropsForWrite = function()
{
var props = {};
return props;
}
...@@ -26,9 +26,13 @@ ...@@ -26,9 +26,13 @@
// 6. баг с отрисовкой кругового интеграла // 6. баг с отрисовкой кругового интеграла
// 7. cursor_Up, cursor_Down (+ c зажитым shift) // 7. cursor_Up, cursor_Down (+ c зажитым shift)
// 8. Merge textPrp и mathTextPrp (bold, italic) // 8. Merge textPrp и mathTextPrp (bold, italic)
// 9. Для управляющих символов запрашивать не getCtrPrp, getPrpToControlLetter (реализована, нужно только протащить для всех управляющих элементов) // 9. Поправить баги для CAccent с точками : смещение, когда идут подряд с одной точкой, двумя и тремя они перекрываются
// 10. объединение формул на remove и add // 10. Для управляющих символов запрашивать не getCtrPrp, getPrpToControlLetter (реализована, нужно только протащить для всех управляющих элементов)
// 11. объединение формул на remove и add
// TODO Refactoring
// 1. CAccent ~> COperator
// 2. COperator : объединить все классы связанные с отрисовкой и пересчетом операторов в один
/// TODO /// TODO
......
...@@ -81,6 +81,11 @@ var ARROW_LR = 21; ...@@ -81,6 +81,11 @@ var ARROW_LR = 21;
var DOUBLE_LEFT_ARROW = 22; var DOUBLE_LEFT_ARROW = 22;
var DOUBLE_RIGHT_ARROW = 23; var DOUBLE_RIGHT_ARROW = 23;
var DOUBLE_ARROW_LR = 24; var DOUBLE_ARROW_LR = 24;
var ACCENT_ARROW_LEFT = 26;
var ACCENT_ARROW_RIGHT = 27;
var ACCENT_ARROW_LR = 28;
var ACCENT_HALF_ARROW_LEFT = 29;
var ACCENT_HALF_ARROW_RIGHT = 30;
var SCR_ROMAN = 0; var SCR_ROMAN = 0;
var SCR_SCRIPT = 1; var SCR_SCRIPT = 1;
...@@ -92,6 +97,8 @@ var SCR_MONOSPACE = 5; ...@@ -92,6 +97,8 @@ var SCR_MONOSPACE = 5;
var OPER_DELIMITER = 0; var OPER_DELIMITER = 0;
var OPER_SEPARATOR = 1; var OPER_SEPARATOR = 1;
var OPER_GROUP_CHAR = 2; var OPER_GROUP_CHAR = 2;
var OPER_ACCENT = 3;
var OPER_BAR = 4;
var TURN_0 = 0; var TURN_0 = 0;
...@@ -105,6 +112,7 @@ var DELIMITER_SHAPE_CENTERED = 1; ...@@ -105,6 +112,7 @@ var DELIMITER_SHAPE_CENTERED = 1;
var LIMIT_LOW = 0; var LIMIT_LOW = 0;
var LIMIT_UP = 1; var LIMIT_UP = 1;
//////////////////////////////////////////
var ACCENT_ONE_DOT = 0; var ACCENT_ONE_DOT = 0;
var ACCENT_TWO_DOTS = 1; var ACCENT_TWO_DOTS = 1;
var ACCENT_THREE_DOTS = 2; var ACCENT_THREE_DOTS = 2;
...@@ -119,14 +127,12 @@ var DOUBLE_LINE = 10; ...@@ -119,14 +127,12 @@ var DOUBLE_LINE = 10;
var ACCENT_TILDE = 11; var ACCENT_TILDE = 11;
var ACCENT_BREVE = 12; var ACCENT_BREVE = 12;
var ACCENT_INVERT_BREVE = 13; var ACCENT_INVERT_BREVE = 13;
var ACCENT_ARROW_LEFT = 14;
var ACCENT_ARROW_RIGHT = 15;
var ACCENT_ARROW_LR = 16;
var ACCENT_HALF_ARROW_LEFT = 17;
var ACCENT_HALF_ARROW_RIGHT = 18;
var ACCENT_SIGN = 19; var ACCENT_SIGN = 19;
var ACCENT_TEXT = 20; var ACCENT_TEXT = 20;
/////////////////////////////////////////
var BASEJC_CENTER = 0; var BASEJC_CENTER = 0;
var BASEJC_TOP = 1; var BASEJC_TOP = 1;
var BASEJC_BOTTOM = 2; var BASEJC_BOTTOM = 2;
......
...@@ -59,12 +59,15 @@ CMathMatrix.prototype.init = function(props) ...@@ -59,12 +59,15 @@ CMathMatrix.prototype.init = function(props)
this.baseJc = MATRIX_BOTTOM; this.baseJc = MATRIX_BOTTOM;
}*/ }*/
if(props.baseJc === BASEJC_CENTER) /*if(props.baseJc === BASEJC_CENTER)
this.baseJc = BASEJC_CENTER; this.baseJc = BASEJC_CENTER;
else if(props.baseJc === BASEJC_TOP) else if(props.baseJc === BASEJC_TOP)
this.baseJc = BASEJC_TOP; this.baseJc = BASEJC_TOP;
else if(props.baseJc === BASEJC_BOTTOM) else if(props.baseJc === BASEJC_BOTTOM)
this.baseJc = BASEJC_BOTTOM; this.baseJc = BASEJC_BOTTOM;*/
if(props.baseJc === BASEJC_CENTER || props.baseJc === BASEJC_TOP || props.baseJc === BASEJC_BOTTOM)
this.baseJc = props.baseJc;
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);
...@@ -75,8 +78,6 @@ CMathMatrix.prototype.init = function(props) ...@@ -75,8 +78,6 @@ CMathMatrix.prototype.init = function(props)
this.hidePlaceholder(true); this.hidePlaceholder(true);
} }
//if(props.)
/*if(props.cGpRule !== "undefined" && props.cGpRule !== null) /*if(props.cGpRule !== "undefined" && props.cGpRule !== null)
{ {
...@@ -127,12 +128,13 @@ CMathMatrix.prototype.setRuleGap = function(space, rule, gap, minGap) ...@@ -127,12 +128,13 @@ CMathMatrix.prototype.setRuleGap = function(space, rule, gap, minGap)
if(gap == gap - 0 && gap == gap^0) if(gap == gap - 0 && gap == gap^0)
space.value = gap; space.gap = gap;
else else
space.value = 0; space.gap = 0;
if(minGap == minGap - 0 && minGap == minGap^0) if(minGap == minGap - 0 && minGap == minGap^0)
space.minGap = gap; space.minGap = gap;
/*else /*else
space.minGap = 0;*/ space.minGap = 0;*/
...@@ -466,28 +468,34 @@ CMathMatrix.prototype.baseJustification = function(type) ...@@ -466,28 +468,34 @@ CMathMatrix.prototype.baseJustification = function(type)
this.baseJc = type; this.baseJc = type;
} }
////
CMathMatrix.prototype.getPropsForWrite = function() CMathMatrix.prototype.getPropsForWrite = function()
{ {
var props = { var props = {};
baseJc: this.baseJc,
cGp: this.spaceColumn.gap, props.baseJc = this.baseJc;
cGpRule: this.spaceColumn.rule, props.row = this.nRow;
cSp: null, props.column = this.nCol;
column: this.nCol, props.plcHide = this.plcHide;
plcHide: this.plcHide,
rSp: null, props.cGpRule = this.spaceColumn.rule;
rSpRule: null props.cGp = this.spaceColumn.gap;
}; props.cSp = this.spaceColumn.minGap;
props.rSpRule = this.spaceRow.rule;
props.rSp = this.spaceRow.gap;
return props; return props;
} }
////
//// ////
function CEqArray() function CEqArray()
{ {
this.kind = MATH_EQ_ARRAY; this.kind = MATH_EQ_ARRAY;
this.maxDist = 0;
this.objDist = 0;
CMathMatrix.call(this); CMathMatrix.call(this);
} }
extend(CEqArray, CMathMatrix); extend(CEqArray, CMathMatrix);
...@@ -516,10 +524,10 @@ CEqArray.prototype.init = function(props) ...@@ -516,10 +524,10 @@ CEqArray.prototype.init = function(props)
Pr.baseJc = props.baseJc; Pr.baseJc = props.baseJc;
if(props.maxDist !== "undefined" && props.maxDist !== null) if(props.maxDist !== "undefined" && props.maxDist !== null)
Pr.maxDist = props.maxDist; this.maxDist = props.maxDist;
if(props.objDist !== "undefined" && props.objDist !== null) if(props.objDist !== "undefined" && props.objDist !== null)
Pr.objDist = props.objDist; this.objDist = props.objDist;
CEqArray.superclass.init.call(this, Pr); CEqArray.superclass.init.call(this, Pr);
} }
...@@ -541,3 +549,17 @@ CEqArray.prototype.getElement = function(num) ...@@ -541,3 +549,17 @@ CEqArray.prototype.getElement = function(num)
{ {
return this.elements[num][0]; return this.elements[num][0];
} }
CEqArray.prototype.getPropsForWrite = function()
{
var props = {};
props.row = this.nRow;
props.baseJc = this.baseJc;
props.rSpRule = this.spaceRow.rule;
props.rSp = this.spaceRow.gap;
props.maxDist = this.maxDist;
props.objDist = this.objDist;
return props;
}
\ No newline at end of file
...@@ -214,20 +214,16 @@ CNary.prototype.getLowerIterator = function() ...@@ -214,20 +214,16 @@ CNary.prototype.getLowerIterator = function()
if (!this.subHide) if (!this.subHide)
return this.elements[0][0].getLowerIterator(); return this.elements[0][0].getLowerIterator();
} }
CNary.prototype.getPropsForWrite = function() CNary.prototype.getPropsForWhite = function()
{ {
var limloc = null; var props = {};
if (this.limLoc == NARY_SubSup)
limLoc = 0; props.limLoc = (this.limLoc == NARY_UndOvr) ? NARY_UndOvr : NARY_SubSup;
else if (this.limLoc == NARY_UndOvr) props.chr = String.fromCharCode(this.code);
limLoc = 1; props.supHide = this.supHide;
var props = { props.subHide = this.subHide;
chr: String.fromCharCode(this.code), props.grow = this.grow;
grow: this.grow,
limLoc: limLoc,
subHide: this.subHide,
supHide: this.supHide
};
return props; return props;
} }
......
This diff is collapsed.
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