Commit fec0a1b1 authored by Anna.Pavlova's avatar Anna.Pavlova

Удаление/добавление строк в EqArray

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@68206 954022d7-b5bf-4e40-9824-e11837661b57
parent 97aa4ccd
...@@ -4843,6 +4843,7 @@ CMathContent.prototype.Delete_ItemToContentThroughInterface = function(Props, Po ...@@ -4843,6 +4843,7 @@ CMathContent.prototype.Delete_ItemToContentThroughInterface = function(Props, Po
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), RemoveMatrix = Props.Type == c_oAscMathInterfaceType.Matrix && this.Content[Pos].Is_DeletedItem(Props.Action),
RemoveEqArray = Props.Type == c_oAscMathInterfaceType.EqArray && 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,
...@@ -4853,7 +4854,7 @@ CMathContent.prototype.Delete_ItemToContentThroughInterface = function(Props, Po ...@@ -4853,7 +4854,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 || RemoveMatrix || RemoveDelimiter || RemoveGroupChar || RemoveRadical || RemoveBox) if(RemoveChar || RemoveBar || RemoveScript || RemoveLimit || RemoveMatrix || RemoveEqArray || RemoveDelimiter || RemoveGroupChar || RemoveRadical || RemoveBox)
{ {
var Items = this.Content[Pos].Get_DeletedItemsThroughInterface(); var Items = this.Content[Pos].Get_DeletedItemsThroughInterface();
......
...@@ -1730,6 +1730,23 @@ CEqArray.prototype.Apply_MenuProps = function(Props) ...@@ -1730,6 +1730,23 @@ CEqArray.prototype.Apply_MenuProps = function(Props)
} }
} }
} }
if(Props.Action & c_oMathMenuAction.DeleteEquation && this.getRowsCount() > 1)
{
this.Remove_Row(this.CurPos);
}
if(Props.Action & c_oMathMenuAction.InsertEquation)
{
if(Props.Action & c_oMathMenuAction.InsertBefore)
{
this.Add_Row(this.CurPos);
}
else
{
this.Add_Row(this.CurPos + 1);
}
}
} }
}; };
...@@ -1750,7 +1767,7 @@ CEqArray.prototype.old_Apply_MenuProps = function(Type, Gap) ...@@ -1750,7 +1767,7 @@ CEqArray.prototype.old_Apply_MenuProps = function(Type, Gap)
case c_oAscMathMenuTypes.EqArrayRemoveRow: case c_oAscMathMenuTypes.EqArrayRemoveRow:
{ {
if(this.getRowsCount() > 1) if(this.getRowsCount() > 1)
this.Remove_Row(this.CurPos); this.Remove_Row(this.CurPos);
break; break;
} }
case c_oAscMathMenuTypes.EqArrayBaseJcCenter: case c_oAscMathMenuTypes.EqArrayBaseJcCenter:
...@@ -1809,9 +1826,9 @@ CEqArray.prototype.Is_SimpleDelete = function() ...@@ -1809,9 +1826,9 @@ CEqArray.prototype.Is_SimpleDelete = function()
{ {
return false; return false;
}; };
CEqArray.prototype.Is_DeletedItem = function(Type) CEqArray.prototype.Is_DeletedItem = function(Action)
{ {
return c_oAscMathMenuTypes.EqArrayRemoveRow == Type && 1 == this.getRowsCount(); return Action & c_oMathMenuAction.DeleteEquation && 1 == this.getRowsCount();
}; };
CEqArray.prototype.Get_DeletedItemsThroughInterface = function() CEqArray.prototype.Get_DeletedItemsThroughInterface = 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