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

1. Поправлен баг : из меню при создании CMathMenuLimit параметр limit приходил...

1. Поправлен баг : из меню при создании CMathMenuLimit параметр limit приходил undefined, этого не было предусмотрено
2. Поправлено падание: после вставки из меню единичной матрицы и удаления первой строки возвращалась неверная позиция функцией Get_ParaContentPos, т.к. в меню при добавлении элементов через Add_Element CurPos всегда увеличивается(изначально this.CurPos = 0 и при добавлении первого элемента будет указывать на несуществующую позицию 1 в контента). Добавлена функция корректировки позиций контентов Correct_ContentCurPos

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@68202 954022d7-b5bf-4e40-9824-e11837661b57
parent 63cc6ff0
...@@ -1080,6 +1080,7 @@ ParaMath.prototype.Add = function(Item) ...@@ -1080,6 +1080,7 @@ ParaMath.prototype.Add = function(Item)
var lng = oContent.Content.length; var lng = oContent.Content.length;
oContent.Load_FromMenu(Item.Menu, this.Paragraph); oContent.Load_FromMenu(Item.Menu, this.Paragraph);
oContent.Correct_ContentCurPos();
var lng2 = oContent.Content.length; var lng2 = oContent.Content.length;
var Pos_ApplyTextPr = var Pos_ApplyTextPr =
...@@ -3013,12 +3014,6 @@ ParaMath.prototype.GetPlh = function(oMeasure, font) ...@@ -3013,12 +3014,6 @@ ParaMath.prototype.GetPlh = function(oMeasure, font)
return oMeasure.Measure2Code(0x2B1A).Height; return oMeasure.Measure2Code(0x2B1A).Height;
}; };
ParaMath.prototype.GetA = function(oMeasure, font)
{
oMeasure.SetFont(font);
return oMeasure.Measure2Code(0x61).Height;
};
ParaMath.prototype.SetMathProperties = function(props) ParaMath.prototype.SetMathProperties = function(props)
{ {
......
...@@ -2717,6 +2717,13 @@ CMathBase.prototype.Can_DeleteManualBreak = function() ...@@ -2717,6 +2717,13 @@ CMathBase.prototype.Can_DeleteManualBreak = function()
{ {
return false; return false;
}; };
CMathBase.prototype.Correct_ContentCurPos = function()
{
for(var Pos = 0; Pos < this.Content.length; Pos++)
{
this.Content[Pos].Correct_ContentCurPos();
}
};
CMathBase.prototype.Math_Set_EmptyRange = CMathContent.prototype.Math_Set_EmptyRange; CMathBase.prototype.Math_Set_EmptyRange = CMathContent.prototype.Math_Set_EmptyRange;
CMathBase.prototype.Set_ParaMath = CMathContent.prototype.Set_ParaMath; CMathBase.prototype.Set_ParaMath = CMathContent.prototype.Set_ParaMath;
CMathBase.prototype.Recalculate_Reset = CMathContent.prototype.Recalculate_Reset; CMathBase.prototype.Recalculate_Reset = CMathContent.prototype.Recalculate_Reset;
......
...@@ -306,11 +306,14 @@ function CMathMenuLimit(Limit) ...@@ -306,11 +306,14 @@ function CMathMenuLimit(Limit)
this.Type = c_oAscMathInterfaceType.Limit; this.Type = c_oAscMathInterfaceType.Limit;
if (undefined !== Limit.Pr) if (undefined !== Limit)
{
this.Pos = (LIMIT_LOW === Limit.Pr.type) ? c_oAscMathInterfaceLimitPos.Bottom : c_oAscMathInterfaceLimitPos.Top; this.Pos = (LIMIT_LOW === Limit.Pr.type) ? c_oAscMathInterfaceLimitPos.Bottom : c_oAscMathInterfaceLimitPos.Top;
}
else else
{
this.Pos = undefined; this.Pos = undefined;
}
} }
Asc.extendClass(CMathMenuLimit, CMathMenuBase); Asc.extendClass(CMathMenuLimit, CMathMenuBase);
......
...@@ -1709,6 +1709,16 @@ CMathContent.prototype.private_CorrectCurPos = function() ...@@ -1709,6 +1709,16 @@ CMathContent.prototype.private_CorrectCurPos = function()
this.Content[this.CurPos].Cursor_MoveToStartPos(); this.Content[this.CurPos].Cursor_MoveToStartPos();
} }
}; };
CMathContent.prototype.Correct_ContentCurPos = function()
{
this.private_CorrectCurPos();
for(var Pos = 0; Pos < this.Content.length; Pos++)
{
if(this.Content[Pos].Type == para_Math_Composition)
this.Content[Pos].Correct_ContentCurPos();
}
};
CMathContent.prototype.SplitContent = function(NewContent, ContentPos, Depth) CMathContent.prototype.SplitContent = function(NewContent, ContentPos, Depth)
{ {
var Pos = ContentPos.Get(Depth); var Pos = ContentPos.Get(Depth);
...@@ -4832,6 +4842,7 @@ CMathContent.prototype.Delete_ItemToContentThroughInterface = function(Props, Po ...@@ -4832,6 +4842,7 @@ CMathContent.prototype.Delete_ItemToContentThroughInterface = function(Props, Po
RemoveBar = Props.Action & c_oMathMenuAction.RemoveBar && Item.kind == MATH_BAR, RemoveBar = Props.Action & c_oMathMenuAction.RemoveBar && Item.kind == MATH_BAR,
RemoveScript = Props.Type == c_oAscMathInterfaceType.Script && Props.ScriptType == c_oAscMathInterfaceScript.None && (Item.kind == MATH_DEGREESubSup || Item.kind == MATH_DEGREE), RemoveScript = Props.Type == c_oAscMathInterfaceType.Script && Props.ScriptType == c_oAscMathInterfaceScript.None && (Item.kind == MATH_DEGREESubSup || Item.kind == MATH_DEGREE),
RemoveLimit = Props.Type == c_oAscMathInterfaceType.Limit && Props.Pos == c_oAscMathInterfaceLimitPos.None && Item.kind === MATH_LIMIT, RemoveLimit = Props.Type == c_oAscMathInterfaceType.Limit && Props.Pos == c_oAscMathInterfaceLimitPos.None && Item.kind === MATH_LIMIT,
RemoveMatrix = Props.Type == c_oAscMathInterfaceType.Matrix && this.Content[Pos].Is_DeletedItem(Props.Action),
//RemovePreSubSup = Props.Action & c_oMathMenuAction.RemoveScript && Item.kind == MATH_DEGREESubSup && Item.Pr.type == DEGREE_PreSubSup, //RemovePreSubSup = Props.Action & c_oMathMenuAction.RemoveScript && Item.kind == MATH_DEGREESubSup && Item.Pr.type == DEGREE_PreSubSup,
//RemoveDegree = Props.Action & c_oMathMenuAction.RemoveScript && Item.kind == MATH_DEGREE, //RemoveDegree = Props.Action & c_oMathMenuAction.RemoveScript && Item.kind == MATH_DEGREE,
//RemoveLimit = Props.Action & c_oMathMenuAction.RemoveLimit && Item.kind == MATH_LIMIT, //RemoveLimit = Props.Action & c_oMathMenuAction.RemoveLimit && Item.kind == MATH_LIMIT,
...@@ -4842,7 +4853,7 @@ CMathContent.prototype.Delete_ItemToContentThroughInterface = function(Props, Po ...@@ -4842,7 +4853,7 @@ CMathContent.prototype.Delete_ItemToContentThroughInterface = function(Props, Po
RemoveBox = Props.Action & c_oMathMenuAction.RemoveBox && Item.kind == MATH_BOX; RemoveBox = Props.Action & c_oMathMenuAction.RemoveBox && Item.kind == MATH_BOX;
if(RemoveChar || RemoveBar || RemoveScript || RemoveLimit || RemoveDelimiter || RemoveGroupChar || RemoveRadical || RemoveBox) if(RemoveChar || RemoveBar || RemoveScript || RemoveLimit || RemoveMatrix || RemoveDelimiter || RemoveGroupChar || RemoveRadical || RemoveBox)
{ {
var Items = this.Content[Pos].Get_DeletedItemsThroughInterface(); var Items = this.Content[Pos].Get_DeletedItemsThroughInterface();
......
...@@ -1190,13 +1190,13 @@ CMathMatrix.prototype.raw_Set_MinColumnWidth = function(Value) ...@@ -1190,13 +1190,13 @@ CMathMatrix.prototype.raw_Set_MinColumnWidth = function(Value)
this.Pr.cSp = Value; this.Pr.cSp = Value;
this.Set_RuleGap(this.SpaceColumn, this.Pr.cGpRule, this.Pr.cGp, Value); this.Set_RuleGap(this.SpaceColumn, this.Pr.cGpRule, this.Pr.cGp, Value);
}; };
CMathMatrix.prototype.Is_DeletedItem = function(Type) CMathMatrix.prototype.Is_DeletedItem = function(Action)
{ {
var bDeleteMatrix = false; var bDeleteMatrix = false;
if( c_oAscMathMenuTypes.MatrixRemoveRow == Type && 1 == this.getRowsCount()) if( c_oMathMenuAction.DeleteMatrixRow == Action && 1 == this.getRowsCount())
bDeleteMatrix = true; bDeleteMatrix = true;
else if(c_oAscMathMenuTypes.MatrixRemoveColumn == Type && 1 == this.getColsCount()) else if(c_oMathMenuAction.DeleteMatrixColumn == Action && 1 == this.getColsCount())
bDeleteMatrix = true; bDeleteMatrix = true;
return bDeleteMatrix; return bDeleteMatrix;
......
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