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

1. Удаление Script, Limit

2. Удаление нижнего и верхнего итераторов у степени
3. Рефакторинг

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@68159 954022d7-b5bf-4e40-9824-e11837661b57
parent ad6d462b
...@@ -1583,10 +1583,8 @@ ParaMath.prototype.Add_ToContent = function(Pos, Item, UpdatePosition) ...@@ -1583,10 +1583,8 @@ ParaMath.prototype.Add_ToContent = function(Pos, Item, UpdatePosition)
}; };
ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функция для контекстного меню ParaMath.prototype.Load_PropsFromMenu_2 = function(Pr) //тестовая функция для контекстного меню
{ {
var Pr = this.Get_MenuProps();
var PrevState = TEST_PREV_STATE_MENU; var PrevState = TEST_PREV_STATE_MENU;
var TypeMathMenu, Gap; var TypeMathMenu, Gap;
...@@ -1621,15 +1619,6 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ ...@@ -1621,15 +1619,6 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ
TEST_PREV_STATE_MENU = c_oAscMathMenuTypes.DeleteElement; TEST_PREV_STATE_MENU = c_oAscMathMenuTypes.DeleteElement;
} }
/*if(Pr.HideDegree !== undefined && PrevState !== c_oAscMathMenuTypes.RadicalHideDegree)
TypeMathMenu = c_oAscMathMenuTypes.RadicalHideDegree;
else if(PrevState !== c_oAscMathMenuTypes.IncreaseArgSize)
TypeMathMenu = c_oAscMathMenuTypes.IncreaseArgSize;
else
TypeMathMenu = c_oAscMathMenuTypes.DeleteElement;
this.Root.Load_PropsFromMenu(TypeMathMenu);*/
break; break;
} }
case c_oAscMathInterfaceType.LargeOperator: case c_oAscMathInterfaceType.LargeOperator:
...@@ -1705,7 +1694,6 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ ...@@ -1705,7 +1694,6 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ
TypeMathMenu = c_oAscMathMenuTypes.DelimiterRemoveContent; TypeMathMenu = c_oAscMathMenuTypes.DelimiterRemoveContent;
}*/ }*/
this.Root.Load_PropsFromMenu(TypeMathMenu);
break; break;
} }
...@@ -1727,8 +1715,6 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ ...@@ -1727,8 +1715,6 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ
} }
} }
this.Root.Load_PropsFromMenu(c_oAscMathMenuTypes.DeleteElement);
break; break;
} }
case c_oAscMathInterfaceType.Limit: case c_oAscMathInterfaceType.Limit:
...@@ -1755,8 +1741,6 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ ...@@ -1755,8 +1741,6 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ
TypeMathMenu = c_oAscMathMenuTypes.IncreaseArgSize; TypeMathMenu = c_oAscMathMenuTypes.IncreaseArgSize;
} }
this.Root.Load_PropsFromMenu(TypeMathMenu);
break; break;
} }
case c_oAscMathInterfaceType.BorderBox: case c_oAscMathInterfaceType.BorderBox:
...@@ -1794,8 +1778,6 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ ...@@ -1794,8 +1778,6 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ
TypeMathMenu = c_oAscMathMenuTypes.BorderBoxHideTop; TypeMathMenu = c_oAscMathMenuTypes.BorderBoxHideTop;
} }
this.Root.Load_PropsFromMenu(TypeMathMenu);
break; break;
} }
case c_oAscMathInterfaceType.Matrix: case c_oAscMathInterfaceType.Matrix:
...@@ -1932,8 +1914,6 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ ...@@ -1932,8 +1914,6 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ
TypeMathMenu = c_oAscMathMenuTypes.MatrixRemoveColumn; TypeMathMenu = c_oAscMathMenuTypes.MatrixRemoveColumn;
} }
this.Root.Load_PropsFromMenu(TypeMathMenu, Gap);
break; break;
} }
case c_oAscMathInterfaceType.EqArray: case c_oAscMathInterfaceType.EqArray:
...@@ -1996,8 +1976,6 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ ...@@ -1996,8 +1976,6 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ
TypeMathMenu = c_oAscMathMenuTypes.EqArrayRowOneAndHalfGap; TypeMathMenu = c_oAscMathMenuTypes.EqArrayRowOneAndHalfGap;
} }
this.Root.Load_PropsFromMenu(c_oAscMathMenuTypes.EqArrayRemoveRow);
break; break;
} }
case c_oAscMathInterfaceType.Script: case c_oAscMathInterfaceType.Script:
...@@ -2018,16 +1996,31 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ ...@@ -2018,16 +1996,31 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ
TypeMathMenu = c_oAscMathMenuTypes.DeleteElement; TypeMathMenu = c_oAscMathMenuTypes.DeleteElement;
}*/ }*/
if(PrevState == c_oAscMathMenuTypes.IncreaseArgSize) /*if(PrevState == c_oAscMathMenuTypes.IncreaseArgSize)
{ {
TypeMathMenu = c_oAscMathMenuTypes.DecreaseArgSize; TypeMathMenu = c_oAscMathMenuTypes.DecreaseArgSize;
} }
else else
{ {
TypeMathMenu = c_oAscMathMenuTypes.IncreaseArgSize; TypeMathMenu = c_oAscMathMenuTypes.IncreaseArgSize;
}*/
if(Pr.ScriptType == c_oAscMathInterfaceScript.SubSup)
{
if(PrevState !== c_oAscMathMenuTypes.DeleteSuperScript)
{
Pr.put_ScriptType(c_oAscMathInterfaceScript.Sup);
TEST_PREV_STATE_MENU = c_oAscMathMenuTypes.DeleteSuperScript;
}
else
{
Pr.put_ScriptType(c_oAscMathInterfaceScript.Sub);
TEST_PREV_STATE_MENU = c_oAscMathMenuTypes.DeleteSubScript;
}
} }
this.Root.Load_PropsFromMenu(TypeMathMenu);
break; break;
} }
case c_oAscMathInterfaceType.Bar: case c_oAscMathInterfaceType.Bar:
...@@ -2045,12 +2038,10 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ ...@@ -2045,12 +2038,10 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ
TypeMathMenu = c_oAscMathMenuTypes.DeleteElement; TypeMathMenu = c_oAscMathMenuTypes.DeleteElement;
} }
this.Root.Load_PropsFromMenu(TypeMathMenu);
break; break;
} }
case c_oAscMathInterfaceType.Accent: case c_oAscMathInterfaceType.Accent:
{ {
this.Root.Load_PropsFromMenu(c_oAscMathMenuTypes.DeleteElement);
break; break;
} }
case c_oAscMathInterfaceType.Box: case c_oAscMathInterfaceType.Box:
...@@ -2064,7 +2055,6 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ ...@@ -2064,7 +2055,6 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ
TypeMathMenu = c_oAscMathMenuTypes.IncreaseArgSize; TypeMathMenu = c_oAscMathMenuTypes.IncreaseArgSize;
} }
this.Root.Load_PropsFromMenu(TypeMathMenu);
break; break;
} }
} }
...@@ -2073,12 +2063,6 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ ...@@ -2073,12 +2063,6 @@ ParaMath.prototype.Load_PropsFromMenu_2 = function() //тестовая функ
}; };
ParaMath.prototype.Load_PropsFromMenu = function(Props)
{
if(Props != undefined)
this.Root.Load_PropsFromMenu(Props);
};
ParaMath.prototype.Get_MenuProps = function() ParaMath.prototype.Get_MenuProps = function()
{ {
return this.Root.Get_MenuProps(); return this.Root.Get_MenuProps();
......
...@@ -646,10 +646,6 @@ CAccent.prototype.GetLastElement = function() ...@@ -646,10 +646,6 @@ CAccent.prototype.GetLastElement = function()
{ {
return this.Content[0].GetLastElement(); return this.Content[0].GetLastElement();
}; };
CAccent.prototype.Can_Delete = function()
{
return true;
};
CAccent.prototype.Is_SimpleDelete = function() CAccent.prototype.Is_SimpleDelete = function()
{ {
return true; return true;
......
...@@ -2634,29 +2634,13 @@ CMathBase.prototype.Get_MenuProps = function() ...@@ -2634,29 +2634,13 @@ CMathBase.prototype.Get_MenuProps = function()
} }
else else
{ {
Pr = this.Get_ObjectPropsForMenu(); Pr = this.Get_InterfaceProps();
} }
return Pr; return Pr;
}; };
CMathBase.prototype.Apply_MenuProps = function() CMathBase.prototype.Apply_MenuProps = function()
{}; {};
CMathBase.prototype.Can_Delete = function()
{
return false;
};
CMathBase.prototype.Is_DeletedItem = function(Type)
{
return Type == c_oAscMathMenuTypes.DeleteElement && true === this.Can_Delete();
};
CMathBase.prototype.Can_DeleteSubScript = function()
{
return false;
};
CMathBase.prototype.Can_DeleteSuperScript = function()
{
return false;
};
CMathBase.prototype.Get_DeletedItemsThroughInterface = function() CMathBase.prototype.Get_DeletedItemsThroughInterface = function()
{ {
var DeletedItems = null; var DeletedItems = null;
...@@ -2689,29 +2673,6 @@ CMathBase.prototype.Get_DeletedItemsThroughInterface = function() ...@@ -2689,29 +2673,6 @@ CMathBase.prototype.Get_DeletedItemsThroughInterface = function()
return DeletedItems; return DeletedItems;
}; };
CMathBase.prototype.Get_ObjectPropsForMenu = function()
{
var Pr = this.Get_InterfaceProps();
if(Pr == null)
Pr = {};
if(true === this.Can_ModifyArgSize())
{
var CompiledArgSize = this.Content[this.CurPos].Get_CompiledArgSize();
Pr.bCanDecrease = CompiledArgSize.Can_Decrease();
Pr.bCanIncrease = CompiledArgSize.Can_Increase();
}
else
{
Pr.bCanDecrease = false;
Pr.bCanIncrease = false;
}
Pr.bCanDelete = this.Can_Delete();
return Pr;
};
CMathBase.prototype.Can_DecreaseArgumentSize = function() CMathBase.prototype.Can_DecreaseArgumentSize = function()
{ {
var bDecreaseArgSize = false; var bDecreaseArgSize = false;
......
...@@ -1017,10 +1017,6 @@ CBar.prototype.raw_SetLinePos = function(Value) ...@@ -1017,10 +1017,6 @@ CBar.prototype.raw_SetLinePos = function(Value)
this.RecalcInfo.bProps = true; this.RecalcInfo.bProps = true;
this.ApplyProperties(); this.ApplyProperties();
}; };
CBar.prototype.Can_Delete = function()
{
return true;
};
CBar.prototype.Is_SimpleDelete = function() CBar.prototype.Is_SimpleDelete = function()
{ {
return true; return true;
......
...@@ -499,10 +499,6 @@ CDegree.prototype.setPosition = function(pos, PosInfo) ...@@ -499,10 +499,6 @@ CDegree.prototype.setPosition = function(pos, PosInfo)
CMathBase.prototype.setPosition.call(this, pos, PosInfo); CMathBase.prototype.setPosition.call(this, pos, PosInfo);
} }
}; };
CDegree.prototype.Can_Delete = function()
{
return true;
};
CDegree.prototype.Is_SimpleDelete = function() CDegree.prototype.Is_SimpleDelete = function()
{ {
return true; return true;
...@@ -1125,18 +1121,6 @@ CDegreeSubSup.prototype.protected_GetRangeEndPos = function(CurLine, CurRange) ...@@ -1125,18 +1121,6 @@ CDegreeSubSup.prototype.protected_GetRangeEndPos = function(CurLine, CurRange)
return this.Need_Iters(_CurLine, _CurRange) ? 2 : 0; return this.Need_Iters(_CurLine, _CurRange) ? 2 : 0;
}; };
CDegreeSubSup.prototype.Can_DeleteSubScript = function()
{
return this.Pr.type == DEGREE_SubSup;
};
CDegreeSubSup.prototype.Can_DeleteSuperScript = function()
{
return this.Pr.type == DEGREE_SubSup;
};
CDegreeSubSup.prototype.Can_Delete = function()
{
return this.Pr.type == DEGREE_PreSubSup;
};
CDegreeSubSup.prototype.Is_SimpleDelete = function() CDegreeSubSup.prototype.Is_SimpleDelete = function()
{ {
return true; return true;
......
...@@ -285,10 +285,6 @@ CLimit.prototype.raw_SetType = function(Value) ...@@ -285,10 +285,6 @@ CLimit.prototype.raw_SetType = function(Value)
this.ApplyProperties(); this.ApplyProperties();
} }
}; };
CLimit.prototype.Can_Delete = function()
{
return true;
};
CLimit.prototype.Is_SimpleDelete = function() CLimit.prototype.Is_SimpleDelete = function()
{ {
return true; return true;
......
...@@ -4807,10 +4807,27 @@ CMathContent.prototype.Delete_ItemToContentThroughInterface = function(Props, Po ...@@ -4807,10 +4807,27 @@ CMathContent.prototype.Delete_ItemToContentThroughInterface = function(Props, Po
bDelete = true; bDelete = true;
}*/ }*/
if(Item.kind == MATH_DEGREESubSup && Item.Pr.type == DEGREE_SubSup && Props.Type == c_oAscMathInterfaceType.Script)
{
if(Props.ScriptType == c_oAscMathInterfaceScript.Sup)
{
this.private_AddModifiedDegree(Pos, DEGREE_SUPERSCRIPT);
bDelete = true;
}
else if(Props.ScriptType == c_oAscMathInterfaceScript.Sub)
{
this.private_AddModifiedDegree(Pos, DEGREE_SUBSCRIPT);
bDelete = true;
}
}
var RemoveChar = Props.Action & c_oMathMenuAction.RemoveAccentCharacter && Item.kind == MATH_ACCENT, var RemoveChar = Props.Action & c_oMathMenuAction.RemoveAccentCharacter && Item.kind == MATH_ACCENT,
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),
RemoveLimit = Props.Type == c_oAscMathInterfaceType.Limit && Props.Pos == c_oAscMathInterfaceLimitPos.None && Item.kind === MATH_LIMIT,
//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,
//RemoveEqArray = Props.Action & c_oMathMenuAction.RemoveEqArray && Item.kind == MATH_EQ_ARRAY, //RemoveEqArray = Props.Action & c_oMathMenuAction.RemoveEqArray && Item.kind == MATH_EQ_ARRAY,
RemoveDelimiter = Props.Action & c_oMathMenuAction.RemoveDelimiter && Item.kind == MATH_DELIMITER, RemoveDelimiter = Props.Action & c_oMathMenuAction.RemoveDelimiter && Item.kind == MATH_DELIMITER,
...@@ -4819,7 +4836,7 @@ CMathContent.prototype.Delete_ItemToContentThroughInterface = function(Props, Po ...@@ -4819,7 +4836,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 || RemoveDelimiter || RemoveGroupChar || RemoveRadical || RemoveBox) if(RemoveChar || RemoveBar || RemoveScript || RemoveLimit || RemoveDelimiter || RemoveGroupChar || RemoveRadical || RemoveBox)
{ {
var Items = this.Content[Pos].Get_DeletedItemsThroughInterface(); var Items = this.Content[Pos].Get_DeletedItemsThroughInterface();
...@@ -4866,7 +4883,7 @@ CMathContent.prototype.Get_MenuProps = function() ...@@ -4866,7 +4883,7 @@ CMathContent.prototype.Get_MenuProps = function()
if(true === this.Selection.Use && StartPos !== EndPos) if(true === this.Selection.Use && StartPos !== EndPos)
{ {
Pr = this.Content[Pos].Get_ObjectPropsForMenu(); Pr = this.Content[Pos].Get_InterfaceProps();
} }
else if(this.Content[Pos].Type == para_Math_Composition) else if(this.Content[Pos].Type == para_Math_Composition)
{ {
......
...@@ -1769,10 +1769,6 @@ CEqArray.prototype.Get_InterfaceProps = function() ...@@ -1769,10 +1769,6 @@ CEqArray.prototype.Get_InterfaceProps = function()
{ {
return new CMathMenuEqArray(this); return new CMathMenuEqArray(this);
}; };
CEqArray.prototype.Can_Delete = function()
{
return true;
};
CEqArray.prototype.Is_SimpleDelete = function() CEqArray.prototype.Is_SimpleDelete = function()
{ {
return false; return false;
......
...@@ -4012,10 +4012,6 @@ CDelimiter.prototype.raw_HideEndOperator = function(Value) ...@@ -4012,10 +4012,6 @@ CDelimiter.prototype.raw_HideEndOperator = function(Value)
this.RecalcInfo.bProps = true; this.RecalcInfo.bProps = true;
this.ApplyProperties(); this.ApplyProperties();
}; };
CDelimiter.prototype.Can_Delete = function()
{
return true;
};
CDelimiter.prototype.Is_SimpleDelete = function() CDelimiter.prototype.Is_SimpleDelete = function()
{ {
return false; return false;
...@@ -4514,10 +4510,6 @@ CGroupCharacter.prototype.old_Apply_MenuProps = function(Type) ...@@ -4514,10 +4510,6 @@ CGroupCharacter.prototype.old_Apply_MenuProps = function(Type)
this.private_InversePr(); this.private_InversePr();
} }
}; };
CGroupCharacter.prototype.Can_Delete = function()
{
return true;
};
CGroupCharacter.prototype.Is_SimpleDelete = function() CGroupCharacter.prototype.Is_SimpleDelete = function()
{ {
return true; return true;
......
...@@ -718,10 +718,6 @@ CRadical.prototype.raw_SetHideDegree = function(Value) ...@@ -718,10 +718,6 @@ CRadical.prototype.raw_SetHideDegree = function(Value)
} }
} }
}; };
CRadical.prototype.Can_Delete = function()
{
return true;
};
CRadical.prototype.Is_SimpleDelete = function() CRadical.prototype.Is_SimpleDelete = function()
{ {
return true; return true;
......
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