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

1. Поправлен баг с передачей свойств Nary для контекстного меню

2. Поправлен BorderBox HideTopRTL
3. Удалены лишние функции

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@68210 954022d7-b5bf-4e40-9824-e11837661b57
parent 1b629679
...@@ -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.Is_SimpleDelete = function()
{
return true;
};
CAccent.prototype.Get_InterfaceProps = function() CAccent.prototype.Get_InterfaceProps = function()
{ {
return new CMathMenuAccent(this); return new CMathMenuAccent(this);
......
...@@ -2643,33 +2643,8 @@ CMathBase.prototype.Apply_MenuProps = function() ...@@ -2643,33 +2643,8 @@ CMathBase.prototype.Apply_MenuProps = function()
{}; {};
CMathBase.prototype.Get_DeletedItemsThroughInterface = function() CMathBase.prototype.Get_DeletedItemsThroughInterface = function()
{ {
var DeletedItems = null;
if(true == this.Is_SimpleDelete())
{
var baseContent = this.getBase(); var baseContent = this.getBase();
DeletedItems = baseContent !== null ? baseContent.Content : null; var DeletedItems = baseContent !== null ? baseContent.Content : null;
}
else if(this.Content.length > 0)
{
DeletedItems = this.Content[0].Content;
for(var Pos = 1; Pos < this.Content.length; Pos++)
{
var NewSpace = new CMathText(false);
NewSpace.add(0x20);
var CtrPrp = this.Get_CtrPrp();
var NewRun = new ParaRun(this.ParaMath.Paragraph, true);
NewRun.Apply_Pr(CtrPrp);
NewRun.Concat_ToContent( [NewSpace] );
DeletedItems = DeletedItems.concat(NewRun);
var Items = this.Content[Pos].Content;
DeletedItems = DeletedItems.concat(Items);
}
}
return DeletedItems; return DeletedItems;
}; };
...@@ -3046,8 +3021,7 @@ var c_oMathMenuAction = { ...@@ -3046,8 +3021,7 @@ var c_oMathMenuAction = {
AlignToCharacter : 0x00008000, AlignToCharacter : 0x00008000,
RemoveDelimiter : 0x00010000, RemoveDelimiter : 0x00010000,
RemoveGroupChar : 0x00020000, RemoveGroupChar : 0x00020000,
RemoveRadical : 0x00040000, RemoveRadical : 0x00040000
RemoveBox : 0x00080000
}; };
...@@ -3181,10 +3155,6 @@ CMathMenuBase.prototype.remove_Radical = function() ...@@ -3181,10 +3155,6 @@ CMathMenuBase.prototype.remove_Radical = function()
{ {
this.Action |= c_oMathMenuAction.RemoveRadical; this.Action |= c_oMathMenuAction.RemoveRadical;
}; };
CMathMenuBase.prototype.remove_Box = function()
{
this.Action |= c_oMathMenuAction.RemoveBox;
};
window["CMathMenuBase"] = CMathMenuBase; window["CMathMenuBase"] = CMathMenuBase;
CMathMenuBase.prototype["get_Type"] = CMathMenuBase.prototype.get_Type; CMathMenuBase.prototype["get_Type"] = CMathMenuBase.prototype.get_Type;
......
...@@ -470,66 +470,12 @@ CBorderBox.prototype.Apply_MenuProps = function(Props) ...@@ -470,66 +470,12 @@ CBorderBox.prototype.Apply_MenuProps = function(Props)
this.raw_SetTopLTR(!Props.HideTopLTR ); this.raw_SetTopLTR(!Props.HideTopLTR );
} }
if(Props.HideTopRTL !== undefined && Props.HideTopRTL !== this.Pr.strikeBLTR) if(Props.HideTopRTL !== undefined && Props.HideTopRTL == this.Pr.strikeBLTR)
{ {
History.Add(this, new CChangesMathBorderBoxTopRTL(!Props.HideTopRTL, this.Pr.strikeBLTR)); // strikeBLTR - нарисовать диагональ из нижнего угла слева направо History.Add(this, new CChangesMathBorderBoxTopRTL(!Props.HideTopRTL, this.Pr.strikeBLTR)); // strikeBLTR - нарисовать диагональ из нижнего угла слева направо
this.raw_SetTopRTL(!this.Pr.strikeBLTR); this.raw_SetTopRTL(!Props.HideTopRTL);
} }
} }
/*switch(Type)
{
case c_oAscMathMenuTypes.BorderBoxHideTop:
{
History.Add(this, new CChangesMathBorderBoxTop(!this.Pr.hideTop, this.Pr.hideTop));
this.raw_SetTop(!this.Pr.hideTop);
break;
}
case c_oAscMathMenuTypes.BorderBoxHideBot:
{
History.Add(this, new CChangesMathBorderBoxBot(!this.Pr.hideBot, this.Pr.hideBot));
this.raw_SetBot(!this.Pr.hideBot);
break;
}
case c_oAscMathMenuTypes.BorderBoxHideLeft:
{
History.Add(this, new CChangesMathBorderBoxLeft(!this.Pr.hideLeft, this.Pr.hideLeft));
this.raw_SetLeft(!this.Pr.hideLeft);
break;
}
case c_oAscMathMenuTypes.BorderBoxHideRight:
{
History.Add(this, new CChangesMathBorderBoxRight(!this.Pr.hideRight, this.Pr.hideRight));
this.raw_SetRight(!this.Pr.hideRight);
break;
}
case c_oAscMathMenuTypes.BorderBoxStrikeHor:
{
History.Add(this, new CChangesMathBorderBoxHor(!this.Pr.strikeH, this.Pr.strikeH));
this.raw_SetHor(!this.Pr.strikeH);
break;
}
case c_oAscMathMenuTypes.BorderBoxStrikeVer:
{
History.Add(this, new CChangesMathBorderBoxVer(!this.Pr.strikeV, this.Pr.strikeV));
this.raw_SetVer(!this.Pr.strikeV);
break;
}
case c_oAscMathMenuTypes.BorderBoxStrikeTopLTR:
{
History.Add(this, new CChangesMathBorderBoxTopLTR(!this.Pr.strikeTLBR, this.Pr.strikeTLBR));
this.raw_SetTopLTR(!this.Pr.strikeTLBR);
break;
}
case c_oAscMathMenuTypes.BorderBoxStrikeTopRTL:
{
History.Add(this, new CChangesMathBorderBoxTopRTL(!this.Pr.strikeBLTR, this.Pr.strikeBLTR));
this.raw_SetTopRTL(!this.Pr.strikeBLTR);
break;
}
}*/
}; };
CBorderBox.prototype.raw_SetTop = function(Value) CBorderBox.prototype.raw_SetTop = function(Value)
{ {
...@@ -995,17 +941,6 @@ CBar.prototype.Apply_MenuProps = function(Props) ...@@ -995,17 +941,6 @@ CBar.prototype.Apply_MenuProps = function(Props)
this.raw_SetLinePos(Pos); this.raw_SetLinePos(Pos);
} }
} }
/*if(Type == c_oAscMathMenuTypes.BarLineOver && this.Pr.pos == LOCATION_BOT)
{
History.Add(this, new CChangesMathBarLinePos(LOCATION_TOP, this.Pr.pos));
this.raw_SetLinePos(LOCATION_TOP);
}
else if(Type == c_oAscMathMenuTypes.BarLineUnder && this.Pr.pos == LOCATION_TOP)
{
History.Add(this, new CChangesMathBarLinePos(LOCATION_BOT, this.Pr.pos));
this.raw_SetLinePos(LOCATION_BOT);
}*/
}; };
CBar.prototype.Get_InterfaceProps = function() CBar.prototype.Get_InterfaceProps = function()
{ {
...@@ -1017,10 +952,6 @@ CBar.prototype.raw_SetLinePos = function(Value) ...@@ -1017,10 +952,6 @@ CBar.prototype.raw_SetLinePos = function(Value)
this.RecalcInfo.bProps = true; this.RecalcInfo.bProps = true;
this.ApplyProperties(); this.ApplyProperties();
}; };
CBar.prototype.Is_SimpleDelete = function()
{
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.Is_SimpleDelete = function()
{
return true;
};
CDegree.prototype.Get_InterfaceProps = function() CDegree.prototype.Get_InterfaceProps = function()
{ {
var Type = this.Pr.type == DEGREE_SUBSCRIPT ? c_oAscMathInterfaceScript.Sub : c_oAscMathInterfaceScript.Sup; var Type = this.Pr.type == DEGREE_SUBSCRIPT ? c_oAscMathInterfaceScript.Sub : c_oAscMathInterfaceScript.Sup;
...@@ -1121,10 +1117,6 @@ CDegreeSubSup.prototype.protected_GetRangeEndPos = function(CurLine, CurRange) ...@@ -1121,10 +1117,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.Is_SimpleDelete = function()
{
return true;
};
CDegreeSubSup.prototype.Get_InterfaceProps = function() CDegreeSubSup.prototype.Get_InterfaceProps = function()
{ {
var Type = this.Pr.type == DEGREE_PreSubSup ? c_oAscMathInterfaceScript.PreSubSup : c_oAscMathInterfaceScript.SubSup; var Type = this.Pr.type == DEGREE_PreSubSup ? c_oAscMathInterfaceScript.PreSubSup : c_oAscMathInterfaceScript.SubSup;
......
...@@ -506,38 +506,6 @@ CFraction.prototype.Apply_MenuProps = function(Props) ...@@ -506,38 +506,6 @@ CFraction.prototype.Apply_MenuProps = function(Props)
this.raw_SetFractionType(FractionType); this.raw_SetFractionType(FractionType);
} }
} }
/*var FractionType;
switch(Type)
{
case c_oAscMathMenuTypes.FractionBar:
{
FractionType = BAR_FRACTION;
break;
}
case c_oAscMathMenuTypes.FractionSkewed:
{
FractionType = SKEWED_FRACTION;
break;
}
case c_oAscMathMenuTypes.FractionLinear:
{
FractionType = LINEAR_FRACTION;
break;
}
case c_oAscMathMenuTypes.FractionNoBar:
{
FractionType = NO_BAR_FRACTION;
break;
}
}
if(FractionType !== undefined && FractionType !== this.Pr.type)
{
History.Add(this, new CChangesMathFractionType(FractionType, this.Pr.type));
this.raw_SetFractionType(FractionType);
}*/
}; };
CFraction.prototype.Get_InterfaceProps = function() CFraction.prototype.Get_InterfaceProps = function()
{ {
......
...@@ -261,16 +261,6 @@ CLimit.prototype.Apply_MenuProps = function(Props) ...@@ -261,16 +261,6 @@ CLimit.prototype.Apply_MenuProps = function(Props)
this.raw_SetType(Type); this.raw_SetType(Type);
} }
} }
/*if(Type == c_oAscMathMenuTypes.LimitOver && this.Pr.type == LIMIT_LOW)
{
History.Add(this, new CChangesMathLimitType(LIMIT_UP, this.Pr.type));
this.raw_SetType(LIMIT_UP);
}
else if(Type == c_oAscMathMenuTypes.LimitUnder && this.Pr.type == LIMIT_UP)
{
History.Add(this, new CChangesMathLimitType(LIMIT_LOW, this.Pr.type));
this.raw_SetType(LIMIT_LOW);
}*/
}; };
CLimit.prototype.Get_InterfaceProps = function() CLimit.prototype.Get_InterfaceProps = function()
{ {
...@@ -285,10 +275,6 @@ CLimit.prototype.raw_SetType = function(Value) ...@@ -285,10 +275,6 @@ CLimit.prototype.raw_SetType = function(Value)
this.ApplyProperties(); this.ApplyProperties();
} }
}; };
CLimit.prototype.Is_SimpleDelete = function()
{
return true;
};
CLimit.prototype.Can_ModifyArgSize = function() CLimit.prototype.Can_ModifyArgSize = function()
{ {
return this.CurPos == 1 && false === this.Is_SelectInside(); return this.CurPos == 1 && false === this.Is_SelectInside();
......
...@@ -4808,22 +4808,6 @@ CMathContent.prototype.Delete_ItemToContentThroughInterface = function(Props, Po ...@@ -4808,22 +4808,6 @@ CMathContent.prototype.Delete_ItemToContentThroughInterface = function(Props, Po
var bDelete = false; var bDelete = false;
var Item = this.Content[Pos]; var Item = this.Content[Pos];
/*var RemoveSubScript = Props.Action & c_oMathMenuAction.RemoveSubScript,
RemoveSuperScript = Props.Action & c_oMathMenuAction.RemoveSuperScript;
if(RemoveSubScript && Item.kind == MATH_DEGREESubSup && Item.Pr.type == DEGREE_SubSup)
{
this.private_AddModifiedDegree(Pos, DEGREE_SUPERSCRIPT);
bDelete = true;
}
else if(RemoveSuperScript && Item.kind == MATH_DEGREESubSup && Item.Pr.type == DEGREE_SubSup)
{
this.private_AddModifiedDegree(Pos, DEGREE_SUBSCRIPT);
bDelete = true;
}*/
if(Item.kind == MATH_DEGREESubSup && Item.Pr.type == DEGREE_SubSup && Props.Type == c_oAscMathInterfaceType.Script) if(Item.kind == MATH_DEGREESubSup && Item.Pr.type == DEGREE_SubSup && Props.Type == c_oAscMathInterfaceType.Script)
{ {
if(Props.ScriptType == c_oAscMathInterfaceScript.Sup) if(Props.ScriptType == c_oAscMathInterfaceScript.Sup)
...@@ -4844,17 +4828,12 @@ CMathContent.prototype.Delete_ItemToContentThroughInterface = function(Props, Po ...@@ -4844,17 +4828,12 @@ CMathContent.prototype.Delete_ItemToContentThroughInterface = function(Props, Po
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), 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,
//RemoveDegree = Props.Action & c_oMathMenuAction.RemoveScript && Item.kind == MATH_DEGREE,
//RemoveLimit = Props.Action & c_oMathMenuAction.RemoveLimit && Item.kind == MATH_LIMIT,
//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,
RemoveGroupChar = Props.Action & c_oMathMenuAction.RemoveGroupChar && Item.kind == MATH_GROUP_CHARACTER, RemoveGroupChar = Props.Action & c_oMathMenuAction.RemoveGroupChar && Item.kind == MATH_GROUP_CHARACTER,
RemoveRadical = Props.Action & c_oMathMenuAction.RemoveRadical && Item.kind == MATH_RADICAL, RemoveRadical = Props.Action & c_oMathMenuAction.RemoveRadical && Item.kind == MATH_RADICAL;
RemoveBox = Props.Action & c_oMathMenuAction.RemoveBox && Item.kind == MATH_BOX;
if(RemoveChar || RemoveBar || RemoveScript || RemoveLimit || RemoveMatrix || RemoveEqArray || RemoveDelimiter || RemoveGroupChar || RemoveRadical || RemoveBox) if(RemoveChar || RemoveBar || RemoveScript || RemoveLimit || RemoveMatrix || RemoveEqArray || RemoveDelimiter || RemoveGroupChar || RemoveRadical)
{ {
var Items = this.Content[Pos].Get_DeletedItemsThroughInterface(); var Items = this.Content[Pos].Get_DeletedItemsThroughInterface();
......
...@@ -1750,82 +1750,10 @@ CEqArray.prototype.Apply_MenuProps = function(Props) ...@@ -1750,82 +1750,10 @@ CEqArray.prototype.Apply_MenuProps = function(Props)
} }
}; };
CEqArray.prototype.old_Apply_MenuProps = function(Type, Gap)
{
switch(Type)
{
case c_oAscMathMenuTypes.EqArrayAddRowUnder:
{
this.Add_Row(this.CurPos + 1);
break;
}
case c_oAscMathMenuTypes.EqArrayAddRowOver:
{
this.Add_Row(this.CurPos);
break;
}
case c_oAscMathMenuTypes.EqArrayRemoveRow:
{
if(this.getRowsCount() > 1)
this.Remove_Row(this.CurPos);
break;
}
case c_oAscMathMenuTypes.EqArrayBaseJcCenter:
{
this.SetBaseJc(BASEJC_CENTER);
break;
}
case c_oAscMathMenuTypes.EqArrayBaseJcTop:
{
this.SetBaseJc(BASEJC_TOP);
break;
}
case c_oAscMathMenuTypes.EqArrayBaseJcBottom:
{
this.SetBaseJc(BASEJC_BOTTOM);
break;
}
case c_oAscMathMenuTypes.EqArrayRowSingleGap:
{
this.Modify_Interval(this.SpaceRow, 0, 0);
break;
}
case c_oAscMathMenuTypes.EqArrayRowOneAndHalfGap:
{
this.Modify_Interval(this.SpaceRow, 1, 0);
break;
}
case c_oAscMathMenuTypes.EqArrayRowDoubleGap:
{
this.Modify_Interval(this.SpaceRow, 2, 0);
break;
}
case c_oAscMathMenuTypes.EqArrayRowExactlyGap:
{
if(Gap >= 0 && Gap <= 31680)
{
this.Modify_Interval(this.SpaceRow, 3, Gap);
}
break;
}
case c_oAscMathMenuTypes.EqArrayRowMultipleGap:
{
if(Gap >= 0 && Gap <= 111)
{
this.Modify_Interval(this.SpaceRow, 4, Gap);
}
break;
}
}
};
CEqArray.prototype.Get_InterfaceProps = function() CEqArray.prototype.Get_InterfaceProps = function()
{ {
return new CMathMenuEqArray(this); return new CMathMenuEqArray(this);
}; };
CEqArray.prototype.Is_SimpleDelete = function()
{
return false;
};
CEqArray.prototype.Is_DeletedItem = function(Action) CEqArray.prototype.Is_DeletedItem = function(Action)
{ {
return Action & c_oMathMenuAction.DeleteEquation && 1 == this.getRowsCount(); return Action & c_oMathMenuAction.DeleteEquation && 1 == this.getRowsCount();
......
...@@ -462,7 +462,7 @@ CNary.prototype.Apply_MenuProps = function(Props) ...@@ -462,7 +462,7 @@ CNary.prototype.Apply_MenuProps = function(Props)
{ {
if(Props.Type == c_oAscMathInterfaceType.LargeOperator) if(Props.Type == c_oAscMathInterfaceType.LargeOperator)
{ {
if(Props.LimLoc !== undefined && false == this.Is_Inline() && this.Pr.limLoc !== Props.LimLoc) if(Props.LimLoc !== undefined && false == this.ParaMath.Is_Inline() && this.Pr.limLoc !== Props.LimLoc)
{ {
var LimLoc = Props.LimLoc == c_oAscMathInterfaceNaryLimitLocation.SubSup ? NARY_SubSup : NARY_UndOvr; var LimLoc = Props.LimLoc == c_oAscMathInterfaceNaryLimitLocation.SubSup ? NARY_SubSup : NARY_UndOvr;
History.Add(this, new CChangesMathNaryLimLoc(LimLoc, this.Pr.limLoc)); History.Add(this, new CChangesMathNaryLimLoc(LimLoc, this.Pr.limLoc));
...@@ -482,25 +482,6 @@ CNary.prototype.Apply_MenuProps = function(Props) ...@@ -482,25 +482,6 @@ CNary.prototype.Apply_MenuProps = function(Props)
} }
} }
}; };
CNary.prototype.old_Apply_MenuProps = function(Type)
{
if(Type == c_oAscMathMenuTypes.NaryLimLoc)
{
var NewLimLoc = this.private_GetLimLoc() == NARY_SubSup ? NARY_UndOvr : NARY_SubSup;
History.Add(this, new CChangesMathNaryLimLoc(NewLimLoc, this.Pr.limLoc));
this.raw_SetLimLoc(NewLimLoc);
}
else if(Type == c_oAscMathMenuTypes.NaryHideUpperIterator)
{
History.Add(this, new CChangesMathNaryUpperLimit(!this.Pr.supHide, this.Pr.supHide));
this.raw_HideUpperIterator(!this.Pr.supHide);
}
else if(Type == c_oAscMathMenuTypes.NaryHideLowerIterator)
{
History.Add(this, new CChangesMathNaryLowerLimit(!this.Pr.subHide, this.Pr.subHide));
this.raw_HideLowerIterator(!this.Pr.subHide);
}
};
CNary.prototype.Get_InterfaceProps = function() CNary.prototype.Get_InterfaceProps = function()
{ {
return new CMathMenuNary(this); return new CMathMenuNary(this);
...@@ -848,7 +829,7 @@ function CMathMenuNary(Nary) ...@@ -848,7 +829,7 @@ function CMathMenuNary(Nary)
if (true === Nary.LowerIterator.IsPlaceholder()) if (true === Nary.LowerIterator.IsPlaceholder())
HideLower = Nary.Pr.supHide == true; HideLower = Nary.Pr.supHide == true;
this.bCanChangeLimLoc = false == Nary.Is_Inline(); this.bCanChangeLimLoc = false == Nary.ParaMath.Is_Inline();
this.LimLoc = Nary.Pr.limLoc === NARY_SubSup ? c_oAscMathInterfaceNaryLimitLocation.SubSup : c_oAscMathInterfaceNaryLimitLocation.UndOvr; this.LimLoc = Nary.Pr.limLoc === NARY_SubSup ? c_oAscMathInterfaceNaryLimitLocation.SubSup : c_oAscMathInterfaceNaryLimitLocation.UndOvr;
this.HideUpper = HideUpper; this.HideUpper = HideUpper;
this.HideLower = HideLower; this.HideLower = HideLower;
......
...@@ -3858,148 +3858,6 @@ CDelimiter.prototype.Apply_MenuProps = function(Props) ...@@ -3858,148 +3858,6 @@ CDelimiter.prototype.Apply_MenuProps = function(Props)
} }
} }
}; };
CDelimiter.prototype.old_Apply_MenuProps = function(Type)
{
var bSymmetricDiff, bSymmetricDiffTwo;
switch(Type)
{
case c_oAscMathMenuTypes.DelimiterHideBegOper:
{
var NewBegCode;
if(false == this.begOper.Is_Empty())
{
NewBegCode = -1;
}
else if(true == this.endOper.Is_Empty())
{
NewBegCode = 0x28; // PARENTHESIS_LEFT
}
else
{
var TypeEndOper = this.endOper.Get_Type();
bSymmetricDiffTwo = TypeEndOper == BRACKET_CURLY_RIGHT || TypeEndOper == BRACKET_SQUARE_RIGHT;
bSymmetricDiff = TypeEndOper == PARENTHESIS_RIGHT || TypeEndOper == BRACKET_ANGLE_RIGHT || TypeEndOper == HALF_SQUARE_RIGHT || TypeEndOper == HALF_SQUARE_RIGHT_UPPER || TypeEndOper == WHITE_SQUARE_RIGHT;
var EndCodeChr = this.endOper.Get_CodeChr();
if(bSymmetricDiff)
{
NewBegCode = EndCodeChr - 1;
}
else if(bSymmetricDiffTwo)
{
NewBegCode = EndCodeChr - 2;
}
else
{
NewBegCode = EndCodeChr;
}
}
History.Add(this, new CChangesMathDelimBegOper(NewBegCode, this.Pr.begChr));
this.raw_HideBegOperator(NewBegCode);
break;
}
case c_oAscMathMenuTypes.DelimiterHideEndOper:
{
var NewEndCode;
if(false == this.endOper.Is_Empty())
{
NewEndCode = -1;
}
else if(true == this.begOper.Is_Empty())
{
NewEndCode = 0x29; // PARENTHESIS_RIGHT
}
else
{
var TypeBegOper = this.begOper.Get_Type();
bSymmetricDiffTwo = TypeBegOper == BRACKET_CURLY_LEFT || TypeBegOper == BRACKET_SQUARE_LEFT;
bSymmetricDiff = TypeBegOper == PARENTHESIS_LEFT || TypeBegOper == BRACKET_ANGLE_LEFT || TypeBegOper == HALF_SQUARE_LEFT || TypeBegOper == HALF_SQUARE_LEFT_UPPER || TypeBegOper == WHITE_SQUARE_LEFT;
var BegCodeChr = this.begOper.Get_CodeChr();
if(bSymmetricDiff)
{
NewEndCode = BegCodeChr + 1;
}
else if(bSymmetricDiffTwo)
{
NewEndCode = BegCodeChr + 2;
}
else
{
NewEndCode = BegCodeChr;
}
}
History.Add(this, new CChangesMathDelimEndOper(NewEndCode, this.Pr.endChr));
this.raw_HideEndOperator(NewEndCode);
break;
}
case c_oAscMathMenuTypes.DelimiterAddToLeft:
{
History.Add(this, new CChangesMathBaseSetColumn(this.Pr.column + 1, this.Pr.column));
this.raw_SetColumn(this.Pr.column + 1);
var NewContent = new CMathContent();
NewContent.Correct_Content(true);
this.protected_AddToContent(this.CurPos, [NewContent], true);
break;
}
case c_oAscMathMenuTypes.DelimiterAddToRight:
{
History.Add(this, new CChangesMathBaseSetColumn(this.Pr.column + 1, this.Pr.column));
this.raw_SetColumn(this.Pr.column + 1);
var NewContent = new CMathContent();
NewContent.Correct_Content(true);
this.protected_AddToContent(this.CurPos + 1, [NewContent], true);
break;
}
case c_oAscMathMenuTypes.DelimiterRemoveContent:
{
if(this.Pr.column > 1)
{
History.Add(this, new CChangesMathBaseSetColumn(this.Pr.column - 1, this.Pr.column));
this.raw_SetColumn(this.Pr.column - 1);
this.protected_RemoveItems(this.CurPos, [ this.Content[this.CurPos] ], true);
}
break;
}
case c_oAscMathMenuTypes.DelimiterGrow:
{
History.Add(this, new CChangesMathDelimiterGrow(!this.Pr.grow,this.Pr.grow));
this.raw_SetGrow(!this.Pr.grow);
break;
}
case c_oAscMathMenuTypes.DelimiterShpCentred:
{
if(this.Pr.grow == true)
{
var NewShp;
if(this.Pr.shp == DELIMITER_SHAPE_MATH)
NewShp = DELIMITER_SHAPE_CENTERED;
else
NewShp = DELIMITER_SHAPE_MATH;
History.Add(this, new CChangesMathDelimiterShape(NewShp, this.Pr.shp));
this.raw_SetShape(NewShp);
}
break;
}
}
};
CDelimiter.prototype.Get_InterfaceProps = function() CDelimiter.prototype.Get_InterfaceProps = function()
{ {
return new CMathMenuDelimiter(this); return new CMathMenuDelimiter(this);
...@@ -4047,9 +3905,32 @@ CDelimiter.prototype.raw_HideEndOperator = function(Value) ...@@ -4047,9 +3905,32 @@ CDelimiter.prototype.raw_HideEndOperator = function(Value)
this.RecalcInfo.bProps = true; this.RecalcInfo.bProps = true;
this.ApplyProperties(); this.ApplyProperties();
}; };
CDelimiter.prototype.Is_SimpleDelete = function() CDelimiter.prototype.Get_DeletedItemsThroughInterface = function()
{ {
return false; var DeletedItems = null;
if(this.Content.length > 0)
{
DeletedItems = this.Content[0].Content;
for(var Pos = 1; Pos < this.Content.length; Pos++)
{
var NewSpace = new CMathText(false);
NewSpace.add(0x20);
var CtrPrp = this.Get_CtrPrp();
var NewRun = new ParaRun(this.ParaMath.Paragraph, true);
NewRun.Apply_Pr(CtrPrp);
NewRun.Concat_ToContent( [NewSpace] );
DeletedItems = DeletedItems.concat(NewRun);
var Items = this.Content[Pos].Content;
DeletedItems = DeletedItems.concat(Items);
}
}
return DeletedItems;
}; };
CDelimiter.prototype.GetLastElement = function() CDelimiter.prototype.GetLastElement = function()
{ {
...@@ -4534,21 +4415,6 @@ CGroupCharacter.prototype.Apply_MenuProps = function(Props) ...@@ -4534,21 +4415,6 @@ CGroupCharacter.prototype.Apply_MenuProps = function(Props)
} }
} }
}; };
CGroupCharacter.prototype.old_Apply_MenuProps = function(Type)
{
if(Type == c_oAscMathMenuTypes.GroupCharOver && this.Pr.pos == LOCATION_BOT)
{
this.private_InversePr();
}
else if(Type == c_oAscMathMenuTypes.GroupCharUnder && this.Pr.pos == LOCATION_TOP)
{
this.private_InversePr();
}
};
CGroupCharacter.prototype.Is_SimpleDelete = function()
{
return true;
};
CGroupCharacter.prototype.private_GetInversePr = function(Pr) CGroupCharacter.prototype.private_GetInversePr = function(Pr)
{ {
var InversePr = new CMathGroupChrPr(); var InversePr = new CMathGroupChrPr();
......
...@@ -691,14 +691,6 @@ CRadical.prototype.Apply_MenuProps = function(Props) ...@@ -691,14 +691,6 @@ CRadical.prototype.Apply_MenuProps = function(Props)
} }
} }
}; };
CRadical.prototype.old_Apply_MenuProps = function(Type)
{
if(Type == c_oAscMathMenuTypes.RadicalHideDegree)
{
History.Add(this, new CChangesMathRadicalHideDegree( !this.Pr.degHide, this.Pr.degHide ));
this.raw_SetHideDegree(!this.Pr.degHide);
}
};
CRadical.prototype.Get_InterfaceProps = function() CRadical.prototype.Get_InterfaceProps = function()
{ {
return new CMathMenuRadical(this); return new CMathMenuRadical(this);
...@@ -718,10 +710,6 @@ CRadical.prototype.raw_SetHideDegree = function(Value) ...@@ -718,10 +710,6 @@ CRadical.prototype.raw_SetHideDegree = function(Value)
} }
} }
}; };
CRadical.prototype.Is_SimpleDelete = function()
{
return true;
};
CRadical.prototype.Can_ModifyArgSize = function() CRadical.prototype.Can_ModifyArgSize = function()
{ {
return this.CurPos == 0 && false === this.Is_SelectInside(); return this.CurPos == 0 && false === this.Is_SelectInside();
......
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