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

Убрала класс CSign и старые функции

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58559 954022d7-b5bf-4e40-9824-e11837661b57
parent 1c759452
......@@ -400,97 +400,6 @@ CAccentBreve.prototype.drawPath = function(pGraphics, XX, YY)
pGraphics._l(XX[22], YY[22]);
}
/*function CSign()
{
this.sign = new CMathText(true);
this.typeOper = null;
this.Parent = null;
}
CSign.prototype.init = function(props)
{
var bDot = props.code === 0x307 || props.type === ACCENT_ONE_DOT,
b2Dots = props.code === 0x308 || props.type === ACCENT_TWO_DOTS,
b3Dots = props.code === 0x20DB || props.type === ACCENT_THREE_DOTS,
bAccGrave = props.code === 0x300 || props.type === ACCENT_GRAVE,
bAccAcute = props.code === 0x301 || props.type === ACCENT_ACUTE;
if(bDot)
{
this.typeOper = ACCENT_ONE_DOT;
this.sign.add(0x307);
}
else if(b2Dots)
{
this.typeOper = ACCENT_TWO_DOTS;
this.sign.add(0x308);
}
else if(b3Dots)
{
this.typeOper = ACCENT_THREE_DOTS;
this.sign.add(0x20DB);
}
else if(bAccGrave)
{
this.typeOper = ACCENT_GRAVE;
this.sign.add(0x300);
}
else if(bAccAcute)
{
this.typeOper = ACCENT_ACUTE;
this.sign.add(0x301);
}
else
{
this.typeOper = ACCENT_TEXT;
this.sign.add(props.code);
}
}
CSign.prototype.setPosition = function(pos)
{
this.sign.setPosition(pos);
}
CSign.prototype.fixSize = function(oMeasure, stretch, bIncline)
{
var ctrPrp = this.Parent.Get_CompiledCtrPrp();
var rPrp = new CTextPr();
var defaultRPrp = this.Parent.ParaMath.Get_Default_TPrp();
rPrp.Merge(defaultRPrp);
rPrp.Merge(ctrPrp);
rPrp.Italic = false; // не меняем значок
rPrp.Bold = false;
oMeasure.SetFont(rPrp);
this.sign.Resize(oMeasure);
*//*if(this.typeOper == ACCENT_THREE_DOTS)
this.dH = 1.2*ctrPrp.FontSize/36;
else
this.dH = 1.2*ctrPrp.FontSize/36;*//*
//var height = this.sign.size.height + this.dH,
var height = this.sign.size.height,
width = this.sign.size.widthG;
if(bIncline)
width += 0.1 * this.sign.size.height; // incline
this.size = {width: width, height: height};
}
CSign.prototype.draw = function(x, y, pGraphics)
{
this.sign.draw(x, y, pGraphics);
}
CSign.prototype.relate = function(parent)
{
this.Parent = parent;
}
CSign.prototype.getCodeCharacter = function()
{
return this.sign.value;
}*/
function CAccent(props)
{
this.Id = g_oIdCounter.Get_NewId();
......
......@@ -782,10 +782,6 @@ CMathBase.prototype =
this.bSelectionUse = false;
},
IsCurrentPlh: function()
{
return this.elements[this.CurPos_X][this.CurPos_Y].IsCurrentPlh();
},
SetGaps: function(GapsInfo)
{
this.Parent = GapsInfo.Parent;
......
......@@ -232,8 +232,6 @@ function CCoeffGaps()
{
left: new CGaps(0.52, 0.26, 0, 0.52),
right: new CGaps(0.49, 0, 0, 0.49)
//left: new CGaps(0.52, 0.26, 0, 2.5),
//right: new CGaps(0.49, 0, 0, 2)
};
this.Mult =
......@@ -266,7 +264,6 @@ CCoeffGaps.prototype =
{
var operator = null;
//if(codeCurr == 0x3D)
if(this.checkEqualSign(codeCurr))
operator = this.Equal;
else if(this.checkOperSign(codeCurr))
......@@ -283,7 +280,6 @@ CCoeffGaps.prototype =
coeff = part.letters;
else if(this.checkOperSign(codeLR))
coeff = part.sign;
//else if(codeLR == 0x3D )
else if(this.checkEqualSign(codeLR))
coeff = part.equal;
else if(this.checkZeroSign(codeLR, direct))
......@@ -292,7 +288,6 @@ CCoeffGaps.prototype =
coeff = part.letters;
return coeff;
},
checkOperSign: function(code) // "+", "-", "±"
{
......@@ -317,7 +312,6 @@ CCoeffGaps.prototype =
},
checkZeroSign: function(code, direct) // "*", "/", "\"
{
//var MULT = 0x2217,
var MULT = 0x2A,
DIVISION = 0x2F,
B_SLASH = 0x5C;
......@@ -933,62 +927,6 @@ CMathContent.prototype =
init: function()
{
},
addTxt: function(txt)
{
var Pos = this.CurPos;
for(var i = 0; i < txt.length; i++)
{
this.addLetter( txt.charCodeAt(i));
}
this.setLogicalPosition(this.CurPos);
//this.setStart_Selection(this.CurPos);
//this.selection.active = false;
var EndPos = this.CurPos;
var items = this.content.slice(Pos, EndPos);
return items;
},
addLetter: function(code)
{
this.verifyRPrp_Letter();
/*var gps = null;
if(code == 0x002B || code == 0x002F || code == 0x002A || code == 0x002D)
{
//l_gap = r_gap = Math.floor( this.font.FontSize / 5 ) *g_dKoef_pix_to_mm;
l_gap = r_gap = 0;
gps = new dist(l_gap, r_gap, 0, 0);
}
else
gps = new dist(0,0,0,0);*/
//собственно добавляем сам элемент
if(code == 42) // "*"
code = 8727;
else if(code == 45) // "-"
code = 8722;
if(this.bDot)
{
if(code === 0x69)
code = 0x1D6A4;
if(code === 0x6A)
code = 0x1D6A5;
}
var symb = new CMathText(false);
symb.add(code);
this.addToContent(symb);
var item = this.content[this.CurPos];
return [item];
},
addElementToContent: function(obj) //for "read"
{
......@@ -4309,10 +4247,6 @@ CMathContent.prototype =
return flag;
},
IsCurrentPlh: function()
{
return this.IsPlaceholder();
},
IsJustDraw: function()
{
return false;
......@@ -4389,47 +4323,6 @@ CMathContent.prototype =
/// For Para Math
old_Recalculate_CurPos : function(_X, Y, CurrentRun, _CurRange, _CurLine, _CurPage, UpdateCurPos, UpdateTarget, ReturnTarget)
{
var result;
var PointInfo = new CMathPointInfo();
PointInfo.SetInfoPoints(this.InfoPoints);
if(this.RecalcInfo.bEqqArray)
{
_X = this.pos.x + this.ParaMath.X + PointInfo.GetAlign();
Y = this.pos.y + this.ParaMath.Y + this.size.ascent;
for(var i = 0; i < this.CurPos; i++)
{
if(this.content[this.CurPos].Type == para_Math_Run)
this.content[i].Recalculate_CurPos(_X, Y, false, _CurRange, _CurLine, _CurPage, UpdateCurPos, UpdateTarget, ReturnTarget);
else
_X += this.content[i].size.width;
}
result = this.content[this.CurPos].Recalculate_CurPos(_X, Y, CurrentRun, _CurRange, _CurLine, _CurPage, UpdateCurPos, UpdateTarget, ReturnTarget);
}
else
{
if(this.content[this.CurPos].Type == para_Math_Composition)
{
result = this.content[this.CurPos].Recalculate_CurPos(_X, Y, CurrentRun, _CurRange, _CurLine, _CurPage, UpdateCurPos, UpdateTarget, ReturnTarget);
}
else if(this.content[this.CurPos].Type == para_Math_Run)
{
Y = this.pos.y + this.ParaMath.Y + this.size.ascent;
_X = this.pos.x + this.ParaMath.X + this.WidthToElement[this.CurPos];
result = this.content[this.CurPos].Recalculate_CurPos(_X, Y, CurrentRun, _CurRange, _CurLine, _CurPage, UpdateCurPos, UpdateTarget, ReturnTarget);
}
}
return result;
},
Recalculate_CurPos : function(X, Y, CurrentRun, _CurRange, _CurLine, _CurPage, UpdateCurPos, UpdateTarget, ReturnTarget)
{
X = this.pos.x + this.ParaMath.X;
......@@ -4490,7 +4383,6 @@ CMathContent.prototype =
this.ArgSize.SetValue(val);
},
///////// Перемещение ////////////
// Поиск позиции, селект
......
......@@ -3284,152 +3284,11 @@ CDelimiter.prototype.fillMathComposition = function(props, contents /*array*/)
for(var j = 0; j < this.nCol; j++)
this.elements[0][j] = contents[j];
}
CDelimiter.prototype.old_recalculateSize = function()
{
var height = 0,
width = 0, center = 0;
var ascent = 0,
descent = 0;
// временно
var FontSize = this.getCtrPrp().FontSize;
var Height = 0.4*FontSize; // g_oTextMeasurer.GetHeight()
var plH = 0.275*FontSize, // плейсхолдер
H2 = 0.08*FontSize; // временно baseLine
// временно
var div = 0;
if(this.shape == DELIMITER_SHAPE_CENTERED)
{
for(var j = 0; j < this.nCol; j++)
{
var content = this.elements[0][j].size;
width += content.width;
ascent = content.center > ascent ? content.center : ascent;
descent = content.height - content.center > descent ? content.height - content.center: descent;
}
var maxH = ascent > descent ? ascent : descent;
// для случая, когда в контенте степень и пр. элементы где нужно учитовать baseLine
if(descent < plH || ascent < plH)
{
if(maxH < plH)
{
height = ascent + descent;
center = ascent;
}
else
{
div = ascent - plH;
height = ascent + descent + div;
center = ascent;
}
}
else
{
height = 2*maxH;
center = height/2;
}
}
else
{
for(var j = 0; j < this.nCol; j++)
{
var content = this.elements[0][j].size;
width += content.width;
ascent = content.center > ascent ? content.center : ascent;
descent = content.height - content.center > descent ? content.height - content.center: descent;
}
height = ascent + descent;
center = ascent;
}
this.begOper.fixSize(height);
width += this.begOper.size.width;
if(height < this.begOper.size.height)
{
center = this.begOper.size.height - H2;
height = this.begOper.size.height;
//center = this.begOper.size.center;
}
this.endOper.fixSize(height);
width += this.endOper.size.width;
if(height < this.endOper.size.height)
{
//center += (height - this.endOper.size.height)/2;
center = this.endOper.size.height - H2;
height = this.endOper.size.height;
//center = this.endOper.size.center;
}
this.sepOper.fixSize(height);
width += (this.nCol - 1)*this.sepOper.size.width;
if(height < this.endOper.size.height)
{
//center += (height - this.sepOper.size.height)/2;
height = this.sepOper.size.height;
//center = this.sepOper.size.center;
}
/*if(this.begOper !== -1)
{
this.begOper.fixSize(height);
width += this.begOper.size.width;
if(height < this.begOper.size.height)
{
center = this.begOper.size.center;
height = this.begOper.size.height;
}
//height = (height < this.begOper.size.height) ? this.begOper.size.height : height;
//center = (center < this.begOper.size.center) ? this.begOper.size.center : center;
}
if(this.endOper !== -1)
{
this.endOper.fixSize(height);
width += this.endOper.size.width;
//height = (height < this.endOper.size.height) ? this.endOper.size.height : height;
//center = (center < this.endOper.size.center) ? this.endOper.size.center : center;
if(height < this.endOper.size.height)
{
center = this.endOper.size.center;
height = this.endOper.size.height;
}
}
if(this.sepOper !== -1)
{
this.sepOper.fixSize(height);
width += (this.nCol - 1)*this.sepOper.size.width;
height = (height < this.sepOper.size.height) ? this.sepOper.size.height : height;
center = (center < this.sepOper.size.center) ? this.sepOper.size.center : center;
}*/
this.size = {width: width, height: height, center: center};
}
CDelimiter.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
//this.Set_CompiledCtrPrp(ParaMath);
if(this.RecalcInfo.bProps == true)
{
......@@ -3602,32 +3461,6 @@ CDelimiter.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
this.size = {width: width, height: height, ascent: ascent};
}
CDelimiter.prototype.old_alignOperator = function(height)
{
var align = 0;
if(this.size.height > height)
{
if(this.shape == DELIMITER_SHAPE_CENTERED)
align = this.size.center - height/2;
else if(this.shape == DELIMITER_SHAPE_MATH)
{
var ascent = this.size.center,
descent = this.size.height - height/2;
var k = ascent/descent;
if(k < 0.2)
k = 0.2;
else if(k > 0.8)
k = 0.8;
align = this.size.center - height*k;
}
}
return align;
}
CDelimiter.prototype.alignOperator = function(operator) // в качестве аргумента передаем высоту оператора
{
var align = 0;
......@@ -4130,166 +3963,6 @@ CGroupCharacter.prototype.getAscent = function(oMeasure)
return ascent;
}
CGroupCharacter.prototype.old_getGlyph = function(code, type)
{
var operator, props, accent;
if(code === 0x23DE || type == BRACKET_CURLY_TOP)
{
operator = new COperatorBracket();
props =
{
location: this.loc,
turn: TURN_0
};
operator.init(props);
}
else if(code === 0x23DF || type === BRACKET_CURLY_BOTTOM )
{
operator = new COperatorBracket();
props =
{
location: this.loc,
turn: TURN_MIRROR_0
};
operator.init(props);
}
else if(code === 0x2190 || type === ARROW_LEFT)
{
operator = new CSingleArrow();
props =
{
location: this.loc,
turn: TURN_0
};
operator.init(props);
}
else if(code === 0x2192 || type === ARROW_RIGHT)
{
operator = new CSingleArrow();
props =
{
location: this.loc,
turn: TURN_180
};
operator.init(props);
}
else if(code === 0x2194 || type === ARROW_LR)
{
operator = new CLeftRightArrow();
props =
{
location: this.loc,
turn: TURN_0
};
operator.init(props);
}
else if(code === 0x21D0 || type === DOUBLE_LEFT_ARROW)
{
operator = new CDoubleArrow();
props =
{
location: this.loc,
turn: TURN_0
};
operator.init(props);
}
else if(code === 0x21D2 || type === DOUBLE_RIGHT_ARROW)
{
operator = new CDoubleArrow();
props =
{
location: this.loc,
turn: TURN_180
};
operator.init(props);
}
else if(code === 0x21D4 || type === DOUBLE_ARROW_LR)
{
operator = new CLR_DoubleArrow();
props =
{
location: this.loc,
turn: TURN_0
};
operator.init(props);
}
///// accents /////
else if(code === 0x20D6 || type === ACCENT_ARROW_LEFT)
{
operator = new CCombiningArrow();
props =
{
location: LOCATION_TOP,
turn: TURN_0
};
operator.init(props);
accent = new COperator(operator);
}
else if(code === 0x20D7 || type === ACCENT_ARROW_RIGHT)
{
operator = new CCombiningArrow();
props =
{
location: LOCATION_TOP,
turn: TURN_180
};
operator.init(props);
accent = new COperator(operator);
}
else if(code === 0x20E1 || type === ACCENT_ARROW_LR)
{
operator = new CCombining_LR_Arrow();
props =
{
location: LOCATION_TOP,
turn: TURN_0
};
operator.init(props);
accent = new COperator(operator);
}
else if(code === 0x20D0 || type === ACCENT_HALF_ARROW_LEFT)
{
operator = new CCombiningHalfArrow();
props =
{
location: LOCATION_TOP,
turn: TURN_0
};
operator.init(props);
accent = new COperator(operator);
}
else if(code === 0x20D1 || type === ACCENT_HALF_ARROW_RIGHT)
{
operator = new CCombiningHalfArrow();
props =
{
location: LOCATION_TOP,
turn: TURN_180
};
operator.init(props);
accent = new COperator(operator);
}
/////
else if(typeof(code) !=="undefined" && code !== null)
{
operator = new CMathText(true);
operator.add(code);
}
else
{
operator = new COperatorBracket();
props =
{
location: LOCATION_BOT,
turn: TURN_MIRROR_0
};
operator.init(props);
}
return operator;
}
CGroupCharacter.prototype.getPropsForWrite = function()
{
return this.Pr;
......
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