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

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