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

Добавление/удаление принудительного переноса для Box через контекстное меню

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@68237 954022d7-b5bf-4e40-9824-e11837661b57
parent d643537c
......@@ -3867,7 +3867,7 @@ var historyitem_Math_MatrixInterval = 52;
var historyitem_Math_MatrixPlh = 53;
var historyitem_Math_MatrixMinColumnWidth = 54;
var historyitem_Math_BarLinePos = 55;
var historyitem_Math_BoxAddForcedBreak = 56;
var historyitem_Math_BoxForcedBreak = 56;
var historyitem_Math_DegreeSubSupType = 57;
......@@ -3930,7 +3930,7 @@ function ReadChanges_FromBinary(Reader, Class)
case historyitem_Math_MatrixPlh : Changes = new CChangesMathMatrixPlh(); break;
case historyitem_Math_MatrixMinColumnWidth : Changes = new CChangesMathMatrixMinColumnWidth(); break;
case historyitem_Math_BarLinePos : Changes = new CChangesMathBarLinePos(); break;
case historyitem_Math_BoxAddForcedBreak : Changes = new CChangesMathBoxAddForcedBreak(); break;
case historyitem_Math_BoxForcedBreak : Changes = new CChangesMathBoxForcedBreak(); break;
case historyitem_Math_DegreeSubSupType : Changes = new CChangesMathDegreeSubSupType(); break;
}
......@@ -6116,14 +6116,40 @@ CChangesMathBarLinePos.prototype.Load_Changes = function(Reader, Class)
this.Redo(Class);
};
function CChangesMathBoxAddForcedBreak()
function CChangesMathBoxForcedBreak(NewBreak, OldBreak)
{
this.New = NewBreak;
this.Old = OldBreak;
}
CChangesMathBoxAddForcedBreak.prototype.Type = historyitem_Math_BoxAddForcedBreak;
CChangesMathBoxAddForcedBreak.prototype.Undo = function(Class)
CChangesMathBoxForcedBreak.prototype.Type = historyitem_Math_BoxForcedBreak;
CChangesMathBoxForcedBreak.prototype.Undo = function(Class)
{
Class.raw_ForcedBreak(this.Old);
};
CChangesMathBoxForcedBreak.prototype.Redo = function(Class)
{
Class.raw_ForcedBreak(this.New);
};
CChangesMathBoxForcedBreak.prototype.Save_Changes = function(Writer)
{
if ( undefined === this.New )
{
Writer.WriteBool( true );
}
else
{
Writer.WriteBool( false );
Writer.WriteBool( this.New );
}
};
CChangesMathBoxForcedBreak.prototype.Load_Changes = function(Reader, Class)
{
if (true === Reader.GetBool())
this.New = undefined;
else
this.New = Reader.GetBool();
this.Redo(Class);
};
......
......@@ -2684,11 +2684,11 @@ CMathBase.prototype.Is_SelectInside = function()
{
return this.Selection.Use == true && this.Selection.StartPos !== this.Selection.EndPos;
};
CMathBase.prototype.Can_AddManualBreak = function()
CMathBase.prototype.Can_InsertForcedBreak = function()
{
return false;
};
CMathBase.prototype.Can_DeleteManualBreak = function()
CMathBase.prototype.Can_DeleteForcedBreak = function()
{
return false;
};
......@@ -3016,8 +3016,8 @@ var c_oMathMenuAction = {
DeleteDelimiterArgument : 0x00000400,
IncreaseArgumentSize : 0x00000800,
DecreaseArgumentSize : 0x00001000,
InsertManualBreak : 0x00002000,
DeleteManualBreak : 0x00004000,
InsertForcedBreak : 0x00002000,
DeleteForcedBreak : 0x00004000,
AlignToCharacter : 0x00008000,
RemoveDelimiter : 0x00010000,
RemoveRadical : 0x00020000
......@@ -3033,16 +3033,16 @@ function CMathMenuBase(oMath)
{
this.CanIncreaseArgumentSize = false;
this.CanDecreaseArgumentSize = false;
this.CanInsertManualBreak = false;
this.CanDeleteManualBreak = false;
this.CanInsertForcedBreak = false;
this.CanDeleteForcedBreak = false;
this.CanAlignToCharacter = false;
}
else
{
this.CanIncreaseArgumentSize = oMath.Can_IncreaseArgumentSize();
this.CanDecreaseArgumentSize = oMath.Can_DecreaseArgumentSize();
this.CanInsertManualBreak = oMath.Can_AddManualBreak();
this.CanDeleteManualBreak = oMath.Can_DeleteManualBreak();
this.CanInsertForcedBreak = oMath.Can_InsertForcedBreak();
this.CanDeleteForcedBreak = oMath.Can_DeleteForcedBreak();
this.CanAlignToCharacter = false;
}
}
......@@ -3120,11 +3120,11 @@ CMathMenuBase.prototype.decrease_ArgumentSize = function()
};
CMathMenuBase.prototype.can_InsertManualBreak = function()
{
return this.CanInsertManualBreak;
return this.CanInsertForcedBreak;
};
CMathMenuBase.prototype.can_DeleteManualBreak = function()
{
return this.CanDeleteManualBreak;
return this.CanDeleteForcedBreak;
};
CMathMenuBase.prototype.can_AlignToCharacter = function()
{
......@@ -3132,11 +3132,11 @@ CMathMenuBase.prototype.can_AlignToCharacter = function()
};
CMathMenuBase.prototype.insert_ManualBreak = function()
{
this.Action |= c_oMathMenuAction.InsertManualBreak;
this.Action |= c_oMathMenuAction.InsertForcedBreak;
};
CMathMenuBase.prototype.delete_ManualBreak = function()
{
this.Action |= c_oMathMenuAction.DeleteManualBreak;
this.Action |= c_oMathMenuAction.DeleteForcedBreak;
};
CMathMenuBase.prototype.align_ToCharacter = function()
{
......
......@@ -645,6 +645,24 @@ CMathBoxPr.prototype.Apply_AlnAt = function(alnAt)
this.brk.Apply_AlnAt(alnAt);
}
};
CMathBoxPr.prototype.IsForcedBreak = function()
{
return this.opEmu == true && this.brk !== undefined;
};
CMathBoxPr.prototype.Insert_ForcedBreak = function()
{
if(false == this.IsForcedBreak())
{
this.brk = new CMathBreak();
}
};
CMathBoxPr.prototype.Delete_ForcedBreak = function()
{
if(true == this.IsForcedBreak())
{
this.brk = undefined;
}
};
CMathBoxPr.prototype.Copy = function()
{
var NewPr = new CMathBoxPr();
......@@ -768,7 +786,7 @@ CBox.prototype.IsForcedBreak = function()
{
var bInline = this.ParaMath.Is_Inline();
return bInline == false && this.Pr.opEmu == true && this.Pr.brk !== undefined;
return bInline == false && this.Pr.IsForcedBreak();
};
CBox.prototype.Get_AlignBrk = function()
{
......@@ -803,20 +821,46 @@ CBox.prototype.Can_ModifyArgSize = function()
{
return false === this.Is_SelectInside();
};
CBox.prototype.Apply_MenuProps = function(Props)
{
if(Props.Type === c_oAscMathInterfaceType.Box)
{
if(Props.Action & c_oMathMenuAction.InsertForcedBreak && true == this.Can_InsertForcedBreak())
{
History.Add(this, new CChangesMathBoxForcedBreak(true, false));
this.raw_ForcedBreak(true);
}
if(Props.Action & c_oMathMenuAction.DeleteForcedBreak && true == this.Can_DeleteForcedBreak())
{
History.Add(this, new CChangesMathBoxForcedBreak(false, true));
this.raw_ForcedBreak(false);
}
}
};
CBox.prototype.Get_InterfaceProps = function()
{
return new CMathMenuBox(this);
};
CBox.prototype.Can_AddManualBreak = function()
CBox.prototype.Can_InsertForcedBreak = function()
{
var bInline = this.ParaMath.Is_Inline();
return false === bInline && true == this.Pr.opEmu;
return false === this.IsForcedBreak();
};
CBox.prototype.Can_DeleteManualBreak = function()
CBox.prototype.Can_DeleteForcedBreak = function()
{
return this.IsForcedBreak();
};
CBox.prototype.raw_ForcedBreak = function(InsertBreak)
{
if(InsertBreak)
{
this.Pr.Insert_ForcedBreak();
}
else
{
this.Pr.Delete_ForcedBreak();
}
};
/**
*
......
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